Update build script
This commit is contained in:
parent
72d583858d
commit
f8638dfeef
11
build.sh
11
build.sh
@ -35,6 +35,8 @@ echo "PROJECT=${PROJECT}"
|
||||
echo "VERSION=${VERSION}"
|
||||
echo "BUILD_DATE=${BUILD_DATE}"
|
||||
echo "BUILD_TAG=${BUILD_TAG}"
|
||||
echo "BUILD_WORKINGDIR=${BUILD_WORKINGDIR}"
|
||||
echo "DOCKERFILE=${DOCKERFILE}"
|
||||
echo "VCS_REF=${VCS_REF}"
|
||||
echo "PUSH_LATEST=${PUSH_LATEST}"
|
||||
echo "DOCKER_LOGIN=${DOCKER_LOGIN}"
|
||||
@ -79,9 +81,16 @@ while read LOGLINE; do
|
||||
exit 1
|
||||
fi
|
||||
done < <(docker logs -f ${PROJECT} 2>&1)
|
||||
docker rm -f ${PROJECT} > /dev/null 2>&1 || true
|
||||
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
|
||||
echo "INFO: This is a PR or a local build, skipping push..."
|
||||
exit 0
|
||||
|
Loading…
Reference in New Issue
Block a user