-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
37 lines (33 loc) · 1.23 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
sudo: required
services:
- docker
env:
global:
- GIT_SHA=$(git rev-parse HEAD)
- CLOUDSDK_CORE_DISABLE_PROMPTS=1
before_install:
# Decrypt google service account
- openssl aes-256-cbc -K $encrypted_9f3b5599b056_key -iv $encrypted_9f3b5599b056_iv -in service-account.json.enc -out service-account.json -d
# Download google cloud cli
- curl https://sdk.cloud.google.com | bash > /dev/null;
- source $HOME/google-cloud-sdk/path.bash.inc
# Setup google cloud cli
- gcloud components update kubectl
- gcloud auth activate-service-account --key-file service-account.json
- gcloud config set project udemy-k8s-376301
- gcloud config set compute/region us-central1
- gcloud container clusters get-credentials autopilot-cluster-1
# Login to Docker
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
# Build test images
- docker build -t danielvdm/client-test -f ./client/Dockerfile.dev ./client
- docker build -t danielvdm/api-test -f ./api/Dockerfile.dev ./api
script:
# Run test images
- docker run -e CI=true danielvdm/client-test npm run test
- docker run -e CI=true danielvdm/api-test npm run test
deploy:
provider: script
script: bash ./deploy.sh
on:
branch: master