2016-11-24 19:56:53 +01:00
|
|
|
env:
|
|
|
|
- IMAGE=android-arm
|
|
|
|
- IMAGE=browser-asmjs
|
|
|
|
- IMAGE=linux-arm64
|
|
|
|
- IMAGE=linux-armv5
|
|
|
|
- IMAGE=linux-armv6
|
|
|
|
- IMAGE=linux-armv7
|
|
|
|
- IMAGE=linux-ppc64le
|
|
|
|
- IMAGE=linux-x64
|
|
|
|
- IMAGE=linux-x86
|
|
|
|
- IMAGE=manylinux-x64
|
|
|
|
- IMAGE=manylinux-x86
|
|
|
|
- IMAGE=windows-x64
|
|
|
|
- IMAGE=windows-x86
|
|
|
|
command:
|
|
|
|
- |
|
2016-11-24 21:07:24 +01:00
|
|
|
if [[ $STEP == "dependencies" ]]; then
|
2016-11-24 19:56:53 +01:00
|
|
|
if [[ $CIRCLE_NODE_INDEX == 0 ]]; then
|
2016-11-22 06:10:36 +01:00
|
|
|
if [[ ! -f ~/BASE_AVAILABLE ]]; then
|
2016-11-26 00:18:17 +01:00
|
|
|
|
|
|
|
if [[ -e ~/docker/base.tar ]]; then
|
|
|
|
echo "Loading base.tar from ~/docker cache"
|
|
|
|
time docker load -i ~/docker/base.tar
|
|
|
|
echo "Loading base.tar from ~/docker cache - done"
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Pulling dockcross/base"
|
2016-11-22 06:10:36 +01:00
|
|
|
time docker pull dockcross/base
|
2016-11-26 00:18:17 +01:00
|
|
|
echo "Pulling dockcross/base - done"
|
|
|
|
|
2016-11-22 06:10:36 +01:00
|
|
|
time make base.test
|
2016-11-26 00:18:17 +01:00
|
|
|
|
|
|
|
echo "Saving debian:jessie dockcross/base into ~/docker cache"
|
2016-11-22 06:10:36 +01:00
|
|
|
mkdir -p ~/docker; time docker save -o ~/docker/base.tar debian:jessie dockcross/base
|
2016-11-26 00:18:17 +01:00
|
|
|
echo "Saving debian:jessie dockcross/base into ~/docker cache - done"
|
|
|
|
|
2016-11-22 06:10:36 +01:00
|
|
|
touch ~/BASE_AVAILABLE
|
|
|
|
else
|
|
|
|
echo "Base image already available"
|
|
|
|
fi
|
2016-11-24 19:56:53 +01:00
|
|
|
else
|
2016-11-22 06:10:36 +01:00
|
|
|
if [[ ! -f ~/BASE_DOWNLOADED ]]; then
|
2016-11-24 19:56:53 +01:00
|
|
|
echo "Waiting for node0"
|
|
|
|
while true; do
|
|
|
|
sleep 5
|
2016-11-22 06:10:36 +01:00
|
|
|
ssh -q node0 [[ -f ~/BASE_AVAILABLE ]]
|
2016-11-24 19:56:53 +01:00
|
|
|
exit_code=$?
|
|
|
|
if [[ $exit_code -eq 0 ]]; then break; elif [[ $exit_code -eq 1 ]]; then echo -n "."; else exit $exit_code;fi
|
|
|
|
done
|
2016-11-26 00:18:17 +01:00
|
|
|
echo "Waiting for node0 - done"
|
|
|
|
|
2016-11-24 19:56:53 +01:00
|
|
|
echo "Copying base image from node0"
|
2016-11-22 06:10:36 +01:00
|
|
|
mkdir -p ~/docker; time scp node0:~/docker/base.tar ~/docker/base.tar
|
2016-11-26 00:18:17 +01:00
|
|
|
echo "Copying base image from node0 - done"
|
|
|
|
|
2016-11-22 06:10:36 +01:00
|
|
|
touch ~/BASE_DOWNLOADED
|
2016-11-24 19:56:53 +01:00
|
|
|
else
|
2016-11-22 06:10:36 +01:00
|
|
|
echo "Base image already downloaded"
|
2016-11-24 19:56:53 +01:00
|
|
|
fi
|
|
|
|
fi
|
2016-11-24 21:07:24 +01:00
|
|
|
fi
|
|
|
|
if [[ $STEP == "test" ]]; then
|
2016-11-26 00:18:17 +01:00
|
|
|
if [[ -e ~/docker/$IMAGE.tar ]]; then
|
|
|
|
echo "Loading $IMAGE.tar from ~/docker cache"
|
|
|
|
time docker load -i ~/docker/$IMAGE.tar
|
|
|
|
echo "Loading $IMAGE.tar from ~/docker cache - done"
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Pulling dockcross/$IMAGE"
|
2016-11-22 06:10:36 +01:00
|
|
|
time docker pull dockcross/$IMAGE
|
2016-11-26 00:18:17 +01:00
|
|
|
echo "Pulling dockcross/$IMAGE - done"
|
|
|
|
|
|
|
|
echo "Loading base.tar from ~/docker cache"
|
2016-11-22 06:10:36 +01:00
|
|
|
time docker load -i ~/docker/base.tar
|
2016-11-26 00:18:17 +01:00
|
|
|
echo "Loading base.tar from ~/docker cache - done"
|
|
|
|
|
2016-11-22 06:10:36 +01:00
|
|
|
time make $IMAGE.test
|
2016-11-26 00:18:17 +01:00
|
|
|
|
|
|
|
echo "Saving dockcross/$IMAGE into ~/docker cache"
|
2016-11-22 06:10:36 +01:00
|
|
|
mkdir -p ~/docker; time docker save dockcross/$IMAGE > ~/docker/$IMAGE.tar
|
2016-11-26 00:18:17 +01:00
|
|
|
echo "Saving dockcross/$IMAGE into ~/docker cache - done"
|
|
|
|
|
2016-11-24 19:56:53 +01:00
|
|
|
fi
|
2016-11-22 06:10:36 +01:00
|
|
|
if [[ $STEP == "deployment" ]]; then
|
2016-11-24 19:56:53 +01:00
|
|
|
docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
|
|
|
|
if [[ $CIRCLE_NODE_INDEX == 0 ]] && [[ ! -f ~/BASE_PUSHED ]]; then
|
2016-11-26 00:18:17 +01:00
|
|
|
echo "Pushing dockcross/base"
|
2016-11-22 06:10:36 +01:00
|
|
|
time docker push dockcross/base
|
2016-11-26 00:18:17 +01:00
|
|
|
echo "Pulling dockcross/base - done"
|
2016-11-24 19:56:53 +01:00
|
|
|
touch ~/BASE_PUSHED
|
|
|
|
fi
|
2016-11-26 00:18:17 +01:00
|
|
|
|
|
|
|
echo "Pushing dockcross/$IMAGE"
|
|
|
|
time docker push dockcross/$IMAGE
|
|
|
|
echo "Pushing dockcross/$IMAGE - done"
|
2016-11-24 19:56:53 +01:00
|
|
|
fi
|