Skip to content

Latest commit

 

History

History
49 lines (30 loc) · 2.32 KB

File metadata and controls

49 lines (30 loc) · 2.32 KB

Development of Control Tower

CI Pipeline (deployed with Control Tower!)

Development

Pre-requisites

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 of control-tower for the appropriate tag of control-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.json to 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

Building locally

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.

Linting

Run our linting script (requires gometalinter to be installed):

./ci/tasks/lint.sh

Unit Tests

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.

Bumping Manifest/Ops File versions

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.