File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33# This script is for local builds.
44# It gathers version information from the local .git repository
55# and passes it as build arguments to the docker build command.
6+ # It also tags the resulting image with the git tag or short SHA.
67
78set -e
89
10+ # --- Version Information ---
911CI_COMMIT_TAG=$( git describe --tags --always)
1012CI_COMMIT_REF_NAME=$( git rev-parse --abbrev-ref HEAD)
1113CI_COMMIT_SHA=$( git rev-parse --verify HEAD)
1214CI_COMMIT_SHORT_SHA=$( git rev-parse --verify --short HEAD)
1315
14- docker build .
16+ # --- Docker Image Tagging ---
17+ IMAGE_NAME=" basiscompany/tarantool-admin"
18+ # Use git tag if on a tagged commit, otherwise use short SHA
19+ IMAGE_TAG=$( git describe --tags --exact-match 2> /dev/null || echo " $CI_COMMIT_SHORT_SHA " )
20+
21+ echo " Building image: $IMAGE_NAME :$IMAGE_TAG "
22+
23+ docker build . \
1524 --build-arg CI_COMMIT_TAG=" $CI_COMMIT_TAG " \
1625 --build-arg CI_COMMIT_REF_NAME=" $CI_COMMIT_REF_NAME " \
1726 --build-arg CI_COMMIT_SHA=" $CI_COMMIT_SHA " \
1827 --build-arg CI_COMMIT_SHORT_SHA=" $CI_COMMIT_SHORT_SHA " \
28+ -t " $IMAGE_NAME :$IMAGE_TAG " \
1929 " $@ "
You can’t perform that action at this time.
0 commit comments