-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
45 lines (37 loc) · 1.62 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
sudo: required
services:
- docker
env:
global:
- SHA=$(git rev-parse HEAD)
# Disable all interactive prompts when running gcloud commands.
# If input is required, defaults will be used, or an error will be raised.
- CLOUDSDK_CORE_DISABLE_PROMPTS=1
before_install:
# Create service account in the GKE dashboard + encrypt it in TravisCLI (Used local Ruby container to run it on windows)
## In public repo used only service-account.json.enc
- openssl aes-256-cbc -K $encrypted_9f3b5599b056_key -iv $encrypted_9f3b5599b056_iv -in service-account.json.enc -out service-account.json -d
# Download and install GCP SDK
- curl https://sdk.cloud.google.com | bash > /dev/null;
# updates PATH for the GCP SDK
- source $HOME/google-cloud-sdk/path.bash.inc
# Install kubectl
- gcloud components update kubectl
# Auth to account using the de-crypted service-account
- gcloud auth activate-service-account --key-file service-account.json
- gcloud config set project fib-docker-kubernetes
- gcloud config set compute/zone europe-west1-b
- gcloud container clusters get-credentials fib-docker-kubernetes
# Use travis env vars on the integrated branch to login, echo the password and pickup via pipe
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
# Use dev build due to all dependencies available
- docker build -t razik/react-test -f ./client/Dockerfile.dev ./client
# Run tests
script:
- docker run -e CI=true razik/react-test npm test
deploy:
provider: script
script: bash ./deploy.sh
# Run deployment script only for master branch
on:
branch: master