The integration of Meterian with AWS CodeBuild is very simple and it requires just a couple of steps.
From the CodeBuild Developer tools dashboard create a new project.
Configure the build according according to your needs.
In the Environment section:
- Make sure your builds would get elevated privileges by selecting the checkbox right under "Privileged"
- Click "Additional configuration" at the bottom of the Environment section to be able to set environment variables, then set here the METERIAN_API_TOKEN variable.
Please consider using the "Secrets Manager" rather than the "Plaintext" option
In the Buildspec section you will need specify the buildspec file of your project or directly edit it in the web interface using "Insert build command" > "Switch to editor". Here's a full example using the Dockerized Client:
- docker pull -q meterian/cli
- docker run --rm --volume $(pwd):/workspace
--env METERIAN_API_TOKEN=$METERIAN_API_TOKEN meterian/cli
Now save and run your first build.
If the base image you are using contains the build tools then you can also configure the buildspec to use the Thin Client, which will allow for faster builds. Here's a full example:
- curl -s "https://www.meterian.io/downloads/meterian-cli.jar" -o meterian-cli.jar
- java -jar meterian-cli.jar --report-console