-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
33 lines (27 loc) · 1.38 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
language: minimal
env:
global:
- THIS_DOCKER_REPO=superflyxxi
- THIS_DOCKER_LABEL=${TRAVIS_BRANCH}
before_install:
- sudo mkdir -p "/etc/docker/certs.d/${THIS_DOCKER_REGISTRY}"
- openssl s_client -showcerts -connect ${THIS_DOCKER_REGISTRY} < /dev/null 2> /dev/null | openssl x509 -outform PEM | sudo tee "/etc/docker/certs.d/${THIS_DOCKER_REGISTRY}/ca.crt"
- echo ${THIS_DOCKER_REGISTRY_PASSWORD} | docker login --username ${THIS_DOCKER_REGISTRY_USERNAME} --password-stdin ${THIS_DOCKER_REGISTRY}
install:
- if [[ ! ${TRAVIS_BRANCH} =~ (main|v.*) ]]; then
export CACHE_FROM_ARGS="--cache-from ${THIS_DOCKER_REGISTRY}/${THIS_DOCKER_REPO}/httpd-cron:main";
docker pull ${THIS_DOCKER_REGISTRY}/${THIS_DOCKER_REPO}/httpd-cron:main || true;
fi
script:
- cd ${TRAVIS_BUILD_DIR}/src/
- docker build -t httpd-cron:build ${CACHE_FROM_ARGS} .
- cd ${TRAVIS_BUILD_DIR}/tests/
- sudo chown root:root crontab
- bash ./runTests.sh
after_success:
- docker tag httpd-cron:build ${THIS_DOCKER_REGISTRY}/${THIS_DOCKER_REPO}/httpd-cron:${THIS_DOCKER_LABEL}
- docker push ${THIS_DOCKER_REGISTRY}/${THIS_DOCKER_REPO}/httpd-cron:${THIS_DOCKER_LABEL}
- if [[ ! -z "${TRAVIS_TAG}" ]]; then
docker tag httpd-cron:build ${THIS_DOCKER_REGISTRY}/${THIS_DOCKER_REPO}/httpd-cron:latest;
docker push ${THIS_DOCKER_REGISTRY}/${THIS_DOCKER_REPO}/httpd-cron:latest;
fi