-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: setup script for build container image
Signed-off-by: Zhou Zhiqiang <im@strrl.dev>
- Loading branch information
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -exo pipefail | ||
|
||
echo ${FEATURES} | ||
|
||
DIR=$(dirname $0) | ||
|
||
COMMIT_HASH=$(bash "${DIR}"/commit-hash.sh) | ||
|
||
cd ${DIR}/../ && \ | ||
DOCKER_BUILDKIT=1 docker build -t ghcr.io/limit-lab/unollm_next:"${COMMIT_HASH}" \ | ||
--build-arg GITHUB_USERNAME="${GITHUB_USERNAME}" \ | ||
--build-arg GITHUB_TOKEN="${GITHUB_TOKEN}" \ | ||
-f ./Dockerfile ./ | ||
|
||
docker tag ghcr.io/limit-lab/unollm_next:"${COMMIT_HASH}" ghcr.io/limit-lab/unollm_next:latest | ||
|
||
if [ ! -z ${IMAGE_TAG} ]; then | ||
docker tag ghcr.io/limit-lab/unollm_next:"${COMMIT_HASH}" ghcr.io/limit-lab/unollm_next:${IMAGE_TAG} | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euxo pipefail | ||
|
||
HASH=$(git rev-list -1 HEAD --abbrev-commit) | ||
if [[ $(git status --porcelain) ]]; then | ||
HASH=${HASH}-dirty | ||
fi | ||
|
||
echo $HASH |