AAE-11940 - fix upstream flow - update-project script and upstream trigger (#8125)

* fix conflict

* fix conflict

* fix conflict

* change pipe name

* change PR name env variable

* update PR title

* fix pr condition

* fix pr condition

* final check
This commit is contained in:
Maurizio Cacace 2023-01-12 12:04:19 +01:00 committed by GitHub
parent f6fd813a29
commit fe65f7c201
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 7 deletions

View File

@ -1,4 +1,4 @@
name: "alpha-adf" name: "upstream adf"
on: on:
workflow_call: workflow_call:
@ -20,7 +20,7 @@ env:
TRAVIS_COMMIT: ${{ github.sha }} TRAVIS_COMMIT: ${{ github.sha }}
BUILD_ID: ${{ github.run_id }} BUILD_ID: ${{ github.run_id }}
TRAVIS_RUN_NUMBER: ${{ github.run_attempt }} TRAVIS_RUN_NUMBER: ${{ github.run_attempt }}
TRAVIS_BUILD_NUMBER: github-run-${{ github.run_id }} TRAVIS_BUILD_NUMBER: ${{ github.run_id }}
JOB_ID: ${{ github.run_id }} JOB_ID: ${{ github.run_id }}
PROXY_HOST_BPM: ${{ secrets.E2E_HOST }} PROXY_HOST_BPM: ${{ secrets.E2E_HOST }}
E2E_HOST_APA: ${{ secrets.E2E_HOST_APA }} E2E_HOST_APA: ${{ secrets.E2E_HOST_APA }}
@ -58,7 +58,7 @@ env:
jobs: jobs:
trigger_adf: trigger_adf:
name: trigger adf test name: trigger adf
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout repository - name: Checkout repository
@ -73,7 +73,8 @@ jobs:
- 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 12 * * *' }} if: ${{ contains(github.event.head_commit.message, '[trigger adf]') || inputs.cluster_operation == 'TRIGGER_ALPHA_ADF' || github.event.schedule == '0 12 * * *' }}
run: | run: |
pull_number=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")
npm install github-api npm install github-api
./scripts/travis/update/update-project.sh -p $TRAVIS_BUILD_NUMBER -t $GH_TOKEN -v alpha -c $TRAVIS_COMMIT ./scripts/travis/update/update-project.sh -p $TRAVIS_BUILD_NUMBER -t $GH_TOKEN -v alpha -c $TRAVIS_COMMIT

View File

@ -7,7 +7,10 @@ on:
description: 'enable dry-run on artifact push' description: 'enable dry-run on artifact push'
required: false required: false
type: boolean type: boolean
default: true default: true
push:
branches:
- AAE-12046-pr-condition
pull_request: pull_request:
types: [opened, synchronize, reopened] types: [opened, synchronize, reopened]
branches: branches:
@ -66,7 +69,8 @@ env:
jobs: jobs:
setup: setup:
# long timeout required when cache has to be recreated
# long timeout required when cache has to be recreated
timeout-minutes: 30 timeout-minutes: 30
name: "Setup" name: "Setup"
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04

View File

@ -75,6 +75,7 @@ update_js_dependency() {
update() { update() {
NAME_REPO=$1 NAME_REPO=$1
PKG_VERSION=$(npm view $PKG@$VERSION version)
echo "Update dependencies $NAME_REPO" echo "Update dependencies $NAME_REPO"
git clone https://$TOKEN@github.com/Alfresco/$NAME_REPO.git $TEMP_GENERATOR_DIR git clone https://$TOKEN@github.com/Alfresco/$NAME_REPO.git $TEMP_GENERATOR_DIR
@ -106,7 +107,7 @@ update() {
git push --force origin $BRANCH_TO_CREATE git push --force origin $BRANCH_TO_CREATE
fi fi
node $BUILD_PIPELINE_DIR/pr-creator.js --token=$TOKEN --title="Update branch for ADF ${PR_NUMBER} and JS-API ${JS_API_INSTALLED} [ci:force]" --head=$BRANCH_TO_CREATE --repo=$NAME_REPO --commit=$COMMIT node $BUILD_PIPELINE_DIR/pr-creator.js --token=$TOKEN --title="Update branch for ADF ${PKG_VERSION} and JS-API ${JS_API_INSTALLED} [ci:force]" --head=$BRANCH_TO_CREATE --repo=$NAME_REPO --commit=$COMMIT
cd .. cd ..
rm -rf $TEMP_GENERATOR_DIR rm -rf $TEMP_GENERATOR_DIR