-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildspec.yml
19 lines (19 loc) · 1.71 KB
/
buildspec.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
version: 0.2
phases:
install:
commands:
- echo "Python has some SSL issues in this version so we force an upgrade which doesn't fix everything; don't be alarmed by the warnings."
- sudo -i pip install --upgrade requests
build:
commands:
- echo "S3 Upload Beginning"
- python -V
- export ACCID=$(aws sts get-caller-identity --query 'Account' | tr -d '"')
- aws s3 sync . s3://servicecatalog-deployedtemplates-$ACCID/ --delete --exclude "*" --include "*.json" --include "*.yml"
- echo "S3 Upload Complete, updating cloudformation now..."
- /bin/bash codepipeline/run-pipelineupdate.sh
- aws cloudformation update-stack-set --stack-set-name SC-IAC-automated-IAMroles --parameters "[{\"ParameterKey\":\"RepoRootURL\",\"ParameterValue\":\"https://servicecatalog-deployedtemplates-$ACCID.s3.amazonaws.com/\"}]" --template-url "https://servicecatalog-deployedtemplates-$ACCID.s3.amazonaws.com/iam/sc-demosetup-iam.json" --capabilities CAPABILITY_IAM CAPABILITY_NAMED_IAM CAPABILITY_AUTO_EXPAND
- aws cloudformation update-stack-set --stack-set-name SC-IAC-automated-portfolio --parameters "[{\"ParameterKey\":\"LinkedRole2\",\"UsePreviousValue\":true},{\"ParameterKey\":\"LinkedRole1\",\"UsePreviousValue\":true},{\"ParameterKey\":\"LaunchRoleName\",\"UsePreviousValue\":true},{\"ParameterKey\":\"RepoRootURL\",\"ParameterValue\":\"https://servicecatalog-deployedtemplates-$ACCID.s3.amazonaws.com/\"}]" --template-url "https://servicecatalog-deployedtemplates-$ACCID.s3.amazonaws.com/ec2/sc-portfolio-ec2VPC.json"
post_build:
commands:
- echo "Deploy complete"