version: 0.2 phases: install: runtime-versions: nodejs: 12 python: 3.8 pre_build: commands: - apt-get update -y - apt-get install -y jq - /usr/bin/env python3.8 -m pip install --upgrade pip - make requirements npm-install build: commands: - COMMIT_ID=$(aws ssm get-parameter --name $COMMIT_PARAMETER | jq -r '.Parameter.Value') - "echo COMMIT_ID: $COMMIT_ID" - "echo SERVICES: $(tools/services --env-only --changed-since $COMMIT_ID)" # Tests for all services must work before moving to the next step - | for SERVICE in $(tools/services --env-only --changed-since $COMMIT_ID); do make ci-$SERVICE package-$SERVICE artifacts-$SERVICE || exit 1 done # Upload template artifacts to 'templates/$SERVICE.yaml' # This will trigger the pipelines per service - | for SERVICE in $(tools/services --env-only --changed-since $COMMIT_ID); do aws s3 cp $SERVICE/build/artifacts.zip s3://$S3_BUCKET/templates/$SERVICE.zip || exit 1 done # Update the parameter - aws ssm put-parameter --name $COMMIT_PARAMETER --type String --value $CODEBUILD_RESOLVED_SOURCE_VERSION --overwrite reports: build: files: - '**/*' base-directory: 'reports'