@@ -8,14 +8,35 @@ Platform CLI you'll need to convert the old file into the new format.
88The Platform CLI provides commands for doing this migration, though the exact
99steps you need to take will vary depending on what templates you have installed.
1010
11- > [ !IMPORTANT]
12- >
13- > If you running a very old (pre-summer 2024) version of a template
14- > (particularly ` template-infra ` ), reach out to the platform team for some
15- > guidance.
16-
1711## template-infra
1812
13+ The switch to Platform CLI happened with ` v0.15.0 ` . If you are running a version
14+ earlier than this, you'll need to migrate things.
15+
16+ One way to figure out what version of ` template-infra ` your project is using is
17+ to run, at the root of your project:
18+
19+ ``` sh
20+ nava-platform infra info --template-uri gh:navapbc/template-infra .
21+ ```
22+
23+ Look for the "Closest upstream version" value. If it is "Unknown", reach out to
24+ the Platform team for guidance.
25+
26+ If the value is pre-` v0.12.0 ` , you may want to approach the update in smaller
27+ steps than jumping directly to ` v0.15.0 ` . You can use the Platform CLI to do
28+ these updates as well, see [ Migrate in smaller
29+ steps] ( #migrate-in-smaller-steps ) .
30+
31+ As always, read the [ release
32+ notes] ( https://github.com/navapbc/template-infra/releases ) for each version
33+ between your current one and your ultimate target. This process does not
34+ eliminate the need to apply the state changes/manual migration steps, it just
35+ updates the code. See [ Version callouts] ( #version-callouts ) below for some
36+ particular things to consider.
37+
38+ ### Migrate to latest
39+
1940To transform the old ` .template-version ` file into the new format, run:
2041
2142``` sh
@@ -26,7 +47,9 @@ This will result in a `.template-infra/` directory with a number of files inside
2647of it. Check that the ` app-<APP_NAME>.yml ` files all correspond to proper
2748applications. Remove any that don't and update the commit.
2849
29- Now perform the update, with:
50+ This gets your project into a state that Platform CLI can understand.
51+
52+ Now perform the actual template update, with:
3053
3154``` sh
3255nava-platform infra update .
@@ -46,6 +69,78 @@ nava-platform infra update-app --all .
4669Likely you'll hit merge conflicts for each app as well, resolve those, commit,
4770and move on to the next app, until you've done them all.
4871
72+ See [ the docs on updating in general] ( ../updating.md ) for more details on running
73+ updates.
74+
75+ ### Migrate in smaller steps
76+
77+ This is similar to the previous section, so read that first.
78+
79+ 1 . Run the ` migrate-from-legacy ` command as stated in previous section. This
80+ gets you into the Platform CLI ecosystem.
81+ 2 . Then decide which version of ` template-infra ` you want to update to,
82+ represented by ` v0.x.x ` in the following example:
83+ ``` sh
84+ nava-platform infra update --version platform-cli-migration/v0.x.x .
85+ ```
86+ 3 . Follow update guidance as discussed in previous section.
87+ 4 . Do steps 2-3 over and over, jumping versions as you see fit until you hit
88+ ` v0.15.0 ` .
89+ 5 . Once on ` v0.15.0 ` , run a final update to get to the latest release (or to
90+ whatever post-` v0.15.0 ` version you want):
91+ ``` sh
92+ nava-platform infra update [--version vA.B.C] .
93+ ```
94+
95+ ### Version callouts
96+
97+ No substitute for reading the [ release
98+ notes] ( https://github.com/navapbc/template-infra/releases ) , but here are a few
99+ points to consider when deciding what version to update to if you are
100+ significantly behind the latest:
101+
102+ - A Feature Flags module, backed by AWS Evidently, was added in
103+ [ v0.5.0] ( https://github.com/navapbc/template-infra/releases/tag/v0.5.0 ) and
104+ removed in
105+ [ v0.13.0] ( https://github.com/navapbc/template-infra/releases/tag/v0.13.0 ) .
106+ - If you are coming from pre-v0.5.0, you can delete the feature flag module
107+ as you move past v0.5.0, or just ignore/don't change anything about it and
108+ it will get cleaned up once you are post-v0.13.0.
109+ - [ v0.9.0] ( https://github.com/navapbc/template-infra/releases/tag/v0.9.0 ) moved
110+ account mapping to each environment config file, then
111+ [ v0.11.0] ( https://github.com/navapbc/template-infra/releases/tag/v0.11.0 )
112+ removed it from each environment config file and moved it to the network config.
113+ - If you are pre-v0.9.0, you may want to consider jumping to v0.11.x+ to
114+ avoid dealing with moving things multiple times.
115+
116+ Misc. others:
117+
118+ - [ v0.11.0] ( https://github.com/navapbc/template-infra/releases/tag/v0.11.0 )
119+ - Starts pinning specific Terraform version in CI/CD
120+ - [ v0.10.0] ( https://github.com/navapbc/template-infra/releases/tag/v0.10.0 )
121+ - DB changes: PostgreSQL version update to 16.2 and DB schema name hardcoded
122+ to ` app `
123+ - [ v0.9.0] ( https://github.com/navapbc/template-infra/releases/tag/v0.9.0 )
124+ - Requires Terraform 1.8.x (previous requirement was just >=1.4, more or less)
125+ - Changes the way secrets are defined
126+ - [ v0.7.0] ( https://github.com/navapbc/template-infra/releases/tag/v0.7.0 )
127+ - Minor state migration needed
128+ - [ v0.6.0] ( https://github.com/navapbc/template-infra/releases/tag/v0.6.0 )
129+ - Networking changes likely requiring hours of downtime to apply
130+
131+ ### Post-migration
132+
133+ After completing the migration, you may want to see what results from
134+ re-applying, more holistically, the latest (or your ultimate target) version of
135+ the template to the project:
136+
137+ ``` sh
138+ nava-platform infra update --force [--version vA.B.C] .
139+ ```
140+
141+ This discards some of the "smart" logic of a regular update and might catch some
142+ things that were missed while trying to be smarter.
143+
49144## Application templates
50145
51146These are historically less standard, so you'll have to provide a little more
0 commit comments