2016-01-08 14:43:59 -05:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# This scripts sets up the required images for Windows to Windows CI
|
|
|
|
|
2016-06-23 19:37:53 -04:00
|
|
|
# Tag (microsoft/)windowsservercore as latest
|
2016-01-08 14:43:59 -05:00
|
|
|
set +e
|
|
|
|
! BUILD=$(docker images | grep windowsservercore | grep -v latest | awk '{print $2}')
|
|
|
|
if [ -z $BUILD ]; then
|
|
|
|
echo "ERROR: Could not find windowsservercore images"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2016-06-23 19:37:53 -04:00
|
|
|
# Get the name. Around 2016 6D TP5, these have the microsoft/ prefix, hence cater for both.
|
|
|
|
! IMAGENAME=$(docker images | grep windowsservercore | grep -v latest | awk '{print $1}')
|
|
|
|
if [ -z $IMAGENAME ]; then
|
|
|
|
echo "ERROR: Could not find windowsservercore image"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2016-01-08 14:43:59 -05:00
|
|
|
! LATESTCOUNT=$(docker images | grep windowsservercore | grep -v $BUILD | wc -l)
|
|
|
|
if [ $LATESTCOUNT -ne 1 ]; then
|
|
|
|
set -e
|
2016-06-23 19:37:53 -04:00
|
|
|
docker tag $IMAGENAME:$BUILD windowsservercore:latest
|
|
|
|
echo "INFO: Tagged $IMAGENAME:$BUILD as windowsservercore:latest"
|
2016-01-08 14:43:59 -05:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Busybox (requires windowsservercore)
|
|
|
|
if [ -z "$(docker images | grep busybox)" ]; then
|
|
|
|
echo "INFO: Building busybox"
|
|
|
|
docker build -t busybox https://raw.githubusercontent.com/jhowardmsft/busybox/master/Dockerfile
|
|
|
|
fi
|