Update build script

This commit is contained in:
CrazyMax 2018-12-04 01:57:30 +01:00
parent 72d583858d
commit f8638dfeef
No known key found for this signature in database
GPG Key ID: 3248E46B6BB8C7F7

View File

@ -35,6 +35,8 @@ echo "PROJECT=${PROJECT}"
echo "VERSION=${VERSION}" echo "VERSION=${VERSION}"
echo "BUILD_DATE=${BUILD_DATE}" echo "BUILD_DATE=${BUILD_DATE}"
echo "BUILD_TAG=${BUILD_TAG}" echo "BUILD_TAG=${BUILD_TAG}"
echo "BUILD_WORKINGDIR=${BUILD_WORKINGDIR}"
echo "DOCKERFILE=${DOCKERFILE}"
echo "VCS_REF=${VCS_REF}" echo "VCS_REF=${VCS_REF}"
echo "PUSH_LATEST=${PUSH_LATEST}" echo "PUSH_LATEST=${PUSH_LATEST}"
echo "DOCKER_LOGIN=${DOCKER_LOGIN}" echo "DOCKER_LOGIN=${DOCKER_LOGIN}"
@ -79,9 +81,16 @@ while read LOGLINE; do
exit 1 exit 1
fi fi
done < <(docker logs -f ${PROJECT} 2>&1) done < <(docker logs -f ${PROJECT} 2>&1)
docker rm -f ${PROJECT} > /dev/null 2>&1 || true
echo echo
CONTAINER_STATUS=$(docker container inspect --format "{{.State.Status}}" ${PROJECT})
if [[ ${CONTAINER_STATUS} != "running" ]]; then
>&2 echo "ERROR: Container ${PROJECT} returned status '$CONTAINER_STATUS'"
docker rm -f ${PROJECT} > /dev/null 2>&1 || true
exit 1
fi
docker rm -f ${PROJECT} > /dev/null 2>&1 || true
if [ "${VERSION}" == "local" -o "${TRAVIS_PULL_REQUEST}" == "true" ]; then if [ "${VERSION}" == "local" -o "${TRAVIS_PULL_REQUEST}" == "true" ]; then
echo "INFO: This is a PR or a local build, skipping push..." echo "INFO: This is a PR or a local build, skipping push..."
exit 0 exit 0