Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Commit

Permalink
[AAE-9334] Improve update project script (#1395)
Browse files Browse the repository at this point in the history
  • Loading branch information
pmartinezga authored Jun 27, 2022
1 parent a7fc2e9 commit 8240936
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions scripts/update-project.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,13 @@ cd $TEMP_GENERATOR_DIR
git fetch

# Checkout branch if exist, otherwise create it
git checkout $BRANCH_TO_CREATE 2>/dev/null || git checkout -b $BRANCH_TO_CREATE origin/develop
BRANCH_CREATED=false
if git checkout $BRANCH_TO_CREATE 2>/dev/null ; then
git reset --hard origin/develop
else
BRANCH_CREATED=true
git checkout -b $BRANCH_TO_CREATE origin/develop
fi

JS_VERSION=$(npm view @alfresco/js-api@$VERSION version)

Expand All @@ -79,7 +85,11 @@ done

git add .
git commit -n -m "[ci:force][auto-commit] Update JS-API to $JS_VERSION for branch: $BRANCH_TO_CREATE originated from JS-API PR: $JSAPI_PR_NUMBER"
git push origin $BRANCH_TO_CREATE
if [ "$BRANCH_CREATED" = true ]; then
git push origin $BRANCH_TO_CREATE
else
git push --force origin $BRANCH_TO_CREATE
fi

node $BUILD_PIPELINE_DIR/pr-creator.js --token=$TOKEN --title="Update branch for JS-API PR#$JSAPI_PR_NUMBER" --head=$BRANCH_TO_CREATE --repo=alfresco-ng2-components

Expand Down

0 comments on commit 8240936

Please sign in to comment.