stable-diffusion-aws-extension/buildspec.yml

63 lines
2.0 KiB
YAML

version: 0.2
env:
shell: bash
exported-variables:
- BSS_IMAGE_ASSET_REPOSITORY_NAME
- BUILD_VERSION
- CN_ASSETS
- GLOBAL_ASSETS
- ECR_REPOS
- CN_ECR_REPOS
phases:
install:
runtime-versions:
nodejs: 14
commands:
- echo "nothing to do in install"
pre_build:
commands:
- echo "Installing dependencies and executing unit tests - `pwd`"
- echo Update npm to latest
- npm install -g npm@latest
- cd infrastructure
- chmod +x ./run-all-tests.sh && ./run-all-tests.sh
- echo "Installing dependencies and executing unit tests completed `date`"
- export BSS_IMAGE_ASSET_REPOSITORY_NAME='stable-diffusion-aws-extension'
- export BUILD_VERSION=0.10.0-${CODEBUILD_RESOLVED_SOURCE_VERSION:0:7}
- export CN_ASSETS='cn/'
- |-
set -euxo pipefail
__dir="${CODEBUILD_SRC_DIR}/deployment"
function join_by { local IFS="$1"; shift; echo "$*"; }
export CN_ECR_REPOS=$(join_by , `cat "${__dir}/cn-ecr-repos"`)
- export GLOBAL_ASSETS='custom-domain/,default/'
build:
commands:
- echo "Starting build `date` in `pwd`"
- cd ../deployment
- chmod +x ./build-s3-dist.sh && ./build-s3-dist.sh $DIST_OUTPUT_BUCKET $SOLUTION_NAME $BUILD_VERSION
- echo "Build completed `date`"
- echo "Starting open-source-dist `date` in `pwd`"
- chmod +x ./build-open-source-dist.sh && ./build-open-source-dist.sh $SOLUTION_NAME
- echo "Open Source Dist completed `date`"
post_build:
commands:
- echo "Retrieving next stage buildspec `date` in `pwd`"
- aws s3 cp s3://${SOLUTIONS_BUILD_ASSETS_BUCKET:-aws-solutions-build-assets}/changelog-spec.yml ../buildspec.yml
- echo "Retrieving next stage buildspec complete"
- echo "Post build completed on `date`"
artifacts:
files:
- deployment/**/*
- infrastructure/**/*
- middleware_api/**/*
- .gitignore
- sonar-project.properties
- buildspec.yml
- CHANGELOG.md
- .cfnnag_*