diff --git a/common/config/rush/command-line.json b/common/config/rush/command-line.json index 0789bed6fc..d961beb732 100644 --- a/common/config/rush/command-line.json +++ b/common/config/rush/command-line.json @@ -247,6 +247,14 @@ "safeForSimultaneousRushProcesses": true, "shellCommand": "./common/scripts/docker.sh" }, + { + "commandKind": "global", + "name": "docker:patch", + "summary": "Build and push docker images with a custom version", + "description": "Allows building and pushing docker images with a manually specified version tag. Usage: rush docker:patch --version [rush-args]", + "safeForSimultaneousRushProcesses": true, + "shellCommand": "./common/scripts/docker_patch.sh" + }, { "commandKind": "global", "name": "docker-server", @@ -424,6 +432,22 @@ "longName": "--branch", "description": "Force formatting of branch", "associatedCommands": ["fast-format"] + }, + { + "parameterKind": "string", + "argumentName": "VERSION", + "required": false, + "longName": "--version", + "description": "The version tag to use for docker images", + "associatedCommands": ["docker:patch"] + }, + { + "parameterKind": "string", + "argumentName": "PLATFORM", + "required": false, + "longName": "--platform", + "description": "The target platform for docker build (e.g., linux/amd64). Defaults to linux/amd64.", + "associatedCommands": ["docker:patch"] } // { // /** diff --git a/common/scripts/docker_build.sh b/common/scripts/docker_build.sh index 2a564dc375..059a3c962b 100755 --- a/common/scripts/docker_build.sh +++ b/common/scripts/docker_build.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -version=$(git rev-parse HEAD) +version=${DOCKER_VERSION:-$(git rev-parse HEAD)} # Check for cleanup flag from environment cleanup=false diff --git a/common/scripts/docker_patch.sh b/common/scripts/docker_patch.sh new file mode 100755 index 0000000000..6b694ab07c --- /dev/null +++ b/common/scripts/docker_patch.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env bash + +# This script allows building and pushing docker images with a custom version tag. +# It can be run interactively or with the --version flag. + +VERSION="" +PLATFORM="linux/amd64" +REMAINING_ARGS=() + +while [[ $# -gt 0 ]]; do + case $1 in + --version) + VERSION="$2" + shift 2 + ;; + --platform) + PLATFORM="$2" + shift 2 + ;; + *) + REMAINING_ARGS+=("$1") + shift + ;; + esac +done + +if [ -z "$VERSION" ]; then + read -p "Enter version tag for docker images: " VERSION +fi + +if [ -z "$VERSION" ]; then + echo "Error: Version tag is required." + exit 1 +fi + +export DOCKER_VERSION="$VERSION" +export DOCKER_EXTRA="--platform=$PLATFORM" +echo "Starting docker build and push for version: $DOCKER_VERSION ($PLATFORM)" + +# We use 'node common/scripts/install-run-rush.js' to ensure we use the right rush version +node "$(dirname "$0")/install-run-rush.js" docker:build "${REMAINING_ARGS[@]}" +node "$(dirname "$0")/install-run-rush.js" docker:push "${REMAINING_ARGS[@]}" + +echo "Docker patch completed for version: $DOCKER_VERSION" diff --git a/common/scripts/docker_tag.sh b/common/scripts/docker_tag.sh index 70f4f360b2..49e68aec70 100755 --- a/common/scripts/docker_tag.sh +++ b/common/scripts/docker_tag.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -version=$(git describe --tags --abbrev=0) +version=${DOCKER_VERSION:-$(git describe --tags --abbrev=0)} rev_version=$(git rev-parse HEAD) if [ "x$2" = "xstaging" ] diff --git a/plugins/process-resources/src/components/ExecutonProgressPresenter.svelte b/plugins/process-resources/src/components/ExecutonProgressPresenter.svelte index 373c34bab0..739fa0d9a0 100644 --- a/plugins/process-resources/src/components/ExecutonProgressPresenter.svelte +++ b/plugins/process-resources/src/components/ExecutonProgressPresenter.svelte @@ -15,7 +15,9 @@