From b9edd5780b9b782f0a23c1a8e890c4b8f557c74f Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Wed, 8 Mar 2023 21:48:59 +0000 Subject: [PATCH] remove travis remains --- .eslintignore | 1 - .github/actions/publish-image/action.yml | 2 +- .github/workflows/aca-upstream.yml | 17 ++-- app/project.metadata.json | 33 -------- docs/extending/publish-to-npm.md | 24 +++--- e2e/e2e-config/utils/build-number.js | 6 +- scripts/app-config-replace.js | 75 ----------------- scripts/ci/job_hooks/after_e2e.sh | 7 -- scripts/ci/job_hooks/before-playwright.sh | 3 - scripts/ci/job_hooks/before_e2e.sh | 48 ----------- scripts/ci/job_hooks/before_install.sh | 42 ---------- scripts/ci/jobs/affected-project-with.sh | 44 ---------- scripts/ci/jobs/check-link-adf.sh | 5 -- scripts/ci/npm/publish-libs.sh | 83 ------------------- scripts/ci/partials/_adf-linking.sh | 22 ----- scripts/ci/utils/artifact-from-s3.sh | 31 ------- scripts/ci/utils/artifact-to-s3.sh | 27 ------ .../publish.sh => gh/docker-publish.sh} | 0 .../update/aca-same-commit-verify.js | 0 scripts/{travis => gh}/update/pr-creator.js | 0 .../{travis => gh}/update/update-project.sh | 0 .../deploy/get-docker-image-tag-name.sh | 9 -- scripts/travis/release/git-tag.sh | 14 ---- scripts/trigger-travis.sh | 62 -------------- 24 files changed, 28 insertions(+), 527 deletions(-) delete mode 100644 app/project.metadata.json delete mode 100755 scripts/app-config-replace.js delete mode 100755 scripts/ci/job_hooks/after_e2e.sh delete mode 100755 scripts/ci/job_hooks/before-playwright.sh delete mode 100755 scripts/ci/job_hooks/before_e2e.sh delete mode 100755 scripts/ci/job_hooks/before_install.sh delete mode 100755 scripts/ci/jobs/affected-project-with.sh delete mode 100755 scripts/ci/jobs/check-link-adf.sh delete mode 100755 scripts/ci/npm/publish-libs.sh delete mode 100755 scripts/ci/partials/_adf-linking.sh delete mode 100755 scripts/ci/utils/artifact-from-s3.sh delete mode 100755 scripts/ci/utils/artifact-to-s3.sh rename scripts/{travis/deploy/publish.sh => gh/docker-publish.sh} (100%) rename scripts/{travis => gh}/update/aca-same-commit-verify.js (100%) rename scripts/{travis => gh}/update/pr-creator.js (100%) rename scripts/{travis => gh}/update/update-project.sh (100%) delete mode 100755 scripts/travis/deploy/get-docker-image-tag-name.sh delete mode 100755 scripts/travis/release/git-tag.sh delete mode 100755 scripts/trigger-travis.sh diff --git a/.eslintignore b/.eslintignore index 8086db99d4..fd26184f59 100644 --- a/.eslintignore +++ b/.eslintignore @@ -3,7 +3,6 @@ e2e-output dist coverage .github -.travis .vscode scripts app/src/assets/i18n diff --git a/.github/actions/publish-image/action.yml b/.github/actions/publish-image/action.yml index 233e3aa61c..143ae936d9 100644 --- a/.github/actions/publish-image/action.yml +++ b/.github/actions/publish-image/action.yml @@ -37,4 +37,4 @@ runs: echo "TAG_VERSION=$TAG_VERSION" >> $GITHUB_ENV - name: Publish image shell: bash - run: ./scripts/travis/deploy/publish.sh "${{ inputs.domain }}" "$REPO_SLUG" "${{ inputs.username }}" "${{ inputs.password }}" "$TAG_VERSION" "${{ inputs.branch_name }}" "${{ inputs.dry-run }}" + run: ./scripts/gh/docker-publish.sh "${{ inputs.domain }}" "$REPO_SLUG" "${{ inputs.username }}" "${{ inputs.password }}" "$TAG_VERSION" "${{ inputs.branch_name }}" "${{ inputs.dry-run }}" diff --git a/.github/workflows/aca-upstream.yml b/.github/workflows/aca-upstream.yml index 991ac2a028..7908825431 100644 --- a/.github/workflows/aca-upstream.yml +++ b/.github/workflows/aca-upstream.yml @@ -15,31 +15,34 @@ on: default: alfresco-applications env: GH_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }} - TRAVIS_COMMIT: ${{ github.sha }} - TRAVIS_BUILD_NUMBER: ${{ github.run_id }} + GH_COMMIT: ${{ github.sha }} + GH_BUILD_NUMBER: ${{ github.run_id }} NODE_OPTIONS: "--max-old-space-size=5120" jobs: trigger_aca_upstream: - name: Trigger ACA upstream + name: Trigger ACA Upstream runs-on: ubuntu-latest steps: - - name: Checkout repository + - name: Checkout Repository uses: actions/checkout@v3 with: fetch-depth: 0 - - name: install NPM + + - name: Setup Node.js uses: actions/setup-node@v3 with: node-version-file: '.nvmrc' cache: 'npm' + - uses: Alfresco/alfresco-build-tools/.github/actions/configure-git-author@v1.35.0 with: username: ${{ vars.BOT_GITHUB_USERNAME }} email: ${{ vars.BOT_GITHUB_EMAIL }} global: true - - name: Trigger upstream + + - name: Trigger Upstream shell: bash run: | npm install github-api - ./scripts/travis/update/update-project.sh -p $TRAVIS_BUILD_NUMBER -t $GH_TOKEN -v alpha -c $TRAVIS_COMMIT -r ${{ inputs.repo_to_update || 'alfresco-applications' }} + ./scripts/gh/update/update-project.sh -p $GH_BUILD_NUMBER -t $GH_TOKEN -v alpha -c $GH_COMMIT -r ${{ inputs.repo_to_update || 'alfresco-applications' }} diff --git a/app/project.metadata.json b/app/project.metadata.json deleted file mode 100644 index a000231b72..0000000000 --- a/app/project.metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "standalone": { - "projectRoot": ".." - }, - "deploy": { - "releaseVersion": "", - "tagAliases": [], - "tagVersionSuffix": "" - }, - "scripts": { - "prebuild": [ - { - "command": "./scripts/local/check-for-extra-node-modules" - }, - { - "command": "mkdir", - "args": [ - "-p", - "$THIS_PROJECT_ROOT_PATH/.tmp" - ] - }, - { - "command": "cp", - "args": [ - "$THIS_PROJECT_SOURCE_ROOT_PATH/app.config.json.tpl", - "$THIS_PROJECT_ROOT_PATH/.tmp/app.config.json" - ] - } - ], - "postinstall": [ - ] - } -} \ No newline at end of file diff --git a/docs/extending/publish-to-npm.md b/docs/extending/publish-to-npm.md index d61ebff8c4..d7f31dc5cc 100644 --- a/docs/extending/publish-to-npm.md +++ b/docs/extending/publish-to-npm.md @@ -2,36 +2,40 @@ Title: Publish to npm --- -# Create a new library +## Create a new library New library can be created using standard `ng` command e.g. if we would like to create `aca-new-lib` we need to run the following: -``` +```sh ng generate @schematics/angular:library aca-new-lib ``` -# Publish library +## Publish library + + +### Build library -## Build library In order to publish new library, we need to build it first. You need to add build of your library to `build-libs` command in `package.json` -``` +```sh "build-libs": "ng build aca-shared && ng build aca-new-lib", ``` -## Update publish script -If we would like to publish the new library we need to update `scripts/ci/npm/publish-libs.sh` +### Update publish script + +If we would like to publish the new library we need to update `scripts/gh/npm-publish.sh` The only thing that need to be done is to update `PROJECTS` variable by adding your library name i.e. -``` +```sh PROJECTS=( 'aca-shared', 'aca-new-lib' ); ``` -# Caveats + +## Caveats + - The versions of libraries are updated automatically by the script (should not be done manually) -- In travis setting you can find `PUBLISH_PROJECTS` variable, which can be used for enabling dry mode when running the publish command diff --git a/e2e/e2e-config/utils/build-number.js b/e2e/e2e-config/utils/build-number.js index 0b2cb9f572..b4e7f31ffe 100644 --- a/e2e/e2e-config/utils/build-number.js +++ b/e2e/e2e-config/utils/build-number.js @@ -1,10 +1,10 @@ const buildNumber = () => { - let buildNumber = process.env.TRAVIS_BUILD_NUMBER; + let buildNumber = process.env.GH_BUILD_NUMBER; if (!buildNumber) { - process.env.TRAVIS_BUILD_NUMBER = Date.now(); + process.env.GH_BUILD_NUMBER = Date.now(); } - return process.env.TRAVIS_BUILD_NUMBER; + return process.env.GH_BUILD_NUMBER; } module.exports = buildNumber; diff --git a/scripts/app-config-replace.js b/scripts/app-config-replace.js deleted file mode 100755 index 652d20b51a..0000000000 --- a/scripts/app-config-replace.js +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/env node - -const program = require('commander'); -require('dotenv').config({ path: process.env.ENV_FILE }); -const fs = require('fs'); - -const APP_CONFIG_ECM_HOST = process.env.APP_CONFIG_ECM_HOST; -const APP_CONFIG_BPM_HOST = process.env.APP_CONFIG_BPM_HOST; -const APP_CONFIG_OAUTH2_HOST = process.env.APP_CONFIG_OAUTH2_HOST || 'oauth-host-default-replaced-value'; -const APP_CONFIG_IDENTITY_HOST = process.env.APP_CONFIG_IDENTITY_HOST || 'identity-host-default-replaced-value'; -const APP_CONFIG_NOTIFICATION_LAST = parseInt(process.env.APP_CONFIG_NOTIFICATION_LAST, 10) || 2000; -const APP_CONFIG_PLUGIN_AOS = process.env.APP_CONFIG_PLUGIN_AOS || true; - -const options = { - apiHost: { - flags: '-a, --api-host', - description: - 'set bpmHost=APP_CONFIG_BPM_HOST, ecmHost=APP_CONFIG_ECM_HOST, aosHost = APP_CONFIG_ECM_HOST if present', - set: (appConfig) => { - appConfig.bpmHost = APP_CONFIG_BPM_HOST; - appConfig.ecmHost = APP_CONFIG_ECM_HOST; - appConfig.baseShareUrl = appConfig.baseShareUrl.replace('{protocol}//{hostname}{:port}', APP_CONFIG_ECM_HOST); - appConfig.aosHost = appConfig.aosHost.replace('{protocol}//{hostname}{:port}', APP_CONFIG_ECM_HOST); - } - }, - identityHost: { - flags: '-i, --identity-host', - description: "set identityHost's value with APP_CONFIG_IDENTITY_HOST", - set: (appConfig) => { - appConfig.authType = 'OAUTH'; - appConfig.identityHost = APP_CONFIG_IDENTITY_HOST; - } - }, - oauthHost: { - flags: '-o, --oauth-host', - description: "set oauth2.host's value with APP_CONFIG_OAUTH2_HOST", - set: (appConfig) => { - appConfig.authType = 'OAUTH'; - appConfig.oauth2.host = APP_CONFIG_OAUTH2_HOST; - } - }, - notification: { - flags: '-n, --notification', - description: "set notificationDefaultDuration's value with and switch on showNotificationHistory", - set: (appConfig) => { - appConfig.showNotificationHistory = true; - appConfig.notificationDefaultDuration = APP_CONFIG_NOTIFICATION_LAST; - } - } -}; - -program.version('0.0.1').requiredOption('-c, --config ', 'path to the app.config.json to reset its values with env vars'); - -Object.keys(options).forEach((option) => { - program.option(options[option].flags, options[option].description); -}); - -program.parse(process.argv); - -fs.readFile(program.config, (err, appConfigString) => { - if (err) { - throw err; - } - - const appConfig = JSON.parse(appConfigString); - - Object.keys(options).forEach((option) => { - if (program[option]) { - options[option].set(appConfig); - } - }); - - const appConfigReplacedJson = JSON.stringify(appConfig, null, 4); - fs.writeFileSync(program.config, appConfigReplacedJson); -}); diff --git a/scripts/ci/job_hooks/after_e2e.sh b/scripts/ci/job_hooks/after_e2e.sh deleted file mode 100755 index ce23663a4d..0000000000 --- a/scripts/ci/job_hooks/after_e2e.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -storage_dir="./storage-state/AdminUserState.json" -rm -rf $storage_dir - -# Upload protractor-smartrunner artifact related to this particular job to S3 -./scripts/ci/utils/artifact-to-s3.sh -a "$SMART_RUNNER_DIRECTORY" -o "$S3_DBP_FOLDER/protractor-smartrunner-$TRAVIS_JOB_ID.tar.bz2" diff --git a/scripts/ci/job_hooks/before-playwright.sh b/scripts/ci/job_hooks/before-playwright.sh deleted file mode 100755 index 435aaf6706..0000000000 --- a/scripts/ci/job_hooks/before-playwright.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -npx playwright install chromium diff --git a/scripts/ci/job_hooks/before_e2e.sh b/scripts/ci/job_hooks/before_e2e.sh deleted file mode 100755 index ed0be41450..0000000000 --- a/scripts/ci/job_hooks/before_e2e.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env bash - -# --------------------------------------------------------------- -# Validating replaced app.config.json -# --------------------------------------------------------------- -app_config_checker(){ - APP_CONFIG_FILE_PATH=$1; - - echo -n " \_ Validating replaced config file ... "; - $(npm bin)/ajv validate -s ./node_modules/@alfresco/adf-core/app.config.schema.json -d $APP_CONFIG_FILE_PATH --errors=text --verbose || exit 4 - - if grep -E -q '\$\{[A-Z0-9_]*\}' $APP_CONFIG_FILE_PATH; then - echo -e "\e[31m \_ ERROR: Variables are still present in the app.config.json file. Some of them might not have default value set.\e[0m"; - exit 5; - fi -} - -FROM=$1; -TO=$2; -PARAMS=$3; - -echo "====== Check content UP =====" - -./node_modules/@alfresco/adf-cli/bin/adf-cli check-cs-env --host "$APP_CONFIG_ECM_HOST" -u "$ADMIN_EMAIL" -p "$ADMIN_PASSWORD" || exit 1 - -echo "====== Download artifacts =====" -# Download built application artifact from S3 -./scripts/ci/utils/artifact-from-s3.sh -a "$FROM" -o "$TO" - -APP_CONFIG_FILE_PATH="$TO/app.config.json" -EXTRA_ENV_SETTINGS="" -# Replace variables in app.config.json -envsub $EXTRA_ENV_SETTINGS --all $APP_CONFIG_FILE_PATH $APP_CONFIG_FILE_PATH || exit 1 - -app_config_checker $APP_CONFIG_FILE_PATH - -# Download protractor-smartrunner artifact related to this particular job from S3, if exists -./scripts/ci/utils/artifact-from-s3.sh -a "$S3_DBP_FOLDER/protractor-smartrunner-$TRAVIS_JOB_ID.tar.bz2" -o "$SMART_RUNNER_DIRECTORY" - -echo "====== Update webdriver-manager =====" -if [ "$CI" = "true" ]; then - export chrome=$(google-chrome --product-version) - echo "Updating wedriver-manager with chromedriver: $chrome." - webdriver-manager update --gecko=false --versions.chrome=$chrome -else - echo "Updating wedriver-manager with latest chromedriver, be sure to use evergreen Chrome." - webdriver-manager update --gecko=false -fi diff --git a/scripts/ci/job_hooks/before_install.sh b/scripts/ci/job_hooks/before_install.sh deleted file mode 100755 index acae315040..0000000000 --- a/scripts/ci/job_hooks/before_install.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env bash -PARENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )" -# Build and test options ----------------------------------------------------------------------- -export BUILD_OPTS="--configuration=production,e2e" -export TEST_OPTS="" -export E2E_PROTRACTOR_OPTS="" -export E2E_TSCONFIG="tsconfig.e2e.json" - -# Commit settings for ADF linking ----------------------------------------------------- -export HEAD_COMMIT_HASH=${TRAVIS_PULL_REQUEST_SHA:-${TRAVIS_COMMIT}} -export COMMIT_MESSAGE=`git log --format=%B -n 1 $HEAD_COMMIT_HASH` - -# Settings for Angular builder -------------------------------------------------------- -export NODE_OPTIONS="--max_old_space_size=30000" - -# Settings for protractor-smartrunner ------------------------------------------------- -export GIT_HASH=`git rev-parse HEAD` -export SMART_RUNNER_DIRECTORY=".protractor-smartrunner" - -# Settings for Nx --------------------------------------------------------------------- -export BASE_HASH="$(git describe --tags `git rev-list --tags --max-count=1`)" -export HEAD_HASH="HEAD" - -# Settings for S3 caching ------------------------------------------------------------- -pip install --user awscli -S3_DBP_PATH="s3://alfresco-travis-builds/aca" -if [ "${TRAVIS_EVENT_TYPE}" == "push" ]; then - export S3_DBP_ROOT_FOLDER="$S3_DBP_PATH/$TRAVIS_BRANCH" -elif [ "${TRAVIS_EVENT_TYPE}" == "pull_request" ]; then - export S3_DBP_ROOT_FOLDER="$S3_DBP_PATH/$TRAVIS_PULL_REQUEST" - export BASE_HASH="origin/$TRAVIS_BRANCH" - source $PARENT_DIR/partials/_adf-linking.sh -elif [ "${TRAVIS_EVENT_TYPE}" == "cron" ]; then - export S3_DBP_ROOT_FOLDER="$S3_DBP_PATH/cron" -else - export S3_DBP_ROOT_FOLDER="$S3_DBP_PATH/api" -fi -export S3_DBP_FOLDER="$S3_DBP_ROOT_FOLDER/$TRAVIS_BUILD_ID" - -echo "BASE_HASH: $BASE_HASH" -echo "S3 DBP root folder: $S3_DBP_ROOT_FOLDER" -echo "S3 DBP destination: $S3_DBP_FOLDER" diff --git a/scripts/ci/jobs/affected-project-with.sh b/scripts/ci/jobs/affected-project-with.sh deleted file mode 100755 index 77e6395404..0000000000 --- a/scripts/ci/jobs/affected-project-with.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env bash -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -show_help() { - echo "Usage: affected-filtered-project.sh" - echo "" - echo "-target Project target" - echo "-tag Filter project with tag" - echo "-name Filter project with name" - echo "-test-runner Test runner to use (playwright or protractor)" -} - -project_target(){ - PROJECT_TARGET=$1 -} - -target_options(){ - OPTIONS="$1" -} - -test_runner(){ - TEST_RUNNER=$1 -} - -while [[ $1 == -* ]]; do - case "$1" in - -target) project_target $2; shift 2;; - -options) target_options $2; shift 2;; - -test-runner) test_runner $2; shift 2;; - -*) echo "invalid option: $1" 1>&2; show_help; exit 0;; - esac -done - -./node_modules/.bin/tsc -p "./e2e/$E2E_TSCONFIG" || exit 1; -./node_modules/.bin/http-server -c-1 $CONTENT_CE_DIST_PATH -p 4200 > /dev/null &\ - -if [ "$TEST_RUNNER" == "playwright" ]; then - echo "Running playwright tests with options $OPTIONS" - npx playwright test --config $OPTIONS -else - echo "Running protractor tests with options $OPTIONS" - echo "./node_modules/.bin/protractor \"./protractor.conf.js\" $OPTIONS || exit 1" - ./node_modules/.bin/protractor "./protractor.conf.js" $OPTIONS $E2E_PROTRACTOR_OPTS || exit 1 -fi diff --git a/scripts/ci/jobs/check-link-adf.sh b/scripts/ci/jobs/check-link-adf.sh deleted file mode 100755 index fd99cf8c13..0000000000 --- a/scripts/ci/jobs/check-link-adf.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -BRANCH=`echo $COMMIT_MESSAGE | grep -o "\[link-adf\:[^]]*\]" | sed -e 's#\[link-adf:##g' | sed -e 's#\]##g'` -echo -e "\e[31mPRs are not mergeable with conditional build. This build was run with custom ADF branch: $BRANCH \e[0m" -exit 1 diff --git a/scripts/ci/npm/publish-libs.sh b/scripts/ci/npm/publish-libs.sh deleted file mode 100755 index 5dfbed5217..0000000000 --- a/scripts/ci/npm/publish-libs.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/env bash - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -ROOT_DIR=${DIR}/../../.. -DIST_DIR=${ROOT_DIR}/dist/@alfresco -PROJECTS_DIR=${ROOT_DIR}/projects - -DRY_RUN="" -if [ "$PUBLISH_PROJECTS" = "false" ]; then - DRY_RUN=true - echo "PUBLISH_PROJECTS is set to false, run in dry mode" -fi - -VERSION_IN_PACKAGE_JSON=`node -p "require('$ROOT_DIR/package.json')".version;`; - -if [[ $TRAVIS_BRANCH =~ ^master.*?$ ]] ; then - NEW_LIBRARY_VERSION=VERSION_IN_PACKAGE_JSON -else - NEW_LIBRARY_VERSION="${VERSION_IN_PACKAGE_JSON}-${TRAVIS_BUILD_NUMBER}" -fi - -if [[ $TRAVIS_BRANCH =~ ^master(-patch.*)?$ ]] -then - # Pre-release versions - if [[ $VERSION_IN_PACKAGE_JSON =~ ^[0-9]*\.[0-9]*\.[0-9]*-A\.[0-9]*$ ]]; - then - TAG_NPM=next - # Stable major versions - else - TAG_NPM=latest - fi -fi - -if [[ $TRAVIS_BRANCH =~ ^develop(-patch.*)?$ ]] -then - TAG_NPM=alpha -fi - -echo -e "Branch is '$TRAVIS_BRANCH', therefore publish with '$TAG_NPM' tag\n" - -PROJECTS=( - 'aca-shared' - 'aca-folder-rules' - 'adf-office-services-ext' - 'aca-about' - 'aca-preview' - 'aca-viewer' - 'aca-content' -); - -for PROJECT in "${PROJECTS[@]}" -do - echo "Update ${PROJECT} version to ${NEW_LIBRARY_VERSION}" - - cd $PROJECTS_DIR/${PROJECT} - npm version ${NEW_LIBRARY_VERSION}; -done - -echo -e "\n\nBuild projects" -cd ${ROOT_DIR} - -npm run build-libs - -for PROJECT in "${PROJECTS[@]}" -do - cd $DIST_DIR/${PROJECT} - - if [ "$DRY_RUN" = "true" ] ; then - echo -e "Publish with dry mode for project: $PROJECT\n" - echo -e "npm publish --dry-run --tag $TAG_NPM \n" - - npm publish --dry-run --tag $TAG_NPM - else - echo -e "======== Publishing project: $PROJECT ========\n" - echo -e "npm publish --tag $TAG_NPM\n" - - echo 'strict-ssl=true' >> .npmrc - echo 'registry=https://${NPM_REGISTRY_ADDRESS}' >> .npmrc - echo '//${NPM_REGISTRY_ADDRESS}/:_authToken="${NPM_REGISTRY_TOKEN}"' >> .npmrc - - npm publish --tag $TAG_NPM - fi -done diff --git a/scripts/ci/partials/_adf-linking.sh b/scripts/ci/partials/_adf-linking.sh deleted file mode 100755 index c24f317893..0000000000 --- a/scripts/ci/partials/_adf-linking.sh +++ /dev/null @@ -1,22 +0,0 @@ -# Note no #!/bin/sh as this should not spawn -# an extra shell, since this partial shell script -# is supposed to be invoked as part of another. -# --------------------------------------------------------------- -# ADF linking -# --------------------------------------------------------------- -if [[ $COMMIT_MESSAGE == *"[link-adf:"* ]]; then - export BUILD_OPTS="--configuration=adfprod,e2e" - export TEST_OPTS="--configuration=adfprod" - export E2E_PROTRACTOR_OPTS="--with-local-adf" - export E2E_TSCONFIG="tsconfig.e2e.adf.json" - BRANCH=`echo $COMMIT_MESSAGE | grep -o "\[link-adf\:[^]]*\]" | sed -e 's#\[link-adf:##g' | sed -e 's#\]##g'` - echo "Checking out ADF's branch: ${BRANCH}" && \ - git clone https://github.com/Alfresco/alfresco-ng2-components.git --depth=1 --branch ${BRANCH} ../alfresco-ng2-components - # ADF theming needs it the styling - CWD=`pwd` - cd ../alfresco-ng2-components - npm install @angular/material - cd $CWD -else - echo -e "\e[32mUsing ADF from installed node_modules.\e[0m" -fi ; diff --git a/scripts/ci/utils/artifact-from-s3.sh b/scripts/ci/utils/artifact-from-s3.sh deleted file mode 100755 index 9b3f664d93..0000000000 --- a/scripts/ci/utils/artifact-from-s3.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash - -show_help() { - echo "Usage: artifact-from-s3.sh " - echo "" - echo "-a or --artifact [mandatory]: path to the s3 artifact (tar.bz2) to download and extract" - echo "-o or --output [mandatory]: directory to extract the archive to" -} - -while [[ $1 == -* ]]; do - case "$1" in - -h|--help|-\?) show_help; exit 0;; - -a|--artifact) ARTIFACT=$2; shift 2;; - -o|--output) OUTPUT=$2; shift 2;; - -*) shift;; - esac -done - -if [ "${ARTIFACT}" == "" ] || [ "${OUTPUT}" == "" ] -then - show_help; - exit 1 -fi - -test ! -d $OUTPUT && mkdir -p $OUTPUT -aws s3 cp $ARTIFACT ./s3-artifact.tmp -echo 'artifact download done' -tar -xvf ./s3-artifact.tmp -C $OUTPUT >&/dev/null -echo 'tar the artifact done' -rm ./s3-artifact.tmp -echo 'remove tmp file' diff --git a/scripts/ci/utils/artifact-to-s3.sh b/scripts/ci/utils/artifact-to-s3.sh deleted file mode 100755 index 523bb528d3..0000000000 --- a/scripts/ci/utils/artifact-to-s3.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash - -show_help() { - echo "Usage: artifact-to-s3.sh " - echo "" - echo "-a or --artifact [mandatory]: path to the artifact to archieve (tar.bz2) and upload (like ./dist)" - echo "-o or --output [mandatory]: the S3 object to copy it to, like: s3://bucket-name/folder/whatever.tar.bz2" -} - -while [[ $1 == -* ]]; do - case "$1" in - -h|--help|-\?) show_help; exit 0;; - -a|--artifact) ARTIFACT=$2; shift 2;; - -o|--output) OUTPUT=$2; shift 2;; - -*) shift;; - esac -done - -if [ "${ARTIFACT}" == "" ] || [ "${OUTPUT}" == "" ] -then - show_help; - exit 1 -fi - -tar cvfj ./s3-artifact.tmp -C $ARTIFACT `ls $ARTIFACT` -aws s3 cp ./s3-artifact.tmp $OUTPUT -rm ./s3-artifact.tmp diff --git a/scripts/travis/deploy/publish.sh b/scripts/gh/docker-publish.sh similarity index 100% rename from scripts/travis/deploy/publish.sh rename to scripts/gh/docker-publish.sh diff --git a/scripts/travis/update/aca-same-commit-verify.js b/scripts/gh/update/aca-same-commit-verify.js similarity index 100% rename from scripts/travis/update/aca-same-commit-verify.js rename to scripts/gh/update/aca-same-commit-verify.js diff --git a/scripts/travis/update/pr-creator.js b/scripts/gh/update/pr-creator.js similarity index 100% rename from scripts/travis/update/pr-creator.js rename to scripts/gh/update/pr-creator.js diff --git a/scripts/travis/update/update-project.sh b/scripts/gh/update/update-project.sh similarity index 100% rename from scripts/travis/update/update-project.sh rename to scripts/gh/update/update-project.sh diff --git a/scripts/travis/deploy/get-docker-image-tag-name.sh b/scripts/travis/deploy/get-docker-image-tag-name.sh deleted file mode 100755 index 46d8d7991e..0000000000 --- a/scripts/travis/deploy/get-docker-image-tag-name.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -if [[ $TRAVIS_BRANCH == "master" ]]; then - TAG_VERSION=$(grep -m1 version package.json | awk '{ print $2 }' | sed 's/[", ]//g') -else - TAG_VERSION=$TRAVIS_BRANCH-$TRAVIS_BUILD_NUMBER -fi; - -echo $TAG_VERSION; diff --git a/scripts/travis/release/git-tag.sh b/scripts/travis/release/git-tag.sh deleted file mode 100755 index de546ca4e8..0000000000 --- a/scripts/travis/release/git-tag.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -if [[ $TRAVIS_BRANCH == "master" ]]; then - VERSION=$(grep -m1 version package.json | awk '{ print $2 }' | sed 's/[", ]//g') -fi; - -echo "git tag -a ${VERSION} -m ${VERSION}" -git config --local user.name "alfresco-build" -git config --local user.email "build@alfresco.com" -git tag -a ${VERSION} -m "${VERSION} [ci skip] " -git remote rm origin -GITHUB_REPO=https://$GITHUB_TOKEN:x-oauth-basic@github.com/Alfresco/alfresco-content-app.git -git remote add origin $GITHUB_REPO -git push origin --tags diff --git a/scripts/trigger-travis.sh b/scripts/trigger-travis.sh deleted file mode 100755 index 4a126ea0ff..0000000000 --- a/scripts/trigger-travis.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/sh -f - -# Trigger a new Travis-CI job. - -# Usage: -# trigger-travis.sh [--branch BRANCH] GITHUBID GITHUBPROJECT TRAVIS_API_TOKEN [MESSAGE] -# For example: -# trigger-travis.sh typetools checker-framework `cat ~/private/.travis-access-token` "Trigger for testing" -if [ "$#" -lt 3 ] || [ "$#" -ge 7 ]; then - echo "Wrong number of arguments $# to trigger-travis.sh; run like:" - echo " trigger-travis.sh [--branch BRANCH] GITHUBID GITHUBPROJECT TRAVIS_API_TOKEN [MESSAGE]" >&2 - exit 1 -fi - -if [ "$1" = "--branch" ] ; then - shift - BRANCH="$1" - shift -else - BRANCH=master -fi - -USER=$1 -REPO=$2 -TOKEN=$3 -if [ $# -eq 4 ] ; then - MESSAGE=",\"message\": \"$4\"" -elif [ -n "$TRAVIS_REPO_SLUG" ] ; then - MESSAGE=",\"message\": \"Triggered by ACA upstream [affected:content-ee,content-ee-apa]\"" -else - MESSAGE="" -fi -## For debugging: -# echo "USER=$USER" -# echo "REPO=$REPO" -# echo "TOKEN=$TOKEN" -# echo "MESSAGE=$MESSAGE" - -body="{ -\"request\": { - \"branch\":\"$BRANCH\" - $MESSAGE -}}" - -# "%2F" creates a literal "/" in the URL, that is not interpreted as a -# segment or directory separator. -curl -s -X POST \ - -H "Content-Type: application/json" \ - -H "Accept: application/json" \ - -H "Travis-API-Version: 3" \ - -H "Authorization: token ${TOKEN}" \ - -d "$body" \ - https://api.travis-ci.com/repo/${USER}%2F${REPO}/requests \ - | tee /tmp/travis-request-output.$$.txt - -if grep -q '"@type": "error"' /tmp/travis-request-output.$$.txt; then - exit 1 -fi -if grep -q 'access denied' /tmp/travis-request-output.$$.txt; then - exit 1 -fi -