CI Pipeline (deployed with Control Tower!)
To build and test you'll need:
- Golang 1.16+
control-tower-ops
cloned at the same level as this repository (i.e. a sibling directory). Check the latest release ofcontrol-tower
for the appropriate tag ofcontrol-tower-ops
.
control-tower
uses golang compile-time variables to set the release versions it uses. To build locally use the build_local.sh
script, rather than running go build
.
Run our linting script (requires gometalinter
to be installed):
./ci/tasks/lint.sh
To Run tests from your host:
go install github.com/maxbrunsfeld/counterfeiter/v6
cp ../control-tower-ops/manifest.yml opsassets/assets/
cp -R ../control-tower-ops/ops opsassets/assets/
cp ../control-tower-ops/createenv-dependencies-and-cli-versions-aws.json opsassets/assets/
cp ../control-tower-ops/createenv-dependencies-and-cli-versions-gcp.json opsassets/assets/
go generate ./...
go test ./...
Alternatively, you can run both the tests and linting script with Docker using the same container image that we use in our CI pipeline by running ./run_tests_local.sh
This should be done before committing or raising a PR.
The pipeline listens for new patch or minor versions of manifest.yml
and ops/versions.json
coming from the control-tower-ops
repo. In order to pick up a new major version first make sure it exists in the repo then modify tag_filter: X.*.*
in the control-tower-ops
resource where X
is the major version you want to pin to.