ACA-4526 Alfresco Content Application Docker Images are not available in Docker Hub from 2.3.0 (#2346)

* Publish images to dockerhub when pushing to master in addition to the tag
* Change Travis stage name to reflect both tasks 
* Split Travis stage into two jobs
This commit is contained in:
Alan Davis
2021-11-09 13:52:02 +00:00
committed by Denys Vuika
parent 9a6eae836d
commit 95273260c2
2 changed files with 17 additions and 8 deletions

View File

@@ -32,7 +32,7 @@ stages:
if: type = cron || type = pull_request
- name: Publish Docker Registry
if: type = push
- name: Release Tag
- name: Release Tag and Publish to Dockerhub
if: branch = master AND type = push
- name: e2e
if: type = cron || type = pull_request
@@ -198,11 +198,15 @@ jobs:
- stage: Publish Docker Registry
name: Publish Docker Registry
script: ./scripts/travis/deploy/publish.sh "app"
script: ./scripts/travis/deploy/publish.sh "app" "$DOCKER_REPOSITORY_DOMAIN" "$QUAY_USERNAME" "$QUAY_PASSORD"
- stage: Release Tag
- stage: Release Tag and Publish to Dockerhub
name: Release Tag
script: ./scripts/travis/release/git-tag.sh
- name: Publish to Dockerhub
script: ./scripts/travis/deploy/publish.sh "app" "$DOCKER_HUB_REPOSITORY_DOMAIN" "$DOCKER_HUB_USERNAME" "$DOCKER_HUB_PASSWORD"
- stage: Trigger DW
script: ./scripts/trigger-travis.sh --pro --branch $TRAVIS_BRANCH Alfresco alfresco-digital-workspace-app $TRAVIS_ACCESS_TOKEN

View File

@@ -1,7 +1,11 @@
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
PROJECT_AFFECTED=$1
PROJECT_AFFECTED="$1"
DOMAIN="$2"
USERNAME="$3"
PASSWORD="$4"
cd $DIR/../../../
npm ci && npm run build.release
@@ -10,7 +14,8 @@ npm ci && npm run build.release
TAG_VERSION=$(./scripts/travis/deploy/get-docker-image-tag-name.sh)
echo "Running the docker with tag" $TAG_VERSION
DOCKER_PROJECT_ARGS="PROJECT_NAME=$PROJECT_AFFECTED"
DOCKER_REPOSITORY="$DOCKER_REPOSITORY_DOMAIN/$REPO_SLUG"
# Publish Image to docker
echo "npx @alfresco/adf-cli docker-publish --loginCheck --loginUsername '$QUAY_USERNAME' --loginPassword '$QUAY_PASSWORD' --loginRepo '$DOCKER_REPOSITORY_DOMAIN' --dockerRepo '$DOCKER_REPOSITORY' --buildArgs $DOCKER_PROJECT_ARGS --dockerTags '$TAG_VERSION,$TRAVIS_BRANCH' "
npx @alfresco/adf-cli docker-publish --loginCheck --loginUsername "$QUAY_USERNAME" --loginPassword "$QUAY_PASSWORD" --loginRepo "$DOCKER_REPOSITORY_DOMAIN" --dockerRepo "$DOCKER_REPOSITORY" --buildArgs "$DOCKER_PROJECT_ARGS" --dockerTags "$TAG_VERSION,$TRAVIS_BRANCH" --pathProject "$(pwd)"
DOCKER_REPOSITORY="$DOMAIN/$REPO_SLUG"
# Publish Image to quay.io or dockerhub or another domain
echo "npx @alfresco/adf-cli docker-publish --loginCheck --loginUsername '$USERNAME' --loginPassword '$PASSWORD' --loginRepo '$DOMAIN' --dockerRepo '$DOCKER_REPOSITORY' --buildArgs $DOCKER_PROJECT_ARGS --dockerTags '$TAG_VERSION,$TRAVIS_BRANCH' "
npx @alfresco/adf-cli docker-publish --loginCheck --loginUsername "$USERNAME" --loginPassword "$PASSWORD" --loginRepo "$DOMAIN" --dockerRepo "$DOCKER_REPOSITORY" --buildArgs "$DOCKER_PROJECT_ARGS" --dockerTags "$TAG_VERSION,$TRAVIS_BRANCH" --pathProject "$(pwd)"