-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
39 lines (37 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
sudo: required
services:
- docker
env:
global:
# env variable to create unique deployment images
- SHA=$(git rev-parse HEAD)
# env variable to omit prompts in the cli
- CLOUDSDK_CORE_DISABLE_PROMPTS=1
before_install:
# Unencrypt service-account.enc.json
- openssl aes-256-cbc -K $encrypted_0c35eebf403c_key -iv $encrypted_0c35eebf403c_iv -in service-account.json.enc -out service-account.json -d
# Google Cloud SDK installation
- curl https://sdk.cloud.google.com | bash > /dev/null
- source $HOME/google-cloud-sdk/path.bash.inc
# kubectl installation
- gcloud components update kubectl
# Activation of service account with credentials in a json file
- gcloud auth activate-service-account --key-file service-account.json
# Set project
- gcloud config set project fibonacci-k8s
# Set compute zone
- gcloud config set compute/zone us-central1-a
# Specify the cluster to work with
- gcloud container clusters get-credentials fibonacci-cluster
# Docker login
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
# Build the test version of multi-client
- docker build -t 0xelj/react-test -f ./client/Dockerfile.dev ./client
script:
# Run tests
- docker run 0xelj/react-test npm run test -- --coverage
deploy:
provider: script
script: bash ./deploy.sh
on:
branch: master