-
Notifications
You must be signed in to change notification settings - Fork 2
/
shippable.yml
38 lines (33 loc) · 1.42 KB
/
shippable.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
# vim: et sr sw=2 ts=2 smartindent:
language: none
branches:
only:
- master
env:
global:
- IMG="aws_packer"
- SR="https://github.com/opsgang/alpine_build_scripts"
- JQ="https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64"
- secure: 3yF/Z8TLKOYeNjdHNqArN5mBrlSRPewBgkQ9ksgucMUgyiOUuWJQgPn7+szasLtA9fqOXhpi2i/CTS/7Tb8bGwmK+pXnciyJ8fmOxXN8UrqVft1eXrYwqxKLt1aU8BC+0MXvz59xJ78eNsgkjwW5ajdibr4yMU42iXsMD4NC8/7UaD31fUG3FqZOTYOPLIo+e3BuDExjjtmLgbB8RMIIewZTNB/z8tN8oIUSL3n8vpe2pdg1T66J3rhcol4gWLUOsZoWl+JrASXYqzci00RXEy4P7w073soZ3eM++Em4PyImxtRd0Xr68w9+b5tG6UPOWdEYujhF3HLAs2+2LrQg3A==
build:
ci:
- curl -O -L $JQ
&& chmod +x jq-linux64
&& sudo mv jq-linux64 /usr/bin/jq
- docker pull opsgang/$IMG:stable || true # speed up build layers
- git clone $SR --depth 1
- bash ./build.sh # avoid aufs file-locking with new shell
on_success:
- a=$(docker inspect opsgang/$IMG:candidate | jq -r '.[].Config.Labels')
- v=$(echo $a | jq -r '.version')
- gt=$(echo $a | jq -r '."opsgang.build_git_tag"')
- pv=packer-$(echo $a | jq -r '."opsgang.packer_version"')
- tags="$v $gt $pv stable"
- echo $a | jq . # show me the labels please
- echo "docker tags:($tags)"
- docker login -p $DHP -u $DHU
- for t in $tags; do
docker tag opsgang/$IMG:candidate opsgang/$IMG:$t;
docker push opsgang/$IMG:$t;
echo "... pushed $IMG:$t";
done