@@ -78,9 +78,9 @@ _________________________________________
7878The Build Sequence
7979__________________
8080
81- * A branch is merged into `master ` in the GitHub repo
82- * GitHub emits a webhook event to AWS CodeBuild indicating that a commit was
83- pushed to ` master `
81+ * A branch is merged into `master ` in the GitHub repo or a version git tag is
82+ applied to a commit
83+ * GitHub emits a webhook event to AWS CodeBuild indicating this
8484* AWS CodeBuild reads the
8585 `buildspec.yml <https://github.com/mozilla/MozDef/blob/master/cloudy_mozdef/buildspec.yml >`_
8686 file to know what to do
@@ -98,8 +98,28 @@ __________________
9898 target of the `Makefile ` which calls `docker-compose build ` on the
9999 `docker-compose.yml <https://github.com/mozilla/MozDef/blob/master/docker/compose/docker-compose.yml >`_
100100 file, building the docker images in the AWS CodeBuild environment. These are
101- built so they can be uploaded later to DockerHub for use by developers and
102- the community.
101+ built both so they can be consumed later in the build by packer and also
102+ for use by developers and the community.
103+ * `deploy ` then calls the
104+ `docker-push-tagged <https://github.com/mozilla/MozDef/blob/cfeafb77f9d4d4d8df02117a0ffca0ec9379a7d5/Makefile#L113 >`_
105+ make target which calls
106+
107+ * the tag-images _
108+ make target which calls the
109+ `cloudy_mozdef/ci/docker_tag_or_push tag <https://github.com/mozilla/MozDef/blob/master/cloudy_mozdef/ci/docker_tag_or_push >`_
110+ script which applies a docker image tag to the local image that was just
111+ built by AWS CodeBuild.
112+ * the
113+ `hub-tagged <https://github.com/mozilla/MozDef/blob/cfeafb77f9d4d4d8df02117a0ffca0ec9379a7d5/Makefile#L116-L117 >`_
114+ make target which calls the
115+ `cloudy_mozdef/ci/docker_tag_or_push push <https://github.com/mozilla/MozDef/blob/master/cloudy_mozdef/ci/docker_tag_or_push >`_
116+ script which
117+
118+ * Uploads the local image that was just built by AWS CodeBuild to DockerHub.
119+ If the branch being built is `master ` then the image is uploaded both with
120+ a tag of `master ` as well as with a tag of `latest `
121+ * If the branch being built is from a version tag (e.g. `v1.2.3 `) then the
122+ image is uploaded with only that version tag applied
103123* The `deploy ` script next calls the
104124 `packer-build-github <https://github.com/mozilla/MozDef/blob/cfeafb77f9d4d4d8df02117a0ffca0ec9379a7d5/cloudy_mozdef/Makefile#L34-L36 >`_
105125 make target in the
@@ -124,31 +144,14 @@ __________________
124144 * Within this ec2 instance, packer `clones the MozDef GitHub repo and checks
125145 out the branch that triggered this build
126146 <https://github.com/mozilla/MozDef/blob/cfeafb77f9d4d4d8df02117a0ffca0ec9379a7d5/cloudy_mozdef/packer/packer.json#L59-L60> `_
127- * packer calls the `set-version-and-fetch-docker-container <https://github.com/mozilla/MozDef/blob/cfeafb77f9d4d4d8df02117a0ffca0ec9379a7d5/Makefile#L148-L149 >`_
128- target of the `Makefile ` which
129-
130- * Calls the
131- `build-from-cwd <https://github.com/mozilla/MozDef/blob/cfeafb77f9d4d4d8df02117a0ffca0ec9379a7d5/Makefile#L78-L79 >`_
132- target of the `Makefile ` which calls `docker-compose build ` on the
133- `docker-compose.yml <https://github.com/mozilla/MozDef/blob/master/docker/compose/docker-compose.yml >`_
134- file, building the docker images in the packer ec2 environment
135- * Calls the tag-images _
136- make target which calls the `cloudy_mozdef/ci/docker_tag_or_push tag <https://github.com/mozilla/MozDef/blob/master/cloudy_mozdef/ci/docker_tag_or_push >`_
137- script.
138-
139- * This applies a docker image tag to the local image that was just built
140- by packer. This tag will be referenced by the
141- `docker-compose-cloudy-mozdef.yml ` file when the MozDef ec2 instance is
142- launched from the AMI.
143-
144- * Replaces all instances of the word `latest ` in the
145- `docker-compose-cloudy-mozdef.yml <https://github.com/mozilla/MozDef/blob/master/docker/compose/docker-compose-cloudy-mozdef.yml >`_
146- file with either the branch `master ` or the version tag (e.g. `v1.2.3 `)
147-
147+ * packer replaces all instances of the word `latest ` in the
148+ `docker-compose-cloudy-mozdef.yml <https://github.com/mozilla/MozDef/blob/master/docker/compose/docker-compose-cloudy-mozdef.yml >`_
149+ file with either the branch `master ` or the version tag (e.g. `v1.2.3 `)
148150 * packer runs `docker-compose pull ` on the
149151 `docker-compose-cloudy-mozdef.yml <https://github.com/mozilla/MozDef/blob/master/docker/compose/docker-compose-cloudy-mozdef.yml >`_
150- file to pull down any remaining non MozDef container images that weren't
151- just built in preceding packer steps
152+ file to pull down both the docker images that were just built by AWS
153+ CodeBuild and uploaded to Dockerhub as well as other non MozDef docker
154+ images
152155
153156* After packer completes executing the steps laid out in `packer.json ` inside
154157 the ec2 instance, it generates an AMI from that instance and continues with
@@ -168,26 +171,5 @@ __________________
168171 * uploads the CloudFormation templates to S3 in a directory either called
169172 `master ` or the tag version that was built (e.g. `v1.2.3 `)
170173
171- * `deploy ` then calls the
172- `docker-push-tagged <https://github.com/mozilla/MozDef/blob/cfeafb77f9d4d4d8df02117a0ffca0ec9379a7d5/Makefile#L113 >`_
173- make target which calls
174-
175- * the tag-images _
176- make target which calls the
177- `cloudy_mozdef/ci/docker_tag_or_push tag <https://github.com/mozilla/MozDef/blob/master/cloudy_mozdef/ci/docker_tag_or_push >`_
178- script which applies a docker image tag to the local image that was just
179- built by AWS CodeBuild.
180- * the
181- `hub-tagged <https://github.com/mozilla/MozDef/blob/cfeafb77f9d4d4d8df02117a0ffca0ec9379a7d5/Makefile#L116-L117 >`_
182- make target which calls the
183- `cloudy_mozdef/ci/docker_tag_or_push push <https://github.com/mozilla/MozDef/blob/master/cloudy_mozdef/ci/docker_tag_or_push >`_
184- script which
185-
186- * Uploads the local image that was just built by AWS CodeBuild to DockerHub.
187- If the branch being built is `master ` then the image is uploaded both with
188- a tag of `master ` as well as with a tag of `latest `
189- * If the branch being built is from a version tag (e.g. `v1.2.3 `) then the
190- image is uploaded with only that version tag applied
191-
192174.. _docker/compose/docker-compose-tests.yml : https://github.com/mozilla/MozDef/blob/master/docker/compose/docker-compose-tests.yml
193175.. _tag-images : https://github.com/mozilla/MozDef/blob/cfeafb77f9d4d4d8df02117a0ffca0ec9379a7d5/Makefile#L109-L110
0 commit comments