CI Pipeline (deployed with Control Tower!)
To build and test you'll need:
- Golang 1.16+
control-tower-opscloned at the same level as this repository (i.e. a sibling directory). Check the latest release ofcontrol-towerfor the appropriate tag ofcontrol-tower-ops.- Control-tower-ops points to a download of 'bosh-cli' that no longer exists. You need to manually edit the "bosh-cli" values in
createenv-dependencies-and-cli-versions-aws.json/createenv-dependencies-and-cli-versions-gcp.jsonto a valid download path before compiling the control-tower binary. E.g.https://github.com/cloudfoundry/bosh-cli/releases/download/v7.2.0/bosh-cli-7.2.0-linux-amd64
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.shTo 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.