-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
43 lines (40 loc) · 1.49 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
stages:
- deploy_staging
- deploy_master
cache:
untracked: true
key: "$CI_PROJECT_ID"
deploy_staging:
stage: deploy_staging
image: python:3.5
script:
- export AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID
- export AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY
- export S3_BUCKET_NAME=$S3_BUCKET_NAME_STAGING
- export DISTRIBUTION_ID=$DISTRIBUTION_ID
- pip install awscli --upgrade --user
- export PATH=~/.local/bin:$PATH
- aws s3 sync . $S3_BUCKET_NAME_STAGING --acl public-read --delete --exclude ".git/*" --exclude ".gitlab-ci.yml" --exclude "README.md"
#- aws cloudfront create-invalidation --distribution-id $DISTRIBUTION_ID --paths '/*'
- echo "DEPLOYED SUCCESSFULLY TO STAGING - signup-staging.hive.io"
environment:
name: development
only:
- develop
deploy_master:
stage: deploy_master
image: python:3.5
script:
- export AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID
- export AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY
- export S3_BUCKET_NAME=$S3_BUCKET_NAME_PRODUCTION
- export DISTRIBUTION_ID=$DISTRIBUTION_ID
- pip install awscli --upgrade --user
- export PATH=~/.local/bin:$PATH
- aws s3 sync . $S3_BUCKET_NAME_PRODUCTION --acl public-read --delete --exclude ".git/*" --exclude ".gitlab-ci.yml" --exclude "README.md"
- aws cloudfront create-invalidation --distribution-id $DISTRIBUTION_ID --paths '/*'
- echo "DEPLOYED SUCCESSFULLY TO PRODUCTION - signup.hive.io"
environment:
name: production
only:
- master