Skip to content

Commit

Permalink
Breaking change - Renamed argument letters
Browse files Browse the repository at this point in the history
  • Loading branch information
flounderpinto committed Dec 14, 2023
1 parent 87beb54 commit 7c4c410
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
14 changes: 7 additions & 7 deletions src/dockerBuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ CODE_DIR="${CODE_DIR:-/opt/code}"
function dockerBuildUsage
{
echo $'Usage:'
echo $'\tdockerBuild.sh dockerBuild -e dockerRegistryName -r dockerRepoName -d buildContextDir -f dockerFile [-g gitRepoDir] [-p platform]... [-t tag]... [-b buildArg]... [-a arg]... [-h]'
echo $'\tdockerBuild.sh dockerBuild -e dockerRegistryName -r dockerRepoName -c buildContextDir -d dockerFile [-g gitRepoDir] [-p platform]... [-t tag]... [-b buildArg]... [-a arg]... [-h]'
echo $'\t\t-e - Docker registry name.'
echo $'\t\t\te.g. "index.docker.io/my-registry"'
echo $'\t\t-r - Docker repo name.'
echo $'\t\t\te.g. "builder-docker".'
echo $'\t\t-d - Docker build context.'
echo $'\t\t-f - Dockerfile location.'
echo $'\t\t-c - Docker build context.'
echo $'\t\t-d - Dockerfile location.'
echo $'\t\t-g - Git repo directory.'
echo $'\t\t-p - Target platform for build.'
echo $'\t\t\tCan be a comma-separated list or defined multiple times. '
Expand Down Expand Up @@ -88,18 +88,18 @@ function dockerBuild
local BUILD_ARGS=()
local ADDITIONAL_BUILD_FLAGS=()

while getopts ":e:r:d:f:g:p:t:b:a:h" opt; do
while getopts ":e:r:c:d:g:p:t:b:a:h" opt; do
case $opt in
e)
DOCKER_REGISTRY="$OPTARG"
;;
r)
DOCKER_REPO="$OPTARG"
;;
d)
c)
BUILD_CONTEXT_DIR="$OPTARG"
;;
f)
d)
DOCKER_FILE="$OPTARG"
;;
g)
Expand Down Expand Up @@ -244,7 +244,7 @@ function dockerBuild
# always the same. This is a shortcut for calling dockerBuild()
function dockerBuildStandard
{
dockerBuild -d "$CODE_DIR" -f "$CODE_DIR/docker/Dockerfile" -g "$CODE_DIR" "$@"
dockerBuild -c "$CODE_DIR" -d "$CODE_DIR/docker/Dockerfile" -g "$CODE_DIR" "$@"
}

#Allows function calls based on arguments passed to the script
Expand Down
18 changes: 9 additions & 9 deletions test/unit/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ testSingleArgs()
{
local E="docker-registry"
local R="docker-repo"
local D="build-context-dir"
local F="dockerfile"
local C="build-context-dir"
local D="dockerfile"
local G="git-dir"
local P="target"
local T="tag"
Expand All @@ -71,8 +71,8 @@ testSingleArgs()
stdout=$(dockerBuild \
-e "$E" \
-r "$R" \
-c "$C" \
-d "$D" \
-f "$F" \
-g "$G" \
-p "$P" \
-t "$T" \
Expand All @@ -89,8 +89,8 @@ testMultipleArgs()
{
local E="docker-registry"
local R="docker-repo"
local D="build-context-dir"
local F="dockerfile"
local C="build-context-dir"
local D="dockerfile"
local G="git-dir"
local P1="platform1"
local P2="platform2"
Expand All @@ -106,8 +106,8 @@ testMultipleArgs()
stdout=$(dockerBuild \
-e "$E" \
-r "$R" \
-c "$C" \
-d "$D" \
-f "$F" \
-g "$G" \
-p "$P1" \
-p "$P2" \
Expand All @@ -128,8 +128,8 @@ testMultipleArgsCommaSeparated()
{
local E="docker-registry"
local R="docker-repo"
local D="build-context-dir"
local F="dockerfile"
local C="build-context-dir"
local D="dockerfile"
local G="git-dir"
local P="platform1,platform2"
local T1="tag1"
Expand All @@ -143,8 +143,8 @@ testMultipleArgsCommaSeparated()
stdout=$(dockerBuild \
-e "$E" \
-r "$R" \
-c "$C" \
-d "$D" \
-f "$F" \
-g "$G" \
-p "$P" \
-t "$T1" \
Expand Down

0 comments on commit 7c4c410

Please sign in to comment.