Skip to content

Commit

Permalink
Make script testable from console
Browse files Browse the repository at this point in the history
  • Loading branch information
whoan committed Oct 21, 2023
1 parent a15bd94 commit 823e663
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion docker-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ _image_name_contains_namespace() {
_set_namespace() {
if ! _image_name_contains_namespace; then
if _is_docker_hub || _is_new_github_registry; then
NAMESPACE=$INPUT_USERNAME
NAMESPACE=${INPUT_USERNAME:?A username is needed if no namespace is provided}
elif _is_old_github_registry; then
NAMESPACE=$GITHUB_REPOSITORY
elif _is_gcloud_registry; then
Expand Down Expand Up @@ -261,6 +261,9 @@ _parse_extra_args() {
init_variables() {
DUMMY_IMAGE_NAME="$INPUT_IMAGE_NAME":tmp_tag_ignore
BUILD_LOG=build-output.log
: "${INPUT_CONTEXT:=.}"
: "${INPUT_DOCKERFILE:=Dockerfile}"
: "${GITHUB_OUTPUT:=/dev/stdout}"

if _is_aws_ecr; then
if [ -z "$INPUT_USERNAME" ]; then
Expand Down

0 comments on commit 823e663

Please sign in to comment.