version: 0.2 phases: install: runtime-versions: python: 3.7 commands: - echo Entered the install phase... - echo About to build $MODULE_PATH - export PATH="/usr/local/bin:$PATH" - pip install git+https://github.com/aws-cloudformation/cloudformation-cli.git@master - pip install git+https://github.com/aws-cloudformation/cloudformation-cli-python-plugin.git@master - cd $MODULE_PATH - which python - python --version - ls /usr/local/bin - pip freeze - cfn --version - echo $PATH build: commands: - echo Entered the build phase... - cfn validate - cfn generate - SETUP_STACK_NAME="setup-$(echo $MODULE_PATH | sed s/modules\\///g | sed s/_/-/g)" - if test -e ./test/setup.yml; then aws cloudformation create-stack --stack-name $SETUP_STACK_NAME --template-body file://test/setup.yml; fi - if test -e ./test/setup.yml; then aws cloudformation wait stack-create-complete --stack-name $SETUP_STACK_NAME; fi - cfn submit --set-default - ./setup.sh - INTEG_STACK_NAME="integ-$(echo $MODULE_PATH | sed s/modules\\///g | sed s/_/-/g)" - aws cloudformation create-stack --stack-name $INTEG_STACK_NAME --template-body file://test/integ.yml --capabilities CAPABILITY_AUTO_EXPAND - aws cloudformation wait stack-create-complete --stack-name $INTEG_STACK_NAME finally: - cat rpdk.log - if test -e ./test/setup.yml; then aws cloudformation delete-stack --stack-name $SETUP_STACK_NAME; fi - if test -e ./test/setup.yml; then aws cloudformation wait stack-delete-complete --stack-name $SETUP_STACK_NAME; fi - aws cloudformation delete-stack --stack-name $INTEG_STACK_NAME - aws cloudformation wait stack-delete-complete --stack-name $INTEG_STACK_NAME - ./cleanup.sh