This repository has been archived by the owner on Jul 30, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 36
/
.disabled.travis.yml
91 lines (85 loc) · 2.44 KB
/
.disabled.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
dist: trusty
notifications:
email:
recipients:
on_success: never
on_failure: always
stages:
# - lint
- name: build
if: branch IN (master, dev)
- name: deploy_preprod
if: branch = master AND type IN (push, api)
- name: deploy
if: branch IN (master, dev) AND type IN (push, api)
- name: invalidate cache
if: branch = master AND type IN (push, api)
python:
- "3.8"
language: node_js
node_js:
- "11"
jobs:
include:
# - stage: lint
# name: lint frontend
# language: node_js
# node_js: 12
# before_script: cd frontend
# script:
# - npm install
# - npm run lint || echo "linting currently disabled"
# if: branch =~ /(master|dev)/
# - name: lint server
# language: node_js
# node_js: 12
# before_script: cd server
# script:
# - npm install
# - npm run lint || echo "linting currently disabled"
# if: branch =~ /(master|dev)/
- name: build image for site
stage: build
services:
- docker
before_script:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin $DOCKER_REGISTRY
script:
- docker run -d -p 50051:50051 --name registry $OHIO_REGISTRY_IMAGE
- docker ps
- cd server
- npm install
- npm run build-only
- rm -rd node_modules
- cd ..
- >
export DOCKER_TAG=$(bash -c '
if [[ $TRAVIS_BRANCH == "master" ]]; then
echo v4;
else
echo $TRAVIS_BRANCH;
fi
')
- docker build -t "$DOCKER_REGISTRY/$DOCKER_IMAGE:$DOCKER_TAG" -f travis.Dockerfile .
- >
if [[ -z $TRAVIS_PULL_REQUEST_BRANCH ]] && [[ $TRAVIS_BRANCH == "master" || $TRAVIS_BRANCH == "dev" ]]; then
docker push "$DOCKER_REGISTRY/$DOCKER_IMAGE:$DOCKER_TAG"
else
echo "Image pushed only on push to master or dev branch"
fi
- name: test deployment in PREPROD cluster
stage: deploy_preprod
script: ./deploy.sh preprod
- name: deploy to DEV cluster
stage: deploy
script: ./deploy.sh dev
if: branch = dev
- name: deploy to PROD cluster
stage: deploy
script: ./deploy.sh prod
if: branch = master
- name: invalidate Akamai cache
stage: invalidate cache
script: ./invalidate.sh
if: branch = master