Skip to content

Commit 11c2544

Browse files
committed
Push tags corresponding upstream tags
1 parent af52d99 commit 11c2544

File tree

3 files changed

+52
-0
lines changed

3 files changed

+52
-0
lines changed

ci.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env bash
2+
3+
# High-level summary:
4+
# 1. Fetch all gliderlabs/logspout (parent image) tags.
5+
# 2. Build the project with each parent image, and give the same tag.
6+
# 3. Push all tags.
7+
8+
9+
HUB_REPO="${DOCKER_REPO:-bekt/logspout-logstash}"
10+
11+
function main {
12+
TAGS=$(curl -s --retry 5 "https://hub.docker.com/v2/repositories/gliderlabs/logspout/tags/?page_size=50" \
13+
| jq -r '.results|.[].name')
14+
echo "Upstream tags: $TAGS"
15+
16+
for t in ${TAGS}; do
17+
docker build -t $HUB_REPO:ignore-$t --build-arg UPSTREAM_VERSION=$t .
18+
if [ $? -ne 0 ] ; then
19+
echo "ERROR: failed to build $t"
20+
fi
21+
done
22+
23+
for t in ${TAGS}; do
24+
docker push $HUB_REPO:ignore-$t
25+
if [ $? -ne 0 ] ; then
26+
echo "ERROR: failed to push $t"
27+
fi
28+
done
29+
}
30+
31+
main

hooks/pre_build

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
# Docs: https://docs.docker.com/docker-cloud/builds/advanced/
3+
4+
set -e
5+
6+
echo "=> Running pre-build"
7+
cat /proc/version
8+
env
9+
docker info
10+
11+
curl -L -o jq https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64
12+
chmod +x jq
13+
mv jq /usr/local/bin/
14+

hooks/pre_push

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
# Docs: https://docs.docker.com/docker-cloud/builds/advanced/
3+
4+
set -e
5+
6+
echo "=> Running pre-push"
7+
./ci.sh

0 commit comments

Comments
 (0)