I am not able to set a name for commands , i though it would take the description , but it just takes the code of the commands
version: 2.1
commands:
bake_ami:
description: "Packer build AWS AMI << parameters.env >>"
parameters:
env:
type: string
folder:
type: string
steps:
- run: |
export FOLDER=<< parameters.folder >>
export ENV=<< parameters.env >>
last_backed_version=$(vault read twingate/projects/images/latest_ami/$ENV | jq ".data.version" --raw-output)
current_version=$(./scripts/get_latest_node_version.sh)
if [[ $last_backed_version != $current_version ]]; then
make build-aws-ami
vault write twingate/projects/images/latest_ami/$ENV version=$current_version
else
echo "No need to bake AMI , current version $current_version already backed"
fi;
executors:
devops-executor:
docker:
- image: gcr.io/twingate-prod/devops-toolbox:latest
auth:
username: _json_key
password: $GCLOUD_SERVICE_KEY
environment:
GOOGLE_PROJECT_ID: twingate-prod
PROJECT_ROOT: /root/project/
jobs:
get_vault_token:
working_directory: ~/repo
docker:
- image: circleci/python:3.8
steps:
- checkout
- run:
name: Get Vault Token
command: ./ops/get-vault-token.sh
- persist_to_workspace:
root: /tmp
paths:
- "VAULT_TOKEN"
packer_build_aws:
executor: devops-executor
steps:
- checkout
- attach_workspace:
at: ./workspace
- run:
name: Provision Env
command: |
...
- run:
name: Authenticate GCP
command: |
./ops/auth-gcp.sh
- bake_ami:
env: dev
folder: dev
- bake_ami:
env: prod
folder: master