Skip to content
Permalink
Browse files

Add registry login script and reinstate to CI

Signed-off-by: Richard Gee <richard@technologee.co.uk>
  • Loading branch information...
rgee0 authored and alexellis committed Jun 23, 2019
1 parent ced4ee5 commit 74ef6edf0854045972e625e4b14b4a880aa46f42
Showing with 40 additions and 18 deletions.
  1. +17 −9 .travis.yml
  2. +15 −0 ci/registryLogin.sh
  3. +8 −9 ci/tagAndPush.sh
@@ -26,19 +26,27 @@ after_success:
- if [ ! -z "$TRAVIS_TAG" ] ; then
export DOCKER_CLI_EXPERIMENTAL=enabled

echo $DOCKER_PASSWORD | docker login -u=$DOCKER_USERNAME --password-stdin;
echo $QUAY_PASSWORD | docker login -u=$QUAY_USERNAME --password-stdin quay.io;

./ci/tagAndPush.sh "$DOCKER_NS/gateway";
./ci/tagAndPush.sh "$DOCKER_NS/basic-auth-plugin";
./ci/tagAndPush.sh "$DOCKER_NS/classic-watchdog" armhf;
./ci/tagAndPush.sh "$DOCKER_NS/classic-watchdog" arm64;
./ci/tagAndPush.sh "$DOCKER_NS/classic-watchdog" windows;
./ci/tagAndPush.sh "$DOCKER_NS/classic-watchdog" x86_64;
export REGISTRY=docker.io;
./ci/registryLogin.sh $REGISTRY;
./ci/tagAndPush.sh "$REGISTRY" "$DOCKER_NS/gateway";
./ci/tagAndPush.sh "$REGISTRY" "$DOCKER_NS/basic-auth-plugin";
./ci/tagAndPush.sh "$REGISTRY" "$DOCKER_NS/classic-watchdog" armhf;
./ci/tagAndPush.sh "$REGISTRY" "$DOCKER_NS/classic-watchdog" arm64;
./ci/tagAndPush.sh "$REGISTRY" "$DOCKER_NS/classic-watchdog" windows;
./ci/tagAndPush.sh "$REGISTRY" "$DOCKER_NS/classic-watchdog" x86_64;

./watchdog/make_manifest.sh
docker push $DOCKER_NS/classic-watchdog:$TRAVIS_TAG

export REGISTRY=quay.io;
./ci/registryLogin.sh $REGISTRY;
./ci/tagAndPush.sh "$REGISTRY" "$DOCKER_NS/gateway";
./ci/tagAndPush.sh "$REGISTRY" "$DOCKER_NS/basic-auth-plugin";
./ci/tagAndPush.sh "$REGISTRY" "$DOCKER_NS/classic-watchdog" armhf;
./ci/tagAndPush.sh "$REGISTRY" "$DOCKER_NS/classic-watchdog" arm64;
./ci/tagAndPush.sh "$REGISTRY" "$DOCKER_NS/classic-watchdog" windows;
./ci/tagAndPush.sh "$REGISTRY" "$DOCKER_NS/classic-watchdog" x86_64;

fi

before_deploy:
@@ -0,0 +1,15 @@
#!/bin/sh
set -e

IMAGE_REGISTRY=$1

if [ "$IMAGE_REGISTRY" = "quay.io" ] ; then
USERNAME=$QUAY_USERNAME
PASSWORD=$QUAY_PASSWORD
elif [ "$IMAGE_REGISTRY" = "docker.io" ] ; then
USERNAME=$DOCKER_USERNAME
PASSWORD=$DOCKER_PASSWORD
fi

echo "Attempting to log in to $IMAGE_REGISTRY"
echo $PASSWORD | docker login -u=$USERNAME --password-stdin $IMAGE_REGISTRY;
@@ -1,17 +1,16 @@
#!/bin/sh
set -e

IMAGE_NAME=$1
IMAGE_REGISTRY=$1
IMAGE_NAME=$2
PLATFORM=""

if [ ! -z "$2" ]; then
PLATFORM="-$2"
if [ ! -z "$3" ]; then
PLATFORM="-$3"
fi

echo "Tagging $IMAGE_NAME:$TRAVIS_TAG$PLATFORM"
docker tag $IMAGE_NAME:latest-dev$PLATFORM $IMAGE_NAME:$TRAVIS_TAG$PLATFORM;
docker tag $IMAGE_NAME:latest-dev$PLATFORM quay.io/$IMAGE_NAME:$TRAVIS_TAG$PLATFORM;
echo "Tagging $IMAGE_REGISTRY/$IMAGE_NAME:$TRAVIS_TAG$PLATFORM"
docker tag $IMAGE_NAME:latest-dev$PLATFORM $IMAGE_REGISTRY/$IMAGE_NAME:$TRAVIS_TAG$PLATFORM;

echo "Pushing $IMAGE_NAME:$TRAVIS_TAG$PLATFORM"
docker push $IMAGE_NAME:$TRAVIS_TAG$PLATFORM;
docker push quay.io/$IMAGE_NAME:$TRAVIS_TAG$PLATFORM;
echo "Pushing $IMAGE_REGISTRY/$IMAGE_NAME:$TRAVIS_TAG$PLATFORM"
docker push $IMAGE_REGISTRY/$IMAGE_NAME:$TRAVIS_TAG$PLATFORM;

0 comments on commit 74ef6ed

Please sign in to comment.
You can’t perform that action at this time.