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
* Provide fast feedback on Pull Requests of any build/verify failures
7
-
* Run all integration/acceptance tests in a non-prod environment
8
-
* Provide a non-prod development environment that local resources can interact with
9
-
* Easily create an ad-hoc environment for a given branch, which updates with changes
10
-
* Eliminate or minimize manual AWS Console configuration
11
-
* Use policies and roles with least-privilege
12
-
***CodeBuild** For every PR created that merges into `main`
13
-
* Build the project, ensure it compiles/transpiles/validates
14
-
* Run all tests
15
-
* Update the PR with the build/test status
16
-
* Provide easily accessible logs and artifacts from the build/test job
17
-
***CodePipeline** For every commit merged to `main`
18
-
* Run tests and build artifacts necessary for deployment
19
-
* Deploy the application to a Test environment
20
-
* As prod-like as possible
21
-
* Run integration and acceptance tests in the Test environment
22
-
* Make test results and artifacts easily accessible to developers
23
-
* If Test environment passes all tests, then deploy to Prod environment
24
-
* Deploy the application to a Dev environment
25
-
26
2
## CI/CD Implementation
27
3
28
4
There are three phases of the CI/CD configuration. They are best explained in reverse order from the way they flow in practice.
@@ -31,29 +7,45 @@ There are three phases of the CI/CD configuration. They are best explained in re
31
7
32
8
All of the application resources are defined in a CloudFormation template. We could manually update the CloudFormation stack with an updated template every time we have a code change, but it is considerably less effort and less risky to automate this with a CI/CD pipeline. By using parameters, we can use the same code to deploy multiple environments.
33
9
34
-
**Note: The application template has not been incorporated into the CI/CD implementation yet. That is the next step. The plan is to migrate 'template.yml.erb' from the root, into this folder.**
35
-
36
10
We also keep some CodeBuild configuration here, as this code tends to be more coupled to current application code, than the CI/CD code in the next section.
37
11
38
-
* "app.template.yml" - AWS resources for the application
39
-
* "buildspec.yml" - Main build/verify instructions
12
+
***javabuilder/**
13
+
* "template.yml" - AWS resources for the javabuilder application
14
+
* "buildspec.yml" - Main build/verify instructions, used during pipeline builds
15
+
* "pr-buildspec.yml" - Similar build/verify instructions, used during PR verification
16
+
* "integration-test-buildspec.yml" - Instructions for integration tests run against a deployed environment
17
+
***config/** - JSON configuration for each environment
18
+
***load-test/** - resources for the load-test environment
19
+
* deploy-load-test.sh - manual deployment script for the load-test environment (not deployed via CICD)
40
20
41
21
### 2 - CI/CD
42
22
43
-
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 that 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 adhoc environments by launching a new CI/CD stack targeting a different branch).
44
24
45
-
These resources are deployed manually when changes occur. We could make yet another CodePipeline resource in the Setup section, but not today.
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.
46
26
47
-
* "deploy-cicd.sh" - Shell script to deploy this stack.
27
+
* "deploy-cicd.sh" - Shell script to create/update this stack
48
28
* "cicd.template.yml" - AWS resources for the CI/CD infrastructure
49
29
50
30
### 1 - Setup
51
31
52
-
Finally, all of the above need some Roles to exist in the AWS accounts before we can run things with appropriate permisions. These roles are exported and used elsewhere. Elevated permissions is likely required to update these. This only needs to be created once, as roles and other resources can be shared by all CI/CD stacks for this application.
32
+
Finally, all of the above need some Roles to exist in the AWS accounts before we can run things with appropriate permisions. These roles are exported and used elsewhere. Elevated permissions are required to update these (likely by an Infra Engineer). This only needs to be created once, as roles and other resources can be shared by all CI/CD stacks for this application.
53
33
54
-
* "deploy-setup.sh"
34
+
* "deploy-setup.sh" - Shell script to create/update this stack
55
35
* "setup.template.yml" - AWS resources for the Setup infrastructure
56
36
57
-
## Opportunities
37
+
## Deploying an entirely new Javabuilder
38
+
39
+
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.
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`.
58
48
59
-
- Design more granular notifications by calling Slack webhooks _within_ steps.
0 commit comments