Skip to content

Commit

Permalink
fix(arm) make sure we setup our arm infrastructure (#260)
Browse files Browse the repository at this point in the history
* fix(arm) make sure we setup our arm infrastructure

* fix(arm) move some arm infra installation logic around
  • Loading branch information
hutchic authored Apr 20, 2020
1 parent 57c1e60 commit 746b6a4
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 22 deletions.
42 changes: 30 additions & 12 deletions .ci/setup_ci.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,41 @@
#!/bin/bash

set -e
set -x

if [ "$RESTY_IMAGE_TAG" != "xenial" ]; then
exit 0
fi

docker version
RESULT=$?
if [ "$RESULT" != "0" ]; then
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) test"
sudo apt-get update
sudo apt-get -y -o Dpkg::Options::="--force-confnew" install containerd.io docker-ce
fi

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) test"
sudo apt-get update
sudo apt-get -y -o Dpkg::Options::="--force-confnew" install containerd.io docker-ce
echo '{"experimental":true}' | sudo tee /etc/docker/daemon.json
curl -fsSLo buildx https://github.com/docker/buildx/releases/download/v0.2.2/buildx-v0.2.2.linux-amd64
mkdir -p ~/.docker/cli-plugins/
chmod +x buildx
mv buildx ~/.docker/cli-plugins/docker-buildx
sudo service docker restart

docker buildx version
RESULT=$?
if [ "$RESULT" != "0" ]; then
curl -fsSLo buildx https://github.com/docker/buildx/releases/download/v0.2.2/buildx-v0.2.2.linux-amd64
mkdir -p ~/.docker/cli-plugins/
chmod +x buildx
mv buildx ~/.docker/cli-plugins/docker-buildx
sudo service docker restart
fi

if ! [ -x "$(command -v docker-machine)" ]; then
curl -L https://github.com/docker/machine/releases/download/v0.16.0/docker-machine-$(uname -s)-$(uname -m) >docker-machine
sudo install docker-machine /usr/local/bin/docker-machine
curl -L https://github.com/docker/machine/releases/download/v0.16.0/docker-machine-$(uname -s)-$(uname -m) >docker-machine
sudo install docker-machine /usr/local/bin/docker-machine
fi

echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin || true
echo "$REDHAT_PASSWORD" | docker login -u "$REDHAT_USERNAME" registry.access.redhat.com --password-stdin || true
docker-machine version
docker version
docker buildx version

export BUILDX=true
4 changes: 2 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ pipeline {
sh 'make setup-ci'
sh 'git clone --single-branch --branch ${KONG_SOURCE} https://github.com/Kong/kong.git ${KONG_SOURCE_LOCATION}'
sh 'export BUILDX=false RESTY_IMAGE_TAG=bionic && make package-kong && make test && make cleanup'
sh 'export CACHE=false UPDATE_CACHE=true RESTY_IMAGE_TAG=xenial DOCKER_MACHINE_ARM64_NAME="jenkins-kong-"`cat /proc/sys/kernel/random/uuid` && make setup-build && make package-kong && make test'
sh 'export CACHE=false UPDATE_CACHE=true RESTY_IMAGE_TAG=xenial DOCKER_MACHINE_ARM64_NAME="jenkins-kong-"`cat /proc/sys/kernel/random/uuid` && make package-kong && make test'
}
post {
always {
Expand Down Expand Up @@ -206,4 +206,4 @@ pipeline {
}
}
}
}
}
12 changes: 4 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ else ifeq ($(RESTY_IMAGE_TAG),xenial)
endif

BUILDX_INFO ?= $(shell docker buildx 2>&1 >/dev/null; echo $?)
ifneq ($(BUILDX_INFO),)
BUILDX=false
endif

ifeq ($(BUILDX),false)
DOCKER_COMMAND?=docker build --build-arg BUILDPLATFORM=x/amd64
Expand Down Expand Up @@ -102,14 +99,13 @@ debug:
@echo ${BUILDX_INFO}
@echo ${DEBUG}

setup-ci:
@echo "no longer used"
setup-ci: setup-build

setup-build: cleanup-build
setup-build:
.ci/setup_ci.sh
ifeq ($(RESTY_IMAGE_BASE),src)
@echo "nothing to be done"
else ifeq ($(BUILDX),true)
.ci/setup_ci.sh
docker buildx create --name multibuilder
docker-machine create --driver amazonec2 \
--amazonec2-instance-type a1.medium \
Expand Down Expand Up @@ -202,7 +198,7 @@ else
package-kong: actual-package-kong
endif

actual-package-kong: cleanup
actual-package-kong: cleanup setup-build
ifeq ($(DEBUG),1)
exit 1
endif
Expand Down

0 comments on commit 746b6a4

Please sign in to comment.