-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path.travis.yml
79 lines (76 loc) · 2.85 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
notifications:
email: false
git:
quiet: true
depth: false
language: node
node_js: lts/*
python: 3.8
service: docker
os: linux
arch: amd64
addons:
apt:
update: true
packages:
- curl
- sudo
- lsof
- httpie
- docker-ce
install: true
before_install:
- export DISPLAY=:99.0
- |
if [ ! -f ${HOME}/.local/daggerok/bash-functions/master/main.bash ] ; then
mkdir -p ${HOME}/.local/daggerok/bash-functions/master ;
curl -s https://raw.githubusercontent.com/daggerok/bash-functions/master/main.bash > ${HOME}/.local/daggerok/bash-functions/master/main.bash ;
fi
source ${HOME}/.local/daggerok/bash-functions/master/main.bash ;
- stop_any 80 3000 5000 8080 5432
cache:
directories:
- ~/.n*
- ./node_modules
- ~/.local/daggerok
jobs:
include:
- stage: test
name: test
before_script: cd $TRAVIS_BUILD_DIR && npm i
script: cd $TRAVIS_BUILD_DIR && npm t
- stage: test
name: build and run
before_script:
- cd $TRAVIS_BUILD_DIR && npm i
- cd $TRAVIS_BUILD_DIR && npm run generate
- docker run -d --rm --name app -p 80:80 -v $TRAVIS_BUILD_DIR/dist:/usr/share/nginx/html:ro
--health-cmd="wget -q --spider http://127.0.0.1:80/ || exit 1"
--health-start-period=1s
--health-interval=1s
--health-retries=33
--health-timeout=1s
nginx:1.17.6-alpine
- wait_healthy_docker_containers 1
script: http :/
after_script: docker rm -f -v app
- stage: deploy
name: build and deploy
script: skip
jdk: openjdk8
before_deploy:
- cd $TRAVIS_BUILD_DIR && npm i
- cd $TRAVIS_BUILD_DIR && npm run predeploy
env:
- secure: "hE413vOxGUojoT8WmbNtqiD/DVgBemMj4t05FcJ6qjcWHd9h3ATuGJrD3TocGzzytwFOV83vn4qp9utPGszDkiBqHN219qSabkBgKBuxWsSfEfWsc8EgSW4U87VccA9HD1+q6VWrgi8Q5gsgMZ1s2blP74uTmsbI+liUwARNlrHFOo5kty7xj4wEzB+RiaBtdvNE1FyYngVPK49bY0J4yjN79ZB1AaRk0jtGU5Ywy9xaoWCKs8EuMFY2hLoeB6CU3quAl33I36bOcK/0oxkPYj8DOwOt9veUOlOmr+wC76ABKT6k8j9iTM/SuAm7vQl3vogchHa1ioqHCJb7y+eFQsFUHMproPs8NhtC8RUg3z33aWgtKOG5+ZZOA52jyKCQ/FF4+qWU31EupYxssBRLGe2Lz6nLzF77s6f8l/WRo1ChRVKMlHMEK5OuZJtQ6DeZMralamnq/fMlXo9kvS3Jzcwgjs6lcXYkaeIF63+ctVb9sSloZhelLXrJFFeEZQZDQSf6mtO4epk7Vu/gh6OYRI9DiURllHxyzo/u/X3IgWfaRT78ClAIqasEeBzqRU0ezh5Fu5inLL6DGJnG9vNJ1gk2jG2BRdxIZA5Q4ZnkQ0OlLg9HH3vEilc8TR7ieEKajejYCg075aSCKAAyBU4sQgJECuy47bwtu8YBlwnExZQ="
deploy: &pages
provider: pages
skip-cleanup: true
keep-history: true
target_branch: gh-pages
# travis encrypt GITHUB_TOKEN=<your github repo token> --add
github-token: "$GITHUB_TOKEN"
local-dir: $TRAVIS_BUILD_DIR/dist
on:
all_branches: true
condition: $TRAVIS_BRANCH =~ ^(master|ci)$