Skip to content

Commit

Permalink
Merge pull request #11 from aws-samples/upgrade
Browse files Browse the repository at this point in the history
Upgrade role and publishing settings
  • Loading branch information
matteofigus authored Mar 24, 2020
2 parents 910bbba + fb178df commit cccd700
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ script:

before_deploy:
# - npm run pre-deploy-test
- mkdir -p ~/.aws
- cat >> ~/.aws/config <<<"[profile publisher]"$'\n'"credential_source=Environment"$'\n'"role_arn=${ROLE_ARN}"$'\n'"duration_seconds=900"
- export VERSION=${TRAVIS_TAG:-$(npm run echo-version --silent)}
- if [ -z "$TRAVIS_TAG" ]; then npm run tag; fi
- npm run zip
Expand All @@ -33,7 +35,7 @@ deploy:
condition: type != pull_request
- provider: script
skip_cleanup: true
script: npm run deploy
script: npm run deploy >/dev/null 2>&1
on:
tags: true

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"cfn-ensure-dist": "if [ ! -d './templates' ]; then mkdir templates; fi",
"cfn-lambdas-dist": "if [ ! -d './backend/functions/setup/' ]; then mkdir -p backend/functions/setup/; fi",
"cfn-test-local": "npm run cfn-build && rain deploy templates/template.yaml reko-cl -r us-east-1",
"deploy": "npm run zip && aws s3 cp ./`npm run echo-version --silent`.zip s3://$CFN_BUCKET/$npm_package_name/`npm run echo-version --silent`/$npm_package_name.zip",
"deploy": "npm run zip && aws --profile publisher s3 cp ./`npm run echo-version --silent`.zip s3://$CFN_BUCKET/$npm_package_name/`npm run echo-version --silent`/$npm_package_name.zip",
"dev": "cd src/web-ui && npm run dev",
"echo-version": "echo v`node -e \"console.log(require('node-yaml').readSync('templates/template.yaml').Globals.Function.Environment.Variables.VERSION)\"`",
"pre-deploy-test": "taskcat -c ci/taskcat.yml --verbose --exclude docs --exclude src --exclude taskcat_outputs",
Expand Down
9 changes: 7 additions & 2 deletions src/cfn/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Globals:
CREATE_CLOUDFRONT_DISTRIBUTION: !Ref CreateCloudFrontDistribution
REGION: !Ref AWS::Region
TO_BUCKET: !Ref WebUIBucket
VERSION: "0.18"
VERSION: "0.19"

Parameters:
AdminEmail:
Expand Down Expand Up @@ -151,7 +151,12 @@ Resources:
Action:
- sts:AssumeRole
- sts:AssumeRoleWithWebIdentity

Condition:
StringEquals:
"cognito-identity.amazonaws.com:aud": !Ref CognitoIdentityPool
ForAnyValue:StringLike:
"cognito-identity.amazonaws.com:amr": "unauthenticated"

CustomResourceRole:
Type: AWS::IAM::Role
Properties:
Expand Down

0 comments on commit cccd700

Please sign in to comment.