Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- variables:
- S3_BUCKET_PRODUCTION: 'dashboard.kotakmakan.id'
- S3_BUCKET_STAGING: 'staging.dashboard.kotakmakan.id'
- S3_BUCKET_DEVELOPMENT: 'dev.dashboard.kotakmakan.id'
- # CLOUDFRONT_DISTRIBUTION_ID: [FILL THIS YOURSELF]
- deploy master:
- stage: build
- image: nikolaik/python-nodejs:python3.7-nodejs10
- script:
- - npm install
- - npm run build
- - pip install awscli
- - aws s3 sync dist/ s3://c --recursive --include "*"
- # - aws cloudfront create-invalidation --distribution-id $CLOUDFRONT_DISTRIBUTION_ID --paths "/*"
- - echo "Deploy to http://dashboard.kotakmakan.id.s3-website-ap-southeast-1.amazonaws.com"
- artifacts:
- paths:
- - dist/
- environment:
- name: production
- url: http://dashboard.kotakmakan.id.s3-website-ap-southeast-1.amazonaws.com
- only:
- - master
- deploy staging:
- stage: build
- image: nikolaik/python-nodejs:python3.7-nodejs10
- script:
- - npm install
- - npm run build
- - pip install awscli
- - aws s3 sync dist/ s3://staging.dashboard.kotakmakan.id --recursive --include "*"
- - aws cloudfront create-invalidation --distribution-id $CLOUDFRONT_DISTRIBUTION_ID --paths "/*"
- - echo "Deploy to http://staging.dashboard.kotakmakan.id.s3-website-ap-southeast-1.amazonaws.com"
- artifacts:
- paths:
- - dist/
- environment:
- name: staging
- url: http://staging.dashboard.kotakmakan.id.s3-website-ap-southeast-1.amazonaws.com
- only:
- - staging
- deploy development:
- stage: deploy
- image: nikolaik/python-nodejs:python3.7-nodejs10
- script:
- - npm install --progress=false
- - npm run build
- - pip install awscli
- - aws s3 sync --delete --exclude ".git/*" --exclude ".gitignore" --exclude ".gitlab-ci.yml" --exclude ".env*" dist/ s3://dev.dashboard.kotakmakan.id --acl public-read
- - echo "Deploy to http://dev.dashboard.kotakmakan.id.s3-website-ap-southeast-1.amazonaws.com"
- artifacts:
- paths:
- - dist/
- environment:
- name: dev
- url: http://dev.dashboard.kotakmakan.id.s3-website-ap-southeast-1.amazonaws.com
- only:
- - development
Advertisement
Add Comment
Please, Sign In to add comment