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: cicd/2-cicd/cicd.template.yml
+36-14Lines changed: 36 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -26,16 +26,16 @@ Parameters:
26
26
Type: String
27
27
Description: The Resource Id component of the CodeStar connection ARN for the code-dot-org GitHub repository
28
28
Default: 9e27ebd6-de25-495c-9a2d-b24077376de8
29
-
Mode:
29
+
EnvironmentType:
30
30
Type: String
31
-
Description: Whether this should create a pipeline for an 'adhoc' deployment or 'standard' pipeline.
32
-
Default: standard
33
-
AllowedValues: [adhoc, standard]
31
+
Description: A 'production' cicd stack includes automated tests in the pipeline and deploys 'test' and 'production' environments. Whereas a 'development' type will only deploy a development environment.
32
+
Default: production
33
+
AllowedValues: [development, production]
34
34
35
35
Conditions:
36
36
TargetsMainBranch: !Equals [ !Ref GitHubBranch, main ]
37
-
DeployToAdhoc: !Equals [!Ref Mode, adhoc ]
38
-
DeployToTestAndProd: !Equals [!Ref Mode, standard ]
37
+
DeployForDevelopment: !Equals [!Ref EnvironmentType, development ]
38
+
DeployForProduction: !Equals [!Ref EnvironmentType, production ]
Copy file name to clipboardExpand all lines: cicd/README.md
+12-8Lines changed: 12 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ We also keep some CodeBuild configuration here, as this code tends to be more co
20
20
21
21
### 2 - CI/CD
22
22
23
-
In order to trigger the application resources to be updated upon changes to the source code, we need CI/CD resources. This is accomplished by a CloudFormation template that defines a stack of resources, primarily including a CodeBuild project and a CodePipeline pipeline which update the [App Stack](#3---app). These CI/CD resources only need to be deployed once per deployable branch, `main` in our case (we might choose to create adhoc environments by launching a new CI/CD stack targeting a different branch).
23
+
In order to trigger the application resources to be updated upon changes to the source code, we need CI/CD resources. This is accomplished by a CloudFormation template that defines a stack of resources, primarily including a CodeBuild project and a CodePipeline pipeline which update the [App Stack](#3---app). These CI/CD resources only need to be deployed once per deployable branch, `main` in our case (we might choose to create development environments by launching a new CI/CD stack targeting a different branch).
24
24
25
25
These resources are deployed manually when changes occur. We could make yet another CodePipeline resource in the [Setup](#1---setup) section, but not today.
26
26
@@ -47,19 +47,23 @@ Finally, all of the above need some Roles to exist in the AWS accounts before we
47
47
2. Push a commit to `main`
48
48
3. Press the "Release Change" button on the Pipeline overview page in the AWS Console.
49
49
50
-
### Deploying a CI/CD pipeline for a different branch
50
+
### Deploying an Development environment
51
51
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 Development (aka 'adhoc') environment by setting the `ENVIRONMENT_TYPE` 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 production and a development pipeline can be seen in "cicd.template.yml" by following where the `Conditions` are used. In short, an development pipeline creates a single environment using "dev.config.yml", while a production deployment will create a Test environment and a Prod environment using the relevent config files, running automated tests between them.
53
+
54
+
Notes:
55
+
56
+
* your branch name cannot contain the character `/`, as this causes issues in AWS. Note that resources will be deployed with the tags `{EnvType = development}`.
57
+
* for now, these must deployed to the production AWS account. There is planned work to enable these to be deployed to the Dev AWS account.
### Deploying a full CI/CD pipeline for a different branch
59
64
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.
65
+
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 `{EnvType = production}` or `{EnvType = test}`.
0 commit comments