refactor: add global docker build and run args

This reduces duplication and allows users to rely on global arguments to generate most labels needed.

The 'commit' command cannot have global arguments because the whitespace within the label change breaks string-based interpolation, and shell arrays cannot be exported.
This commit is contained in:
Jose Diaz-Gonzalez committed 2019-07-20 05:52:20 -04:00
1 parent 193e40b4c3
commit 6836e56b24
15 files changed
+59 -45

No files matched your search

+2 -2
View File
@@ -18,7 +18,7 @@ scheduler-docker-local-scheduler-run() {
return
fi
local DOCKER_RUN_LABEL_ARGS="--label=org.label-schema.schema-version=1.0 --label=org.label-schema.vendor=dokku --label=com.dokku.app-name=$APP"
local DOCKER_RUN_LABEL_ARGS="--label=com.dokku.app-name=$APP"
local IMAGE_TAG=$(get_running_image_tag "$APP")
local IMAGE=$(get_deploying_app_image_name "$APP" "$IMAGE_TAG")
@@ -67,7 +67,7 @@ scheduler-docker-local-scheduler-run() {
fi
# shellcheck disable=SC2086
"$DOCKER_BIN" run "${DOCKER_RUN_LABEL_ARGS[@]}" "${DOKKU_GLOBAL_RUN_ARGS[@]}" "${DOCKER_ARGS_ARRAY[@]}" $IMAGE $EXEC_CMD "$@"
"$DOCKER_BIN" run "${DOCKER_RUN_LABEL_ARGS[@]}" $DOKKU_GLOBAL_RUN_ARGS "${DOCKER_ARGS_ARRAY[@]}" $IMAGE $EXEC_CMD "$@"
}
scheduler-docker-local-scheduler-run "$@"