Skip to content

Commit

Permalink
CI/Debian: Push images after building
Browse files Browse the repository at this point in the history
This fixes Debian job failures during image building.

See docker/for-linux#711
for upstream details.

Change-Id: Icf3ffb261605ffe5d8f2618c2ed4cb97db97dd49
  • Loading branch information
yoctozepto committed Nov 24, 2019
1 parent a1cd432 commit 6ab144a
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion tools/setup_gate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ function setup_config {
GATE_IMAGES="cron,haproxy,keepalived,kolla-toolbox,mariadb"
fi

# NOTE(yoctozepto): we cannot build and push at the same time on debian
# buster see https://github.com/docker/for-linux/issues/711.
PUSH="true"
if [[ "debian" == $BASE_DISTRO ]]; then
PUSH="false"
fi
cat <<EOF | sudo tee /etc/kolla/kolla-build.conf
[DEFAULT]
namespace = lokolla
Expand All @@ -66,7 +72,7 @@ install_type = ${INSTALL_TYPE}
tag = ${TAG}
profile = gate
registry = 127.0.0.1:4000
push = true
push = ${PUSH}
logs_dir = /tmp/logs/build
template_override = /etc/kolla/template_overrides.j2
Expand Down Expand Up @@ -109,6 +115,13 @@ function prepare_images {
sudo docker run -d -p 4000:5000 --restart=always -v /opt/kolla_registry/:/var/lib/registry --name registry registry:2
pushd "${KOLLA_SRC_DIR}"
sudo tox -e "build-${BASE_DISTRO}-${INSTALL_TYPE}"
# NOTE(yoctozepto): due to debian buster we push after images are built
# see https://github.com/docker/for-linux/issues/711
if [[ "debian" == $BASE_DISTRO ]]; then
for img in $(sudo docker image ls --format '{{ .Repository }}:{{ .Tag }}' | grep lokolla/); do
sudo docker push $img;
done
fi
popd
}

Expand Down

0 comments on commit 6ab144a

Please sign in to comment.