goci
is a small command line application which performs building, publishing, and deploying applications. It is the next evolution of many of the scripts in this repository, and offers more automation, configurability and optimization.
goci accepts very limited arguments which merely change the mode it runs in. The rest of the configuration is entirely through environment variables and launch config settings. See theenvironment package for detailed documentation of environment variables for configuration. goci reads it's configuration from the build
section of the launch config of each application. See the build section of the launch yaml to learn about the various parameters which configure goci.
goci detect
detects any changed applications according to their launch configuration. This can be used to pass a name of apps to another script.goci artifact-build-publish-deploy
builds, publishes and deploys any application artifacts.
goci will automatically detect all launch configs in the launch
directory, then perform the following actions as needed.
- detect the run type of the application
- Run any configured build commands
- build any docker images
- publish all built docker images to all ECR regions
- publish all lambdas to s3 in all regions.
- Sync all changed apps with catalog config
- Publish new application versions to catapult
- Deploy any changed applications.
Since goci is just a go app, it can be run locally after building the binary. goci expects to be run from within the root of an applications repo.
There is a test app in this repository which you can use to run goci on locally and test various build configurations. Additionally, you can leverage the built in integrations tests in https://github.com/Clever/circleci-orbs/tree/master, which call goci to test new builds of goci in CI.
Running goci locally is not easy because it leverages a lot of variables set in our CI environments. Generally it would be easier to use the private orbs repo, or make a branch on another app like catapult and pull in the development branch of goci there for testing in CI. If you need to run locally, you can view each of the variables required for local runs in the environment file and provide them all to the command.
go build -o ./bin/goci ./cmd/goci
cp ./bin/goci ./testApp
cd testApp && goci