forked from Libki/libki-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
77 lines (61 loc) · 3.13 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
sudo: required
env:
global:
- IMAGE_NAME=libki/libki-server
- IMAGE_NAME_CI=libki/libki-server-ci-artifacts
- DOCKER_USERNAME=kylemhall
# DOCKER_PASSWORD=...
jobs:
include:
- stage: build docker image
services:
- docker
before_script:
- version="$TRAVIS_COMMIT"
- docker pull "$IMAGE_NAME" || true
script:
- docker build --pull -f docker/Dockerfile --cache-from "$IMAGE_NAME" --tag "$IMAGE_NAME_CI" .
after_script:
- docker images
before_deploy:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker tag "$IMAGE_NAME_CI" "${IMAGE_NAME_CI}:${version}"
deploy:
provider: script
script: docker push "${IMAGE_NAME_CI}:${version}"
on:
branch: master
- stage: test docker image
services:
- docker
before_script:
- version="$TRAVIS_COMMIT"
- docker pull "$IMAGE_NAME_CI:${version}" || true
script:
- docker network create libki-net
- docker run --name libki-mariadb --network libki-net -e MYSQL_ROOT_PASSWORD=password -e MYSQL_DATABASE=libki --rm -d mariadb:10.3.5
- sleep 30 # Wait a few seconds for mariadb to come up
- docker ps
- docker run --name libki-test-server --network libki-net -e 'LIBKI_INSTANCE=demo' -e 'LIBKI_DB_DSN=dbi:mysql:libki;host=libki-mariadb;port=3306' -e 'LIBKI_DB_USER=root' -e 'LIBKI_DB_PASSWORD=password' -e 'LIBKI_DB_HOST=libki-mariadb' -e 'LIBKI_DB_PORT=3306' -e 'LIBKI_DB_DATABASE=libki' -d "${IMAGE_NAME_CI}:${version}"
- docker ps
- sleep 30 # Wait a few seconds for libki to come up
- docker ps
- docker logs libki-test-server
- docker exec -t libki-test-server /app/installer/update_db.pl
- docker exec -t libki-test-server prove /app/t/01app.t
- docker exec -t libki-test-server prove /app/t/stdout.t
- docker exec -t -e TEST_POD=1 libki-test-server prove /app/t/02pod.t
- docker exec -t -e TEST_POD=1 libki-test-server prove /app/t/03podcoverage.t
after_script:
- docker images
before_deploy:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker tag "$IMAGE_NAME_CI:${version}" "${IMAGE_NAME}:latest"
deploy:
provider: script
script: docker push "${IMAGE_NAME}"
on:
branch: master
notifications:
slack:
secure: PJU6s8zH1KYSMkrM2/ATcJdbZoF9tg31fqo3KUQ/Poh6VKodL2JYPsWemTOgTITKNqlC2ffoJahbevSHiG7B2IQX4/ykDE2fl+ssWqygSTJh+If8gsYaypQEJ/oXpWS6q1D2hN1lRoJWvKgBIBpE1Tx7pUajasYtwOaSkOvui/Hr5WpMZw78h+apF0/4RmdJZsBHR3Zsm/YeRVyTrqcQjsZFfgfTx6l+F29J6A9Wh6GLFdD/3EQmNWh1+mYrGA6cM465QTsBBvFXK9ax26fwMMeneQEmOT147bcc+Pakm/K6jZcSxIPilbarshMxfjTtHoIknRZRocAVsaB8rPdYHHefbO0qFqBSqP0tGkXD8SAny1qg59p8TLmNi8ILxq0qGNY95Gi7bPdnLMBvl/vL39H5bfPFf39Gle9EN6VR7e2L4QyODj3hxHbVysvgMXNW0ucO301S4dQnNwOPJBiF0+u2HZ5D7pOzt8ZMmZTCkwxLLi+jh37KofGhaTZGaJ0pB7GUANrgg+0TtQDO8y67zSJSNumYCzhmKKlHEISL5UfJG6RuRzf23Kc3TmPE3llyzM796ymu6ZbnPdv3qK4puNObDfvYvIWaZ2wlXq/n8Xi2PvQXjeZDRzcejUXCVaBgs6Vrdsucy5C3zMY2gAJ7kYAPAJnwkMpoy7FxbdoT7U4=