mirror of
https://github.com/status-im/safe-react.git
synced 2025-02-02 12:53:24 +00:00
Add Prepare production deployment to travis
This commit is contained in:
parent
7e4501f380
commit
100cb17cc3
18
.travis.yml
18
.travis.yml
@ -14,8 +14,9 @@ matrix:
|
||||
include:
|
||||
- env:
|
||||
- REACT_APP_NETWORK='mainnet'
|
||||
- DEV_BUCKET_NAME=${DEV_MAINNET_BUCKET_NAME}
|
||||
- STAGING_BUCKET_NAME=${STAGING_MAINNET_BUCKET_NAME}
|
||||
before_install:
|
||||
- if [[ "$TRAVIS_BRANCH" == "development" ]]; then exit 0; fi
|
||||
- env:
|
||||
- REACT_APP_NETWORK='rinkeby'
|
||||
before_install:
|
||||
@ -99,3 +100,18 @@ deploy:
|
||||
upload-dir: current
|
||||
on:
|
||||
branch: master
|
||||
|
||||
# Prepare production deployment
|
||||
- provider: s3
|
||||
bucket: $STAGING_BUCKET_NAME
|
||||
secret_access_key: $AWS_SECRET_ACCESS_KEY
|
||||
access_key_id: $AWS_ACCESS_KEY_ID
|
||||
skip_cleanup: true
|
||||
local_dir: build_webpack
|
||||
upload-dir: releases/$TRAVIS_TAG
|
||||
on:
|
||||
tags: true
|
||||
- provider: script
|
||||
script: bash config/travis/prepare_production_deployment.sh
|
||||
on:
|
||||
tags: true
|
17
config/travis/prepare_production_deployment.sh
Normal file
17
config/travis/prepare_production_deployment.sh
Normal file
@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ev
|
||||
|
||||
# Only:
|
||||
# - Tagged commits
|
||||
# - Security env variables are available.
|
||||
if [ -n "$TRAVIS_TAG" ] && [ -n "$PROD_DEPLOYMENT_HOOK_TOKEN" ] && [ -n "$PROD_DEPLOYMENT_HOOK_URL" ]
|
||||
then
|
||||
curl --silent --output /dev/null --write-out "%{http_code}" -X POST \
|
||||
-F token="$PROD_DEPLOYMENT_HOOK_TOKEN" \
|
||||
-F ref=master \
|
||||
-F "variables[TRIGGER_RELEASE_COMMIT_TAG]=$TRAVIS_TAG" \
|
||||
$PROD_DEPLOYMENT_HOOK_URL
|
||||
else
|
||||
echo "[ERROR] Production deployment could not be prepared"
|
||||
fi
|
Loading…
x
Reference in New Issue
Block a user