diff --git a/.travis.yml b/.travis.yml index 010a964292..4cbe771738 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,19 +41,20 @@ branches: stages: - name: Setup - if: branch != master AND (type = cron || type = pull_request) AND tag IS blank - name: "Build lib" - if: branch != master AND (type = cron || type = pull_request) AND tag IS blank + if: tag IS blank - name: "Check bundle" - if: branch != master AND type = cron AND tag IS blank + if: type = push AND tag IS blank - name: "Trigger Alpha ADF child build" if: branch = develop AND type = cron - - name: "Build" - if: branch != master AND (type = cron || type = pull_request) AND tag IS blank + - name: "Build Demo shell and Unit test Lib" + if: branch != master AND tag IS blank - name: "e2e Test" - if: branch != master AND (type = cron || type = pull_request) AND tag IS blank + if: branch != master AND tag IS blank - name: "Release tag" if: branch = master + - name: "Deprecate develop builds" + if: branch = master addons: chrome: stable @@ -95,7 +96,7 @@ jobs: workspaces: use: node_modules_cache - - stage: "Build" + - stage: "Build Demo shell and Unit test Lib" name: "Demo Shell :Build && dockerize" script: # Build Demo shell for production docker" @@ -109,25 +110,25 @@ jobs: use: - built_libs_cache - - stage: "Build" + - stage: "Build Demo shell and Unit test Lib" name: "content::unit" script: ./scripts/travis/unit-test/content.sh workspaces: use: built_libs_cache - - stage: "Build" + - stage: "Build Demo shell and Unit test Lib" name: "core-extension::unit" script: ./scripts/travis/unit-test/core-extension.sh workspaces: use: built_libs_cache - - stage: "Build" + - stage: "Build Demo shell and Unit test Lib" name: "process-insights::unit" script: ./scripts/travis/unit-test/process.sh workspaces: use: built_libs_cache - - stage: "Build" + - stage: "Build Demo shell and Unit test Lib" name: "process-cloud::unit" script: ./scripts/travis/unit-test/process-cloud.sh workspaces: @@ -142,6 +143,9 @@ jobs: - stage: "Release tag" script: ./scripts/travis/release/git-tag.sh + - stage: "Deprecate develop builds" + script: ./scripts/travis/release/deprecate-develop-build.sh -v ${ADF_VERSION} + - stage: "e2e Test" name: "Core" before_script: diff --git a/scripts/travis/release/deprecate-develop-build.sh b/scripts/travis/release/deprecate-develop-build.sh new file mode 100755 index 0000000000..8c54c4886b --- /dev/null +++ b/scripts/travis/release/deprecate-develop-build.sh @@ -0,0 +1,68 @@ +#!/usr/bin/env bash + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +eval VERSION="" + +eval projects=( "adf-core" + "adf-insights" + "adf-content-services" + "adf-extensions" + "adf-testing" + "adf-process-services" + "adf-process-services-cloud" ) + +show_help() { + echo "Usage: deprecate-develop-build.sh" + echo "-v or -version to check -v 1.4.0 " + echo "" +} + +set_npm_registry() { + npm set registry https://registry.npmjs.org/ +} + +version() { + if [[ $1 == "" ]]; + then + echo "You need to add a version" + exit 1 + fi + + VERSION=$1 +} + +while [[ $1 == -* ]]; do + case "$1" in + -h|--help|-\?) show_help; exit 0;; + -v|--version) version $2; shift 2;; + -*) echo "invalid option: $1" 1>&2; show_help; exit 1;; + esac +done + + +if [[ $VERSION == "" ]]; +then + echo "You need to add a version" +fi + +for PACKAGE in ${projects[@]} +do +echo "@alfresco/$PACKAGE" + + for VERSION_TO_DEPRECATE in $(npm view "@alfresco/$PACKAGE" versions --json | jq -r '.[] | select( . | contains("-")) | select( . | contains("'$VERSION'"))') + do + deprecated=$(npm view "@alfresco/$PACKAGE@$VERSION_TO_DEPRECATE" -json | jq '.deprecated') + + if [[ $deprecated != null ]]; + then + echo "Already deprecated @alfresco/$PACKAGE@$VERSION_TO_DEPRECATE" + else + echo "Deprecate alpha/beta version @alfresco/$PACKAGE@$VERSION_TO_DEPRECATE" + npm deprecate "@alfresco/$PACKAGE@$VERSION_TO_DEPRECATE" "Upgrade to @latest or $VERSION" + fi + + done + +done + diff --git a/scripts/travis/update/pr-creator.js b/scripts/travis/update/pr-creator.js index 5489c28856..1768085803 100644 --- a/scripts/travis/update/pr-creator.js +++ b/scripts/travis/update/pr-creator.js @@ -35,8 +35,6 @@ async function main() { .option('-title, --title [type]', 'title') .parse(process.argv); - console.log('process.argv ', program); - const { token, title, head, repo } = program, prCreator = new PrCreator(ORGANISATION, repo, token); @@ -49,10 +47,15 @@ async function main() { main() .then(prNumber => { + console.log("======= PR Created ========="); + console.log(prNumber) process.exit(0); }) .catch(error => { - console.error(error); + + console.error("======= Impossible create PR ========="); + console.error(error.response.status); + console.error(error.response.statusText); process.exit(1); });