From 8cea49270ee893adf1a94b53fd8f911a5dc71b57 Mon Sep 17 00:00:00 2001 From: Jeroen Knoops Date: Wed, 31 Aug 2022 12:49:35 +0200 Subject: [PATCH] Add deprecation warning for DOCKER_USERNAME and DOCKER_PASSWORD Signed-off-by: Jeroen Knoops --- CHANGELOG.md | 15 +++++++++++---- entrypoint.sh | 17 ++++++++++++++++- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e3e42b..3ffbefc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,13 @@ and this project uses the version of main tool as main version number . ## [Unreleased] +- Rename arguments to reflect multiple container registries. + +### DEPRECATION + +- `DOCKER_USERNAME`, `DOCKER_PASSWORD`, and `DOCKER_REGISTRY` are deprecated. Please use `REGISTRY_USERNAME`, `REGISTRY_TOKEN`, and `REGISTRY_URL`. + +## v4.4.0 - [#50] - Fix: Automatic push of README to docker hub is broken. - [#48] - Loop through entire array of push-branches - [#34] - ** BREAKING ** Rename variables DOCKER_USERNAME, DOCKER_PASSWORD and DOCKER_REGISTRY @@ -22,7 +29,7 @@ and this project uses the version of main tool as main version number . - Allow users to specify specific dockerfile instead of path The `docker build` command is now being called from the root of the project -instead of the directory. +instead of the directory. This has impact when your project has: - Directories with multiple dockerfiles @@ -31,15 +38,15 @@ This has impact when your project has: You now need to change the path to include the directory. Example: -- `ADD /scripts/entrypoint.sh entrypoint.sh` becomes: `ADD /6/java/scripts/entrypoint.sh entrypoint` +- `ADD /scripts/entrypoint.sh entrypoint.sh` becomes: `ADD /6/java/scripts/entrypoint.sh entrypoint` ## v2.2.1 - 2020-05-18 ### Changed -- [#38] - Auto update readme was not working anymore +- [#38] - Auto update readme was not working anymore ## v2.2.0 - [#33] - DOCKER_ORGANIZATION is optional when other repository store is used. -- [#32] - DOCKER_REGISTRY should be an environment variable. +- [#32] - DOCKER_REGISTRY should be an environment variable. - Fix shellinter ### Add diff --git a/entrypoint.sh b/entrypoint.sh index c3f625e..ea6a8f1 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -52,8 +52,23 @@ if [ -z "$6" ] then export PUSH_BRANCHES="$4" else - echo "DEPRECATION WARNING: push-branch will be replaced by push-branches" + echo "DEPRECATION WARNING: push-branch will be replaced by push-branches. Please update scripts." >> "$GITHUB_STEP_SUMMARY" export PUSH_BRANCHES="$6" fi +if [ -n "${DOCKER_USERNAME}" ]; then + echo "DEPRECATION WARNING: DOCKER_USERNAME will be replaced by REGISTRY_USERNAME in the next release. Please update scripts." >> "$GITHUB_STEP_SUMMARY" + export REGISTRY_USERNAME="${DOCKER_USERNAME}" +fi + +if [ -n "${DOCKER_PASSWORD}" ]; then + echo "DEPRECATION WARNING: DOCKER_PASSWORD will be replaced by REGISTRY_TOKEN in the next release. Please update scripts." >> "$GITHUB_STEP_SUMMARY" + export REGISTRY_TOKEN="${DOCKER_PASSWORD}" +fi + +if [ -n "${DOCKER_REGISTRY}" ]; then + echo "DEPRECATION WARNING: DOCKER_REGISTRY will be replaced by REGISTRY_URL in the next release. Please update scripts." >> "$GITHUB_STEP_SUMMARY" + export REGISTRY_URL="${DOCKER_REGISTRY} +fi + "${FOREST_DIR}"/docker_build_and_push.sh "$1" "$2" "$5" "$3"