diff --git a/.travis.yml b/.travis.yml index 66296070f4..0f6ce4740b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -58,7 +58,7 @@ stages: - name: Prerequisite - name: Setup - name: "Build lib" - if: tag IS blank + if: tag IS blank AND type = pull_request - name: "Trigger Alpha ADF child build" if: (branch = develop AND (type = cron || type = api)) OR commit_message =~ /\[trigger adf\]/ - name: "Build Demo shell" @@ -107,10 +107,7 @@ jobs: - stage: "Build lib" name: "Lib::Build" - script: - - ./scripts/travis/build/bumpversion.sh || travis_terminate 1 - - nx affected:build $NX_CALCULATION_FLAGS --prod --exclude="demoshell" - - nx affected $NX_CALCULATION_FLAGS --target=pretheme + script: nx affected:build $NX_CALCULATION_FLAGS --prod --exclude="demoshell" workspaces: create: @@ -176,17 +173,31 @@ jobs: - stage: "Release" name: "release::npm" 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 workspaces: - use: built_libs_cache + use: node_modules_cache - stage: "Release" - name: "release::docker" + name: "release demoshell::docker" script: - - . ./scripts/travis/release/docker-tag.sh - - ./scripts/travis/release/release-docker.sh + - nx build demoshell --configuration production || travis_terminate 1 + - 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: - 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" script: ./scripts/travis/release/git-tag.sh diff --git a/scripts/travis/release/release-demoshell-docker.sh b/scripts/travis/release/release-demoshell-docker.sh new file mode 100755 index 0000000000..32c179220f --- /dev/null +++ b/scripts/travis/release/release-demoshell-docker.sh @@ -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)" + + diff --git a/scripts/travis/release/release-docker.sh b/scripts/travis/release/release-storybook-docker.sh similarity index 58% rename from scripts/travis/release/release-docker.sh rename to scripts/travis/release/release-storybook-docker.sh index 6d18676a73..3db41ea843 100755 --- a/scripts/travis/release/release-docker.sh +++ b/scripts/travis/release/release-storybook-docker.sh @@ -3,13 +3,6 @@ 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)" - echo "ℹ️ storybook-shell: Running the docker with tag" $TAGS DOCKER_PROJECT_ARGS="PROJECT_NAME=storybook/stories"