Skip to content

Latest commit

 

History

History
48 lines (29 loc) · 1.93 KB

development.md

File metadata and controls

48 lines (29 loc) · 1.93 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.

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.