Skip to content

Commit

Permalink
Push tags corresponding upstream tags
Browse files Browse the repository at this point in the history
  • Loading branch information
Bekt committed Nov 12, 2018
1 parent af52d99 commit bceb0fd
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 0 deletions.
File renamed without changes.
35 changes: 35 additions & 0 deletions ci.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env bash

# High-level summary:
# 1. Fetch all gliderlabs/logspout (parent image) tags.
# 2. Build the project with each parent image, and give the same tag.
# 3. Push all tags.


HUB_REPO="${DOCKER_REPO:-bekt/logspout-logstash}"

function main {
TAGS=$(curl -s --retry 5 "https://hub.docker.com/v2/repositories/gliderlabs/logspout/tags/?page_size=50" \
| jq -r '.results|.[].name')
echo "Upstream tags: $TAGS"

for t in ${TAGS}; do
# Fetch the relevant build.sh
curl -s --retry 3 -O "https://raw.githubusercontent.com/gliderlabs/logspout/$t/custom/build.sh"

docker build -t $HUB_REPO:ignore-$t --build-arg UPSTREAM_VERSION=$t .
if [ $? -ne 0 ] ; then
echo "ERROR: failed to build $t"
fi
rm -f build.sh
done

for t in ${TAGS}; do
docker push $HUB_REPO:ignore-$t
if [ $? -ne 0 ] ; then
echo "ERROR: failed to push $t"
fi
done
}

main
7 changes: 7 additions & 0 deletions hooks/build
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
# Docs: https://docs.docker.com/docker-cloud/builds/advanced/

set -e

echo "=> Running pre-push"
./ci.sh
14 changes: 14 additions & 0 deletions hooks/pre_build
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
# Docs: https://docs.docker.com/docker-cloud/builds/advanced/

set -e

echo "=> Running pre-build"
cat /proc/version
env
docker info

curl -L -o jq https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64
chmod +x jq
mv jq /usr/local/bin/

0 comments on commit bceb0fd

Please sign in to comment.