Skip to content

Commit d75b5a7

Browse files
committed
Push tags corresponding upstream tags
1 parent af52d99 commit d75b5a7

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-0
lines changed

ci.sh

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