This repository has been archived by the owner on May 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
46 lines (38 loc) · 1.34 KB
/
.travis.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
44
45
46
sudo: required
language: generic
services:
- docker
before_install:
- echo "$GP_PASSWORD" | docker login docker.pkg.github.com -u "$GP_USERNAME" --password-stdin
- if [[ "$TC_BRANCH_NAME" = "develop" ]] ; then export TC_BRANCH_NAME=; fi
- touch .env
- docker-compose pull || TC_BRANCH_NAME= docker-compose pull || true
before_script:
- mkdir -p $(dirname "$REACT_STORE_DIR")
- git clone --branch=togglecorp https://github.com/toggle-corp/react-store ${REACT_STORE_DIR}
- cp ${REACT_STORE_DIR}/stylesheets/_user-imports-sample.scss ${REACT_STORE_DIR}/stylesheets/_user-imports.scss
- git --git-dir=$REACT_STORE_DIR/.git --no-pager show --pretty=fuller --quiet
- docker-compose build
script:
- docker-compose run --rm server bash /code/scripts/run_tests.sh
- echo "
REACT_APP_API_END=${REACT_APP_API_END}
" > .env
- docker-compose run --rm client bash -c 'yarn install && CI=false yarn build'
after_success:
- docker-compose push
deploy:
provider: s3
access_key_id: $AWS_ACCESS_KEY_ID
secret_access_key: $AWS_SECRET_ACCESS_KEY
bucket: $TOGGLECORP_S3_BUCKET
skip_cleanup: true
local_dir: ./client/build
acl: public_read
region: $DEPLOYMENT_REGION
on:
branch: release
env:
global:
- REACT_STORE_DIR=client/src/vendor/react-store
- TC_BRANCH_NAME=`echo ${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH} | tr / _`