-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
65 lines (59 loc) · 2.28 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
language: bash
services: docker
env:
HADOLINT: "${HOME}/hadolint"
addons:
apt:
packages:
- shellcheck
install:
# Download hadolint binary and set it as executable
- curl -sL -o ${HADOLINT} "https://github.com/hadolint/hadolint/releases/download/v1.2.4/hadolint-$(uname -s)-$(uname -m)" && chmod 700 ${HADOLINT}
- git clone https://github.com/docker-library/official-images.git ~/official-images
before_deploy:
- git config --global user.email "rucasbot@gmail.com"
- git config --global user.name "rucasbot"
- version=`cat VERSION`
- "echo -e \"\" >> CHANGELOG.md"
- "echo -e \"## v$version\" >> CHANGELOG.md"
- "echo -e \"\" >> CHANGELOG.md"
- "echo -e \":date: $(date)\" >> CHANGELOG.md"
- "echo -e \"\" >> CHANGELOG.md"
- "echo -e \"[:whale: rucas/taskd:$version](https://hub.docker.com/r/rucas/taskd/tags/)\" >> CHANGELOG.md"
- "echo -e \"\" >> CHANGELOG.md"
- "echo -e \"[:bookmark: release v1.0.0](https://www.github.com/rucas/taskd/releases/tag/v$version)\" >> CHANGELOG.md"
- "echo -e \"\" >> CHANGELOG.md"
- "echo -e \"A whole bunch of changes:\" >> CHANGELOG.md"
- git tag -a v$version -m "$version"
after_deploy:
- version=`cat VERSION`
- git remote rm origin
- git remote add origin "https://${GH_TOKEN}@github.com/rucas/taskd.git"
- git checkout -b tag/v$version
- git add CHANGELOG.md
- git commit -m "updated CHANGELOG.md [ci skip]"
- git push origin tag/v$version
jobs:
include:
- script: |
git ls-files --exclude='Dockerfile*' --ignored | xargs --max-lines=1 ${HADOLINT}
shellcheck *.sh
- script: |
docker build -t rucas/taskd .
~/official-images/test/run.sh rucas/taskd
- stage: Docker Hub
if: (NOT type IN (pull_request)) AND (branch = master)
script: |
version=`cat VERSION`
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
docker build -t rucas/taskd:latest .
docker tag rucas/taskd:latest rucas/taskd:$version
docker push rucas/taskd:latest
docker push rucas/taskd:$version
- stage: Github Release
if: (NOT type IN (pull_request)) AND (branch = master)
script: echo "Deploying to GitHub releases ..."
deploy:
provider: releases
api_key: $GH_TOKEN
skip_cleanup: true