You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13
Original file line number
Diff line number
Diff line change
@@ -95,6 +95,19 @@ example:
95
95
source: "https://github.com/joeblogs/example.git"
96
96
version: "master"
97
97
```
98
+
99
+
## Dynamic Version support
100
+
Once you modularize your terraform modules and begin versioning them. The consuming terrafile repo, see environments example above often requires separate PR against it just to uptake the latest version. In non prod environments you might want to bypass this by utilizing dynamic versioning.
101
+
You can use dynamic versioning to allow auto update, so instead of just having master as the version, you can provide tf1.+, or tf1.3.+ etc... to provide more flexibility.
102
+
When might you require more flexibility:
103
+
Often terraform is kept in a subfolder alondside the service source code, but it will be released on a different cadence, so it should have its own independent versioning. For example you may be using semantic versioning for your service code, v1.0,0, but you want to distinguish terraform changes using a different prefix, for example tf1.0.0 In this way you can release terraform changes separately to service code changes. If you have pure terraform modules you can then use same prefix tfx.x.x
104
+
Terraform versioning isn't quite the same as semantic versioning for application code.
105
+
First digit indicates manual changes that need to be applied,
106
+
Second digit indicates a change that could be automatically applied(you may not have automatic system yet, but still use this critieria until you do)
107
+
Third digit is for hotpatch fixes. You have something in production but you cannot rollback, or apply all the changes in your module since, so you branch at production version and release a patch version.
108
+
109
+
110
+
98
111
99
112
## Local installation, useful for Testing (python 3)
Copy file name to clipboardExpand all lines: terrafile/__main__.py
+4-1
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,7 @@
5
5
fromterrafileimportupdate_modules
6
6
7
7
optimizedownloads=False
8
+
versionprefix="tf"
8
9
iflen(sys.argv) <3:
9
10
iflen(sys.argv) <2:
10
11
path=os.getcwd()
@@ -14,9 +15,11 @@
14
15
parser=argparse.ArgumentParser()
15
16
parser.add_argument('--terrafile', required=False, default=os.getcwd(), dest='path', help='location of Terrafile')
16
17
parser.add_argument('--optimizedownloads', required=False, default=False, dest='optimizedownloads', help='Switch on opinionated distinct module downloads')
18
+
parser.add_argument('--versionprefix', required=False, default="tf", dest='versionprefix', help='terraform module version prefix tf or v as in tf1.0.0 or v1.0.0')
0 commit comments