-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgc.travis.yml
46 lines (44 loc) · 1.76 KB
/
gc.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
# Won't work still file is called gc.travis.yml not .travis.yml
sudo: required
services:
- docker
env:
global:
# Store current git sha as env var for building unique images
- SHA=$(get rev-parse HEAD)
# Google Cloud CLI does not show any prompts
- CLOUDSDK_CORE_DISABLE_PROMPTS=1
before_install:
#- openssl ...
# Download and Install Google Cloud SDK
- curl https://sdk.cloud.google.com | bash > /dev/null;
# Execution of file for further config
- source $HOME/google-cloud-sdk/path.bash.inc
# Install and update kubectl on travis environment
- gcloud components update kubectl
# Authorization in Google Cloud via credential file
# service-account.json has to be created separately
- gcloud auth activate-service-account --key-file service-account.json
# Next steps: Install travis ci cli and install service-account.json
# in travis, so it is known in the previous step
# Important!: Add the prompted command after installing the key on travis
# at the beginning of the before_install command and add
# service-account.json.enc to the github repository
# ---------------------------
# Select project to work in by project id
- gcloud config set project <project-id>
# Select data-zone (location in Kubernetes clusters view)
- gcloud config set comput/zone us-central1-a
# Select cluster (name in Kubernetes clusters view)
- gcloud container clusters get-credentials multi-cluster
# Login to Docker CLI
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
# Build docker image
- docker build -t mgaygisiz/reat-test -f ./client/Dockerfile.dev ./client
script:
- docker run -e CI=true USERNAME/docker-react npm run test
deploy:
provider: script
script: bash ./deploy.sh
on:
branch: master