Skip to content

Commit

Permalink
chore(merge): 9.0.x into 10.0.x
Browse files Browse the repository at this point in the history
  • Loading branch information
bonita-ci committed Oct 11, 2024
2 parents 24e5ab3 + 256b8dd commit 1268df7
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion .github/workflows/_reusable_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,37 @@ jobs:
if: ${{ inputs.release }}
env:
GH_TOKEN: ${{ secrets.BONITA_CI_PAT }}
run: gh release upload ${{ inputs.ref }} ./target/bonita-user-application-${{ inputs.ref }}.bos --repo bonitasoft/bonita-user-application
run: gh release upload ${{ inputs.ref }} ./target/bonita-user-application-${{ inputs.ref }}.bos --repo bonitasoft/bonita-user-application

- name: Extract secrets from Keeper
if: ${{ inputs.release }}
uses: Keeper-Security/ksm-action@v1
with:
keeper-secret-config: ${{ secrets.KSM_CONFIG }}
secrets: |
${{ vars.KEEPER_BOS_REDIRECT_RECORD_ID }}/field/login > env:BOS_REDIRECT_USER
${{ vars.KEEPER_BOS_REDIRECT_RECORD_ID }}/field/password > env:BOS_REDIRECT_PSW
- name: Update BOS redirect table
if: ${{ inputs.release }}
env:
REDIRECT_ID: ${{ vars.BOS_REDIRECT_USER_APP_ID }}
BOS_REDIRECT_URL: https://redirect.bonitasoft.com/
BOS_RELEASE_ASSET_URL: https"%"3A"%"2F"%"2Fgithub.com%"2Fbonitasoft%"2Fbonita-user-application%"2Freleases%"2Fdownload%"2F${{ inputs.ref }}%"2Fbonita-user-application-${{ inputs.ref }}.bos
run: |
MAINTENANCE_VERSION="$(cut -d '.' -f3 <<< ${{ inputs.ref }})"
MAJOR_VERSION="$(cut -d '.' -f1,2 <<< ${{ inputs.ref }})"
STATUS_CODE=$(curl -s -o /dev/null -L -w "%{http_code}\\n" "$BOS_REDIRECT_URL" -u "$BOS_REDIRECT_USER:$BOS_REDIRECT_PSW" -H "Content-Type: application/x-www-form-urlencoded" --data "id=$REDIRECT_ID&product=bos&major_version=$MAJOR_VERSION&minor_version=$MAINTENANCE_VERSION&URL=$BOS_RELEASE_ASSET_URL&description=Bonita+User+App&submit=true")
if [ $STATUS_CODE!="200" ]
then
echo "Redirect entry for tuple ($REDIRECT_ID,$MAJOR_VERSION,$MAINTENANCE_VERSION) already exists. Performing update..."
STATUS_CODE=$(curl -s -o /dev/null -L -w "%{http_code}\\n" "$BOS_REDIRECT_URL" -u "$BOS_REDIRECT_USER:$BOS_REDIRECT_PSW" -H "Content-Type: application/x-www-form-urlencoded" --data "action=modify&id=$REDIRECT_ID&product=bos&major_version=$MAJOR_VERSION&minor_version=$MAINTENANCE_VERSION&URL=$BOS_RELEASE_ASSET_URL&description=Bonita+User+App&submit_modify=true")
if [ $STATUS_CODE!="200" ]
then
echo "Failed to update BOS redirect entry ($REDIRECT_ID,$MAJOR_VERSION,$MAINTENANCE_VERSION) with new URL: $BOS_RELEASE_ASSET_URL"
else
echo "BOS Redirect entry ($REDIRECT_ID,$MAJOR_VERSION,$MAINTENANCE_VERSION) updated with URL: $BOS_RELEASE_ASSET_URL"
fi
else
echo "BOS Redirect entry ($REDIRECT_ID,$MAJOR_VERSION,$MAINTENANCE_VERSION) created with URL: $BOS_RELEASE_ASSET_URL"
fi

0 comments on commit 1268df7

Please sign in to comment.