Last active
February 23, 2025 06:49
-
-
Save Mazuh/4b7a275ded38e2e031a5d40e28d1984d to your computer and use it in GitHub Desktop.
Revisions
-
Mazuh revised this gist
Nov 19, 2018 . 3 changed files with 13 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -37,7 +37,7 @@ deployingDev: - aws configure set aws_secret_access_key "$DEV_AWS_SECRET" - ((aws s3api create-bucket --acl public-read --bucket my-app-dev && echo 'Created bucket.') || echo 'Already existing bucket.') - aws s3api put-bucket-website --bucket my-app-dev --website-configuration file://website.json - aws s3api put-bucket-policy --bucket my-app-dev --policy file://policy-dev.json - aws s3 sync ./build/ s3://my-app-dev deployingProd: @@ -54,5 +54,5 @@ deployingProd: - aws configure set aws_secret_access_key "$PROD_AWS_SECRET" - ((aws s3api create-bucket --acl public-read --bucket my-app-prod && echo 'Created bucket.') || echo 'Already existing bucket.') - aws s3api put-bucket-website --bucket my-app-prod --website-configuration file://website.json - aws s3api put-bucket-policy --bucket my-app-prod --policy file://policy-prod.json - aws s3 sync ./build/ s3://my-app-prod This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,9 +4,6 @@ "Effect": "Allow", "Principal": "*", "Action": ["s3:GetObject"], "Resource": ["arn:aws:s3:::my-app-dev/*"] } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ { "Statement": { "Sid": "PublicReadGetObject", "Effect": "Allow", "Principal": "*", "Action": ["s3:GetObject"], "Resource": ["arn:aws:s3:::my-app-prod/*"] } } -
Mazuh created this gist
Nov 18, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,58 @@ image: nikolaik/python-nodejs:latest stages: - install - test - deploy prodInstall: stage: install script: - npm install --production artifacts: untracked: true unitTesting: stage: test dependencies: - prodInstall script: - npm install - npm run build - npm test artifacts: untracked: true deployingDev: stage: deploy only: - dev dependencies: - prodInstall - unitTesting script: - pip3 install awscli - aws configure set profile bucket-dev - aws configure set aws_access_key_id "$DEV_AWS_KEY" - aws configure set aws_secret_access_key "$DEV_AWS_SECRET" - ((aws s3api create-bucket --acl public-read --bucket my-app-dev && echo 'Created bucket.') || echo 'Already existing bucket.') - aws s3api put-bucket-website --bucket my-app-dev --website-configuration file://website.json - aws s3api put-bucket-policy --bucket my-app-dev --policy file://policy.json - aws s3 sync ./build/ s3://my-app-dev deployingProd: stage: deploy only: - master dependencies: - prodInstall - unitTesting script: - pip3 install awscli - aws configure set profile bucket-prod - aws configure set aws_access_key_id "$PROD_AWS_KEY" - aws configure set aws_secret_access_key "$PROD_AWS_SECRET" - ((aws s3api create-bucket --acl public-read --bucket my-app-prod && echo 'Created bucket.') || echo 'Already existing bucket.') - aws s3api put-bucket-website --bucket my-app-prod --website-configuration file://website.json - aws s3api put-bucket-policy --bucket my-app-prod --policy file://policy.json - aws s3 sync ./build/ s3://my-app-prod This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ { "Statement": { "Sid": "PublicReadGetObject", "Effect": "Allow", "Principal": "*", "Action": ["s3:GetObject"], "Resource": [ "arn:aws:s3:::my-app-dev/*", "arn:aws:s3:::my-app-prod/*" ] } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ { "IndexDocument": { "Suffix": "index.html" } }