Skip to content

Commit

Permalink
update docker_build.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
DirtyRacer1337 committed Dec 7, 2024
1 parent 0b0272f commit 143a730
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions docker_build.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/bash

repo=theporndatabase
version=$(cat pyproject.toml | grep -m1 "version = " | sed 's/.* = //' | sed 's/"//g' | tr -d '[:space:]')

BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
CLEAN=$(git diff-index --quiet HEAD; echo $?)
version=$(cat pyproject.toml | grep -m1 "version = " | sed 's/.* = //' | sed 's/"//g')
#if [[ "${CLEAN}" == "0" ]]; then
export BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
export GIT_HASH=$(git rev-parse --verify HEAD)
export repo=theporndatabase
docker build . --build-arg "BUILD_DATE=${BUILD_DATE}" --build-arg "GIT_HASH=${GIT_HASH}" --build-arg "PROJECT_VERSION=${version}" -t "ghcr.io/${repo}/namer:${version}" -t "ghcr.io/${repo}/namer:latest"
#else
# echo Not building for dirty code.
#fi
export BUILD_DATE

GIT_HASH=$(git rev-parse --verify HEAD)
export GIT_HASH

docker build . --build-arg "BUILD_DATE=${BUILD_DATE}" --build-arg "GIT_HASH=${GIT_HASH}" --build-arg "PROJECT_VERSION=${version}" -t "ghcr.io/${repo}/namer:${version}" -t "ghcr.io/${repo}/namer:latest"

0 comments on commit 143a730

Please sign in to comment.