-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.travis.yml
60 lines (52 loc) · 1.9 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
sudo: required
env:
global:
- CHKIT_VERSION=v3.5.1
- IMAGE_NAME=containerum/docs
- CONTAINERUM_API="https://panel.api.containerum.io"
- NAMESPACE=containerum-docs
services:
- docker
install:
- wget https://github.com/containerum/chkit/releases/download/${CHKIT_VERSION}/chkit_linux_amd64_${CHKIT_VERSION}.tar.gz
- tar -zxf chkit_linux_amd64_${CHKIT_VERSION}.tar.gz && sudo mv chkit /bin/chkit
script:
- chkit set api ${CONTAINERUM_API}
- chkit login -u ${CONTAINERUM_LOGIN} -p ${CONTAINERUM_PASSWORD} -n -
- docker build -t "$IMAGE_NAME" --build-arg DOCS_COMMIT="${TRAVIS_COMMIT::8}" .
- echo "Commit ${TRAVIS_COMMIT::8}"
before_deploy:
- docker login -u="$DOCKER_LOGIN" -p="$DOCKER_PASSWORD"
- docker tag "$IMAGE_NAME" "${IMAGE_NAME}:latest"
- docker tag "$IMAGE_NAME" "${IMAGE_NAME}:release"
- docker tag "$IMAGE_NAME" "${IMAGE_NAME}:dev"
- docker tag "$IMAGE_NAME" "${IMAGE_NAME}:${TRAVIS_COMMIT::8}"
- if [ "$TRAVIS_TAG" ]; then docker tag "$IMAGE_NAME" "${IMAGE_NAME}:${TRAVIS_TAG}"; fi
deploy:
- provider: script
script:
- docker push "${IMAGE_NAME}:latest"
- docker push "${IMAGE_NAME}:${TRAVIS_TAG}"
skip_cleanup: true
on:
tags: true
- provider: script
script: docker push "${IMAGE_NAME}:dev" && docker push "${IMAGE_NAME}:${TRAVIS_COMMIT::8}"
skip_cleanup: true
on:
branch: develop
- provider: script
script: chkit set image --deployment docs-dev --image "${IMAGE_NAME}:${TRAVIS_COMMIT::8}" --force -n ${NAMESPACE}
skip_cleanup: true
on:
branch: develop
- provider: script
script: docker push "${IMAGE_NAME}:release" && docker push "${IMAGE_NAME}:${TRAVIS_COMMIT::8}"
skip_cleanup: true
on:
branch: master
- provider: script
script: chkit set image --deployment docs-production --image "${IMAGE_NAME}:${TRAVIS_COMMIT::8}" --force -n ${NAMESPACE}
skip_cleanup: true
on:
branch: master