This commit is contained in:
dohsimpson
2025-01-02 14:32:42 -05:00
parent 7afe81ddd5
commit 01c75e5412
2 changed files with 12 additions and 6 deletions

16
Budfile
View File

@@ -81,9 +81,15 @@ check_versions() {
docker_push() {
local version=$(node -p "require('./package.json').version")
docker tag habittrove dohsimpson/habittrove:latest
docker tag habittrove "dohsimpson/habittrove:v$version"
docker push dohsimpson/habittrove:latest
docker push "dohsimpson/habittrove:v$version"
echo "Pushed Docker images with tags: latest and v$version"
# check if version already exist on dockerhub, if so, don't tag and push versioned image
if docker pull "dohsimpson/habittrove:v$version" &>/dev/null; then
echo "Docker image with tag v$version already exists on DockerHub. Skipping versioned image push"
docker tag habittrove dohsimpson/habittrove:latest
docker push dohsimpson/habittrove:latest
echo "Pushed Docker images with tags: latest"
else
docker tag habittrove "dohsimpson/habittrove:v$version"
docker push "dohsimpson/habittrove:v$version"
echo "Pushed Docker images with tags: v$version"
fi
}