AAE-11940 - fix alpha adf test in cron workflow (#8113)

* AAE-11940 add env variable to alpha test

* fix adf test output

* fix adf test output

* fix module dependency

* fix update-project script output

* fix update-project script output

* fix update-project script output

* fix update-project script output

* fix update-project script output

* fix update-project script output

* fix update-project script output

* adding a dry-run mode for adf alpha test script

* add dry-run and set cron at 12:00

* change tag sha action

* change tag sha action

* change tag sha action

* remove check bundle from cron workflow

* adjust cron
This commit is contained in:
Maurizio Cacace 2023-01-10 16:51:11 +01:00 committed by GitHub
parent c2ff725f0c
commit a564176cb7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 17 deletions

View File

@ -15,6 +15,7 @@ env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
GITHUB_BRANCH: ${{ github.ref_name }} GITHUB_BRANCH: ${{ github.ref_name }}
GH_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
TRAVIS_BUILD_DIR: ${{ github.workspace }} TRAVIS_BUILD_DIR: ${{ github.workspace }}
TRAVIS_COMMIT: ${{ github.sha }} TRAVIS_COMMIT: ${{ github.sha }}
BUILD_ID: ${{ github.run_id }} BUILD_ID: ${{ github.run_id }}
@ -66,6 +67,8 @@ jobs:
fetch-depth: 0 fetch-depth: 0
- name: Trigger Alpha ADF child build - name: Trigger Alpha ADF child build
shell: bash shell: bash
if: ${{ contains(github.event.head_commit.message, '[trigger adf]') || inputs.cluster_operation == 'TRIGGER_ALPHA_ADF' || github.event.schedule == '0 0 1 * *' }} if: ${{ contains(github.event.head_commit.message, '[trigger adf]') || inputs.cluster_operation == 'TRIGGER_ALPHA_ADF' || github.event.schedule == '0 11 * * *' }}
run: ./scripts/travis/update/update-project.sh -p $TRAVIS_BUILD_NUMBER -t $GITHUB_TOKEN -v alpha -c $TRAVIS_COMMIT run: |
npm install github-api
./scripts/travis/update/update-project.sh -p $TRAVIS_BUILD_NUMBER -t $GH_TOKEN -v alpha -c $TRAVIS_COMMIT -d

View File

@ -2,7 +2,7 @@ name: "cron schedule"
on: on:
schedule: schedule:
- cron: '0 0 1 * *' - cron: '0 11 * * *'
env: env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
@ -54,14 +54,6 @@ jobs:
uses: ./.github/workflows/pull-request.yml uses: ./.github/workflows/pull-request.yml
secrets: inherit secrets: inherit
npm-check-bundle:
timeout-minutes: 10
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
- uses: ./.github/actions/npm-check-bundle
adf-alpha-test: adf-alpha-test:
name: trigger alpha test name: trigger alpha test
uses: ./.github/workflows/adf_alpha.yml uses: ./.github/workflows/adf_alpha.yml

View File

@ -10,6 +10,7 @@ TEMP_GENERATOR_DIR=".tmp-generator";
BRANCH_TO_CREATE="update-alfresco-dependencies" BRANCH_TO_CREATE="update-alfresco-dependencies"
TOKEN="" TOKEN=""
PR_NUMBER="" PR_NUMBER=""
DRY_RUN="false"
show_help() { show_help() {
echo "Usage: create-updatebranch.sh" echo "Usage: create-updatebranch.sh"
@ -17,7 +18,7 @@ show_help() {
echo "-t or --token: Github ouath token" echo "-t or --token: Github ouath token"
echo "-p or --pr: Originating jsapi PR number" echo "-p or --pr: Originating jsapi PR number"
echo "-v or --version version to update" echo "-v or --version version to update"
echo "-c or --commit The commit that the current build is testing" echo "-d or --dry-run: The script won't execute critical operation, just simulate them"
} }
set_token() { set_token() {
@ -36,6 +37,12 @@ set_commit() {
COMMIT=$1 COMMIT=$1
} }
set_dryrun() {
DRY_RUN="true"
}
update_dependency() { update_dependency() {
PKG=$1 PKG=$1
PKG_VERSION=$(npm view $PKG@$VERSION version) PKG_VERSION=$(npm view $PKG@$VERSION version)
@ -112,6 +119,7 @@ while [[ $1 == -* ]]; do
-p|--pr) set_pr $2; shift; shift;; -p|--pr) set_pr $2; shift; shift;;
-v|--version) version $2; shift 2;; -v|--version) version $2; shift 2;;
-c|--commit) set_commit $2; shift 2;; -c|--commit) set_commit $2; shift 2;;
-d|--dry-run) set_dryrun $2; shift; shift;;
-*) echo "invalid option: $1" 1>&2; show_help; exit 1;; -*) echo "invalid option: $1" 1>&2; show_help; exit 1;;
esac esac
done done
@ -133,9 +141,13 @@ isSameADFSha=$(node $BUILD_PIPELINE_DIR/adf-same-commit-verify.js --token=$TOKEN
if [ "$isSameADFSha" = 'true' ]; then if [ "$isSameADFSha" = 'true' ]; then
echo 'ADF sha is the same. No need to create another pr' echo 'ADF sha is the same. No need to create another pr'
else else
if [ "$DRY_RUN" = "false" ]; then
update "generator-alfresco-adf-app" update "generator-alfresco-adf-app"
update "alfresco-content-app" update "alfresco-content-app"
update "alfresco-apps" update "alfresco-apps"
else
echo "[dry-run] it would have update repos: 'generator-alfresco-adf-app', 'alfresco-content-app' and 'alfresco-apps'"
fi
fi fi