This repository has been archived by the owner on Nov 10, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
39 lines (39 loc) · 1.52 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
# https://docs.travis-ci.com/user/job-lifecycle
# https://docs.travis-ci.com/user/languages/javascript-with-nodejs
language: node_js
node_js:
- "12"
env:
- FOLDER=frontend
- FOLDER=backend
services:
- docker
branches:
only:
- /.*/ # run all branches
script: cd $FOLDER && npm ci; npm run test
after_script: npm run coverage
deploy:
provider: script
on:
# all_branches: true
branch: master
script: echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin;
docker build -t bierteam/hk-pwa-$FOLDER:$TRAVIS_BRANCH .;
docker push bierteam/hk-pwa-$FOLDER:$TRAVIS_BRANCH
jobs:
include:
- stage: deploy
env: FOLDER=kubernetes
script: echo "skipping test"
before_deploy:
- openssl aes-256-cbc -K $encrypted_4ff961649dbb_key -iv $encrypted_4ff961649dbb_iv -in $FOLDER/kubeconfig.enc -out /tmp/kubeconfig -d
- openssl aes-256-cbc -K $encrypted_60fb3a50c9fd_key -iv $encrypted_60fb3a50c9fd_iv -in $FOLDER/secrets.yaml.enc -out $FOLDER/secrets.yaml -d
deploy:
provider: script
skip_cleanup: true
script: echo $PWD; docker run --rm -v /tmp/kubeconfig:/.kube/config -v $PWD/$FOLDER:/files bitnami/kubectl:latest apply -f /files &&
docker run --rm -v /tmp/kubeconfig:/.kube/config -v $PWD/$FOLDER:/files bitnami/kubectl:latest rollout restart -f /files;
echo "Hope that worked" #TODO only restart kubernetes stuff that supports restarting to prevent errors and the deployment failing
on:
branch: master