Split the build from release (#7945)

This commit is contained in:
Maurizio Vitale 2022-11-03 10:42:49 +00:00 committed by GitHub
parent 13fe6fb07a
commit 45159544a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 34 additions and 17 deletions

View File

@ -58,7 +58,7 @@ stages:
- name: Prerequisite - name: Prerequisite
- name: Setup - name: Setup
- name: "Build lib" - name: "Build lib"
if: tag IS blank if: tag IS blank AND type = pull_request
- name: "Trigger Alpha ADF child build" - name: "Trigger Alpha ADF child build"
if: (branch = develop AND (type = cron || type = api)) OR commit_message =~ /\[trigger adf\]/ if: (branch = develop AND (type = cron || type = api)) OR commit_message =~ /\[trigger adf\]/
- name: "Build Demo shell" - name: "Build Demo shell"
@ -107,10 +107,7 @@ jobs:
- stage: "Build lib" - stage: "Build lib"
name: "Lib::Build" name: "Lib::Build"
script: script: nx affected:build $NX_CALCULATION_FLAGS --prod --exclude="demoshell"
- ./scripts/travis/build/bumpversion.sh || travis_terminate 1
- nx affected:build $NX_CALCULATION_FLAGS --prod --exclude="demoshell"
- nx affected $NX_CALCULATION_FLAGS --target=pretheme
workspaces: workspaces:
create: create:
@ -176,17 +173,31 @@ jobs:
- stage: "Release" - stage: "Release"
name: "release::npm" name: "release::npm"
script: script:
- ./scripts/travis/build/bumpversion.sh || travis_terminate 1
- nx affected:build $NX_CALCULATION_FLAGS --prod --exclude="demoshell" || travis_terminate 1
- nx affected $NX_CALCULATION_FLAGS --target=pretheme || travis_terminate 1
- ./scripts/travis/release/release-npm.sh || travis_terminate 1 - ./scripts/travis/release/release-npm.sh || travis_terminate 1
workspaces: workspaces:
use: built_libs_cache use: node_modules_cache
- stage: "Release" - stage: "Release"
name: "release::docker" name: "release demoshell::docker"
script: script:
- . ./scripts/travis/release/docker-tag.sh - nx build demoshell --configuration production || travis_terminate 1
- ./scripts/travis/release/release-docker.sh - nx run stories:build-storybook --configuration ci || travis_terminate 1
- . ./scripts/travis/release/docker-tag.sh || travis_terminate 1
- ./scripts/travis/release/release-demoshell-docker.sh
workspaces: workspaces:
use: built_demo_shell_cache use: node_modules_cache
- stage: "Release"
name: "release storybook::docker"
script:
- nx run stories:build-storybook --configuration ci || travis_terminate 1
- . ./scripts/travis/release/docker-tag.sh || travis_terminate 1
- ./scripts/travis/release/release-storybook-docker.sh || travis_terminate 1
workspaces:
use: node_modules_cache
- stage: "Release tag" - stage: "Release tag"
script: ./scripts/travis/release/git-tag.sh script: ./scripts/travis/release/git-tag.sh

View File

@ -0,0 +1,13 @@
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR/../../../
echo " demo-shell: Running the docker with tag" $TAGS
DOCKER_PROJECT_ARGS="PROJECT_NAME=demo-shell"
# Publish Image to docker
./node_modules/@alfresco/adf-cli/bin/adf-cli docker --loginCheck --loginUsername "$DOCKER_REPOSITORY_USER" --loginPassword "$DOCKER_REPOSITORY_PASSWORD" --loginRepo "$DOCKER_REPOSITORY_DOMAIN" --dockerRepo "$DOCKER_REPOSITORY" --buildArgs "$DOCKER_PROJECT_ARGS" --dockerTags "$TAGS" --pathProject "$(pwd)"

View File

@ -3,13 +3,6 @@
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR/../../../ cd $DIR/../../../
echo " demo-shell: Running the docker with tag" $TAGS
DOCKER_PROJECT_ARGS="PROJECT_NAME=demo-shell"
# Publish Image to docker
./node_modules/@alfresco/adf-cli/bin/adf-cli docker --loginCheck --loginUsername "$DOCKER_REPOSITORY_USER" --loginPassword "$DOCKER_REPOSITORY_PASSWORD" --loginRepo "$DOCKER_REPOSITORY_DOMAIN" --dockerRepo "$DOCKER_REPOSITORY" --buildArgs "$DOCKER_PROJECT_ARGS" --dockerTags "$TAGS" --pathProject "$(pwd)"
echo " storybook-shell: Running the docker with tag" $TAGS echo " storybook-shell: Running the docker with tag" $TAGS
DOCKER_PROJECT_ARGS="PROJECT_NAME=storybook/stories" DOCKER_PROJECT_ARGS="PROJECT_NAME=storybook/stories"