Skip to content

Commit a358681

Browse files
apply environment tags
1 parent 5c2bca6 commit a358681

File tree

6 files changed

+18
-7
lines changed

6 files changed

+18
-7
lines changed

cicd/1-setup/deploy-cicd-dependencies.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ then
2121
--stack-name javabuilder-cicd-deps \
2222
--template-file ${TEMPLATE_FILE} \
2323
--capabilities CAPABILITY_IAM \
24+
--tags environment=cicd \
2425
"$@"
2526

2627
echo Complete!

cicd/2-cicd/deploy-cicd.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ then
4444
--template-file $TEMPLATE_FILE \
4545
--parameter-overrides GitHubBranch=$TARGET_BRANCH GitHubBadgeEnabled=$GITHUB_BADGE_ENABLED Mode=$MODE \
4646
--capabilities CAPABILITY_IAM \
47+
--tags environment=cicd \
4748
"$@"
4849

4950
echo Complete!

cicd/3-app/javabuilder/config/adhoc.config.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,8 @@
77
"LimitPerHour": "50",
88
"LimitPerDay": "150",
99
"SilenceAlerts": "true"
10+
},
11+
"Tags" : {
12+
"environment" : "adhoc"
1013
}
1114
}

cicd/3-app/javabuilder/config/production.config.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,8 @@
77
"LimitPerHour": "150",
88
"LimitPerDay": "300",
99
"SilenceAlerts": "false"
10+
},
11+
"Tags" : {
12+
"environment" : "production"
1013
}
1114
}

cicd/3-app/javabuilder/config/test.config.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,8 @@
77
"LimitPerHour": "15",
88
"LimitPerDay": "40",
99
"SilenceAlerts": "false"
10+
},
11+
"Tags" : {
12+
"environment" : "test"
1013
}
1114
}

cicd/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,19 @@ Finally, all of the above need some Roles to exist in the AWS accounts before we
4747
2. Push a commit to `main`
4848
3. Press the "Release Change" button on the Pipeline overview page in the AWS Console.
4949

50-
### Deploying a CI/CD pipeline for a different branch
50+
### Deploying an Adhoc environment
5151

52-
By setting the `TARGET_BRANCH` you can create a new CI/CD pipeline that watches for PR's and changes to the specified branch, deploying a Test and Production environment just like the standard pipeline.
52+
You can create an Adhoc environment by setting the `MODE` flag on the cicd deploy script. This will create a CI/CD pipeline that will watch for updates to your `TARGET_BRANCH`. The difference between a standard deployment and an adhoc pipeline can be seen in "cicd.template.yml" by following where the `Conditions` are used. In short, an adhoc creates an adhoc environment using "adhoc.config.yml", while a standard deployment will create a Test environment and a Prod environment using the relevent config files.
53+
Note: your branch name cannot contain the character `\`, as this causes issues in AWS. Note that resources will be deployed with the tags `{environment = adhoc}`.
5354

5455
```
55-
TARGET_BRANCH=mybranch cicd/2-cicd/deploy-cicd.sh
56+
TARGET_BRANCH=mybranch MODE=adhoc cicd/2-cicd/deploy-cicd.sh
5657
```
5758

58-
### Deploying an Adhoc environment
59+
### Deploying a full CI/CD pipeline for a different branch
5960

60-
You can create an Adhoc environment by setting the `MODE` flag on the cicd deploy script. This will create a CI/CD pipeline that will watch for updates to your `TARGET_BRANCH`. The difference between a standard deployment and an adhoc pipeline can be seen in "cicd.template.yml" by following where the `Conditions` are used. In short, an adhoc creates an adhoc environment using "adhoc.config.yml", while a standard deployment will create a Test environment and a Prod environment using the relevent config files.
61-
Note: your branch name cannot contain the character `\`, as this causes issues in AWS.
61+
By setting the `TARGET_BRANCH` you can create a new CI/CD pipeline that watches for PR's and changes to the specified branch, deploying a Test and Production environment just like the standard pipeline. Note that resources will be deployed with the tags `{environment = production}` or `{environment = test}`.
6262

6363
```
64-
TARGET_BRANCH=mybranch MODE=adhoc cicd/2-cicd/deploy-cicd.sh
64+
TARGET_BRANCH=mybranch cicd/2-cicd/deploy-cicd.sh
6565
```

0 commit comments

Comments
 (0)