❇️ Don't use Docker cache for 'master' and 'develop'
This commit is contained in:
parent
98d90582b7
commit
34d5bd711e
5
build.sh
5
build.sh
|
@ -30,14 +30,17 @@ URL="${URL-https://github.com/${SRC_REPO}/netbox/archive/$BRANCH.tar.gz}"
|
||||||
|
|
||||||
if [ "${BRANCH}" == "master" ]; then
|
if [ "${BRANCH}" == "master" ]; then
|
||||||
TAG="${TAG-latest}"
|
TAG="${TAG-latest}"
|
||||||
|
CACHE="--no-cache"
|
||||||
elif [ "${BRANCH}" == "develop" ]; then
|
elif [ "${BRANCH}" == "develop" ]; then
|
||||||
TAG="${TAG-snapshot}"
|
TAG="${TAG-snapshot}"
|
||||||
|
CACHE="--no-cache"
|
||||||
else
|
else
|
||||||
TAG="${TAG-$BRANCH}"
|
TAG="${TAG-$BRANCH}"
|
||||||
|
CACHE=""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "🐳 Building the Docker image '${DOCKER_REPO}/netbox:${TAG}' from the branch '${BRANCH}'."
|
echo "🐳 Building the Docker image '${DOCKER_REPO}/netbox:${TAG}' from the branch '${BRANCH}'."
|
||||||
docker build -f Dockerfile -t "${DOCKER_REPO}/netbox:${TAG}" --build-arg "BRANCH=${BRANCH}" --build-arg "URL=${URL}" --pull .
|
docker build -t "${DOCKER_REPO}/netbox:${TAG}" --build-arg "BRANCH=${BRANCH}" --build-arg "URL=${URL}" --pull ${CACHE} .
|
||||||
echo "✅ Finished building the Docker images '${DOCKER_REPO}/netbox:${TAG}'"
|
echo "✅ Finished building the Docker images '${DOCKER_REPO}/netbox:${TAG}'"
|
||||||
|
|
||||||
if [ "${2}" == "--push" ] ; then
|
if [ "${2}" == "--push" ] ; then
|
||||||
|
|
Loading…
Reference in New Issue