-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathshippable.yml
50 lines (42 loc) · 1.51 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
39
40
41
42
43
44
45
46
47
48
49
50
# vim: et sr sw=2 ts=2 smartindent:
language: none
env:
global:
- IMG="aws_terraform"
- JQ="https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64"
build:
pre_ci_boot:
options: -v /tf_bin -v /tf_plugin_cache_dir
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
- mkdir /tf_bin /tf_plugin_cache_dir || true
- bash ./build.sh # avoid aufs file-locking with new shell
- bash ./test.sh
on_success:
- if [[ "$IS_GIT_TAG" == "true" ]] || [[ "$IS_RELEASE" == "true" ]]; then
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=terraform-$(echo $a | jq -r '."opsgang.terraform_version"') ;
pmv=$(echo $pv | sed -e 's/\.[0-9]\+$//') ;
tags="$v $gt $pv $pmv stable" ; echo $a | jq . ; echo "docker tags:($tags)" ;
for t in $tags; do
docker tag opsgang/$IMG:candidate opsgang/$IMG:$t;
docker push opsgang/$IMG:$t;
echo "... pushed $IMG:$t";
done ;
fi
integrations:
hub:
- integrationName: opsgang_dockerhubreg
type: dockerRegistryLogin
notifications:
- integrationName: opsgang_slack_delivery
type: slack
recipients: "#delivery"
on_success: always
on_failure: always
on_pull_request: never
generic:
- integrationName: GITHUB_OAUTH_TOKEN