This repository was archived by the owner on May 14, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +25
-11
lines changed
Expand file tree Collapse file tree 4 files changed +25
-11
lines changed Original file line number Diff line number Diff line change @@ -26,26 +26,30 @@ script:
2626
2727after_success:
2828 - docker-compose push
29- # TODO: IF and migrate
30- - docker pull $ZAPPA_IMG || true
31- - docker build -t $ZAPPA_IMG --cache-from $ZAPPA_IMG -f ./server/zappa.dockerfile ./server/
3229 - |
33- docker run --rm \
34- -e AWS_ACCESS_KEY_ID=$ZAPPA_AWS_ACCESS_KEY_ID \
35- -e AWS_SECRET_ACCESS_KEY=$ZAPPA_AWS_SECRET_ACCESS_KEY \
36- -e AWS_DEFAULT_REGION=$ZAPPA_AWS_DEFAULT_REGION \
37- $ZAPPA_IMG \
38- bash -c 'source /venv/bin/activate && zappa update prod'
30+ if [[ " $TRAVIS_BRANCH" = "release" ]] ; then
31+ docker pull $ZAPPA_IMG || true
32+ docker build -t $ZAPPA_IMG --cache-from $ZAPPA_IMG -f ./server/zappa.dockerfile ./server/
33+ docker run --rm \
34+ -e AWS_ACCESS_KEY_ID=$ZAPPA_AWS_ACCESS_KEY_ID \
35+ -e AWS_SECRET_ACCESS_KEY=$ZAPPA_AWS_SECRET_ACCESS_KEY \
36+ -e AWS_DEFAULT_REGION=$ZAPPA_AWS_DEFAULT_REGION \
37+ -v `pwd`/server/=/code/ \
38+ $ZAPPA_IMG \
39+ bash -c 'source /venv/bin/activate && cd /code/ && zappa update prod && zappa manage prod migrate'
40+ docker push $ZAPPA_IMG
41+ fi
3942
4043deploy :
4144 provider : s3
42- access_key_id: $S3_AWS_ACCESS_KEY_ID
43- secret_access_key: $S3_AWS_SECRET_ACCESS_KEY
45+ access_key_id : $ZAPPA_AWS_ACCESS_KEY_ID
46+ secret_access_key : $ZAPPA_AWS_SECRET_ACCESS_KEY
4447 bucket : $TOGGLECORP_S3_BUCKET
4548 skip_cleanup : true
4649 local_dir : ./client/build
4750 acl : public_read
4851 region : $DEPLOYMENT_REGION
52+ edge : true # opt in to dpl v2
4953 on :
5054 branch : release
5155
Original file line number Diff line number Diff line change @@ -7,7 +7,15 @@ class StaticStorage(S3Boto3Storage):
77 bucket_name = settings .AWS_STORAGE_BUCKET_NAME_STATIC
88 querystring_auth = False
99
10+ # Don't use token provided by AWS environment (use custom defiend tokens)
11+ def _get_security_token (self ):
12+ return None
13+
1014
1115class MediaStorage (S3Boto3Storage ):
1216 location = settings .MEDIAFILES_LOCATION
1317 bucket_name = settings .AWS_STORAGE_BUCKET_NAME_MEDIA
18+
19+ # Don't use token provided by AWS environment (use custom defiend tokens)
20+ def _get_security_token (self ):
21+ return None
Original file line number Diff line number Diff line change 169169 AWS_SECRET_ACCESS_KEY = os .environ ['S3_AWS_SECRET_ACCESS_KEY' ]
170170 AWS_S3_REGION_NAME = os .environ ['S3_AWS_REGION_NAME' ]
171171
172+ AWS_S3_ADDRESSING_STYLE = 'path'
172173 AWS_S3_FILE_OVERWRITE = False
173174 AWS_DEFAULT_ACL = 'private'
174175 AWS_QUERYSTRING_AUTH = False
Original file line number Diff line number Diff line change 77 "s3_bucket" : " zappa-togglecorp" ,
88 "certificate_arn" : " arn:aws:acm:us-east-1:182509255933:certificate/64de3375-63d6-4118-89e0-f1b08fab91b8" ,
99 "domain" : " api.togglecorp.com" ,
10+ "keep_warm" : false ,
1011 "vpc_config" : {
1112 "SubnetIds" : [" subnet-930078d9" , " subnet-5f9b3038" ],
1213 "SecurityGroupIds" : [ " sg-00085d77439843e85" ]
You can’t perform that action at this time.
0 commit comments