[ACS-4535] rework docker publishing actions (#3068)

* rework docker publishing actions

* simplify steps

* rollback AWS credentials
This commit is contained in:
Denys Vuika
2023-03-16 13:26:45 -04:00
committed by GitHub
parent f21299a90d
commit 36c5c39311
6 changed files with 50 additions and 44 deletions

View File

@@ -1,26 +0,0 @@
#!/bin/bash -e
DOMAIN="$1"
REPO_SLUG="$2"
USERNAME="$3"
PASSWORD="$4"
TAG_VERSION="$5"
BRANCH_NAME="$6"
DRY_RUN="$7"
npm ci && npm run build.release
echo "Running the docker with tag" $TAG_VERSION
DOCKER_PROJECT_ARGS="PROJECT_NAME=content-ce"
DOCKER_REPOSITORY="$DOMAIN/$REPO_SLUG"
# Publish Image to quay.io or dockerhub or another domain - only publish the version on master - elsewhere version and branch
if [[ "$BRANCH_NAME" == "master" ]]; then
if [[ "$DRY_RUN" != "true" ]]; then
npx @alfresco/adf-cli docker-publish --loginCheck --loginUsername "$USERNAME" --loginPassword "$PASSWORD" --loginRepo "$DOMAIN" --dockerRepo "$DOCKER_REPOSITORY" --buildArgs "$DOCKER_PROJECT_ARGS" --dockerTags "$TAG_VERSION" --pathProject "$(pwd)"
fi;
else
if [[ "$DRY_RUN" != "true" ]]; then
npx @alfresco/adf-cli docker-publish --loginCheck --loginUsername "$USERNAME" --loginPassword "$PASSWORD" --loginRepo "$DOMAIN" --dockerRepo "$DOCKER_REPOSITORY" --buildArgs "$DOCKER_PROJECT_ARGS" --dockerTags "$TAG_VERSION,$BRANCH_NAME" --pathProject "$(pwd)"
fi;
fi;