-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.jobserv.yml
58 lines (52 loc) · 1.49 KB
/
.jobserv.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
timeout: 10
triggers:
- name: merge-request
type: github_pr
runs:
- name: flake8
container: python:3.5-alpine
host-tag: amd64
script: flake8
- name: build-container
type: git_poller
params:
GIT_URL: "https://github.com/doanac/gavel-ci.git"
GIT_POLL_REFS: "refs/heads/master"
runs:
- name: build-container
container: docker:19.03.5-dind
privileged: true
host-tag: amd64
script: build-container
scripts:
flake8: |
#!/bin/sh -ex
pip3 install flake8
flake8 --ignore=E722 --exclude=migrations/ ./
build-container: |
#!/bin/sh -e
TAG=${GIT_SHA:0:6}
unset DOCKER_HOST
DOCKER_TLS_CERTDIR= /usr/local/bin/dockerd-entrypoint.sh --raw-logs >/archive/dockerd.log 2>&1 &
for i in `seq 10` ; do
sleep 1
docker info >/dev/null 2>&1 && break
if [ $i = 10 ] ; then
echo 'Timed out trying to connect to internal docker host.' >&2
exit 1
fi
done
set -x
docker build -t doanac/gavel-ci:$TAG --force-rm .
docker tag doanac/gavel-ci:$TAG doanac/gavel-ci:latest
if [ -f /secrets/dockerpass ] ; then
set +x
token=$(cat /secrets/dockerpass)
mkdir -p $HOME/.docker
docker login --username=doanac --password=$token
set -x
docker push doanac/gavel-ci:$TAG
docker push doanac/gavel-ci:latest
else
echo "dockerpass not provided, skipping publishing step"
fi