-
Notifications
You must be signed in to change notification settings - Fork 5
/
.travis.yml
133 lines (124 loc) · 6.77 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
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
notifications:
email: false
os: linux
dist: xenial
services:
- docker
addons:
apt:
packages:
- docker-ce
- jq
# only push builds on master, deploy, release branches to prevent double build or
# it's not push initiated
# or it is forced by a commit message
# but never build forks (can be dangerous to run foreign code, right?)
if: (branch IN (master, deploy, release) OR type IN (pull_request, api, cron) OR commit_message =~ /#travis/ OR tag IS present) AND fork = false
matrix:
allow_failures:
- python: 3.8-dev
fast_finish: true
include:
- stage: Run tests
language: node_js
name: Compose test environment and run e2e tests
# run cypress tests
node_js: 10
# cypress only for every commit in master
if: (type = commit AND branch = master) OR commit_message =~ /#travis/
cache:
directories:
- "$HOME/.npm" # npm
- "$HOME/.cache" # cypress
script: |
set -e
# start cypress installation
cd src/cypress && CI=true npm ci --only=prod &
travis_pid=$!
# build containers
cd $TRAVIS_BUILD_DIR/src/karmen_frontend
KARMEN_CLOUD_MODE=1 docker-compose up --build -d
# wait for cypress to finish installation
while kill -0 $travis_pid > /dev/null 2>&1; do echo 'Waiting for cypress to finish installation ...'; sleep 1; done
# check that all images were started and are running
[ -z `docker ps -qa -f name=frontend -f status=running` ] && travis_terminate
# wait for docker-compose to listen
while ! curl -I localhost:4000 > /dev/null 2>&1; do echo 'Waiting for server...'; sleep 1; done
npm run test:cypress
docker-compose down || travis_terminate 1;
# Python 3.7 (requires build images)
# nodejs
- language: node_js
name: frontend Jest tests and build
# these are just basic and quick tests and lint, finished in a minute, we can run it every time
#if: branch IN (master, deploy, release) OR type IN (pull_request, api, cron) OR commit_message =~ /#travis/ OR tag IS present
node_js: 10
cache:
directories:
- "$HOME/.npm"
before_script:
- cd src
- npm ci || travis_terminate 1;
script:
- npm run lint || travis_terminate 1;
- npm run test || travis_terminate 1;
# - npm run build
# build and push docker images
- name: "frontend image"
if: tag IS present
language: generic
before_install:
- sudo docker run --privileged linuxkit/binfmt:v0.6
- sudo docker run -d --privileged -p 1234:1234 --name buildkit moby/buildkit:latest
--addr tcp://0.0.0.0:1234 --oci-worker-platform linux/amd64 --oci-worker-platform
linux/armhf
- sudo docker cp buildkit:/usr/bin/buildctl /usr/bin/
- export BUILDKIT_HOST=tcp://0.0.0.0:1234
install: true
script:
- bash .travis/build-images-frontend.sh
# deploy to GitHub releases
#
# versions ending on -something ("-" and some text) are considered prerelease
# while versions without "-" character are considered stable
# PRE-RELEASE
- name: "Pre-release"
stage: Create GitHub release
if: tag IS present
language: generic
install: true
script:
- bash .travis/make-github-release.sh
deploy:
prerelease: true
provider: releases
token:
secure: "GAftyrpujHWUjoI20uBj146ycoMAOg8volZBkaOSCz2f56eezLwZa6ejc3HzasJy9iFLapP06Ool4DnzhgdV0BWu+O5+i+hdlkZ4N068ex2YDIAE3qXW8cJZBrUIjKxg5Fgc0N3wOQ3uUCiCNd2MYYrpSNUH/z1/cY5fvUpX2ExbE7YlC9DD3bNVXB/Q3ewZarQpxf7MErT4zpto/CqMqV2UgXJZAM8Ruv1UFNJoXHxlVwjHeSPXi92Ahcq3ClxIh8E9+MprDYheMtpG1YBKW6Ih924x70opifBB6Ep/Vvc3/tUkFpZwhL316PVRb8O7T5uCVxSvvBXTmlMvLT+6h8tHy1GSQPm9W0oqPdA3jo6hpoS0kiophn8dmqYkrSMZPiOSQYCvXk1QL05hA8DS50k+93CK7u9K1ghCa/ax6EEqLmzY9R05UX4JNIdH8dort4/mB9kSmMEATk+FarqitO+3M/tH7qORPRT7a5qHjtk6HEsAzo4/Tui2CIRuhu/7wnwwOJwIci5ccgw//8j/ZfB+NX03DdR9kKrGkJlEpjRnD67WBBf7m4O67O8y2ZI9JvJkN95jn2i/i0cOAL0c9XmZtZYD/UQJ2pzBKNAxvzDFIIB+xhnk5pjcanOwYBPddm+6oyhEpGjUUjsjap9NxuB6KGfmkIO2k/5eGahtY8Q="
file: ./.travis/release.zip
skip_cleanup: true
on:
repo: fragaria/karmen
tags: true
condition: '"$TRAVIS_TAG" =~ ^v[0-9.]*-.*$'
# STABLE RELEASE
- name: "Stable release"
if: tag IS present
language: generic
install: true
script:
- bash .travis/make-github-release.sh
deploy:
prerelease: false
provider: releases
token:
secure: "GAftyrpujHWUjoI20uBj146ycoMAOg8volZBkaOSCz2f56eezLwZa6ejc3HzasJy9iFLapP06Ool4DnzhgdV0BWu+O5+i+hdlkZ4N068ex2YDIAE3qXW8cJZBrUIjKxg5Fgc0N3wOQ3uUCiCNd2MYYrpSNUH/z1/cY5fvUpX2ExbE7YlC9DD3bNVXB/Q3ewZarQpxf7MErT4zpto/CqMqV2UgXJZAM8Ruv1UFNJoXHxlVwjHeSPXi92Ahcq3ClxIh8E9+MprDYheMtpG1YBKW6Ih924x70opifBB6Ep/Vvc3/tUkFpZwhL316PVRb8O7T5uCVxSvvBXTmlMvLT+6h8tHy1GSQPm9W0oqPdA3jo6hpoS0kiophn8dmqYkrSMZPiOSQYCvXk1QL05hA8DS50k+93CK7u9K1ghCa/ax6EEqLmzY9R05UX4JNIdH8dort4/mB9kSmMEATk+FarqitO+3M/tH7qORPRT7a5qHjtk6HEsAzo4/Tui2CIRuhu/7wnwwOJwIci5ccgw//8j/ZfB+NX03DdR9kKrGkJlEpjRnD67WBBf7m4O67O8y2ZI9JvJkN95jn2i/i0cOAL0c9XmZtZYD/UQJ2pzBKNAxvzDFIIB+xhnk5pjcanOwYBPddm+6oyhEpGjUUjsjap9NxuB6KGfmkIO2k/5eGahtY8Q="
file: ./.travis/release.zip
skip_cleanup: true
on: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