-
Notifications
You must be signed in to change notification settings - Fork 0
/
publish.sh
executable file
·50 lines (41 loc) · 1.24 KB
/
publish.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/env bash
##
# @file
# Build a Docker image for this tool.
#
# Usage:
# ./publish.sh [docker image tag]
#
# If the tag name is not provided, "latest" is assumed.
#
# Copyright 2022 Inveniem. All rights reserved.
#
# @author Guy Elsmore-Paddock ([email protected])
#
# Stop on undefined variables
set -u
# Stop on non-zero exit
set -e
##
# The path to this script.
#
# shellcheck disable=SC2034
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
################################################################################
# Constants #
################################################################################
##
# The tag for the Docker image.
#
TAG="${1:-latest}"
################################################################################
# Main Script Body
################################################################################
build_date=$(date --rfc-3339=seconds)
project_vcs_revision=$(git rev-parse --short HEAD)
container_name="inveniem/kustomize-storage-transformer:${TAG}"
docker build \
--build-arg "VCS_REF=${project_vcs_revision}" \
--build-arg "BUILD_DATE=${build_date}" \
-t "${container_name}" \
.