feat: undeploy endpoints #17
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Verify Quartz migrations | |
on: | |
push: | |
branches: [ main ] | |
paths: | |
- 'backend/packagegroups/NuGet.props' | |
pull_request: | |
branches: [ main ] | |
types: [opened, synchronize, reopened] | |
paths: | |
- 'backend/**' | |
workflow_dispatch: | |
jobs: | |
check-quartz-update: | |
name: Check Quartz update | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Check if quartz library is updated | |
id: check-quartz-update | |
run: | | |
git fetch origin ${{ github.base_ref }} && git checkout ${{ github.base_ref }} | |
git fetch origin ${{ github.head_ref }} && git checkout ${{ github.head_ref }} | |
diff=$(git diff --unified=0 ${{ github.base_ref }}...${{ github.head_ref }} -- backend/packagegroups/NuGet.props | grep + | grep Quartz | grep Version) | |
if [ -n "$diff" ]; then | |
echo "is-updated=true" >> $GITHUB_OUTPUT | |
else | |
echo "is-updated=false" >> $GITHUB_OUTPUT | |
fi | |
- name: Notify if quartz library is updated | |
id: get-quartz-version | |
if: steps.check-quartz-update.outputs.is-updated == 'true' | |
run: | | |
version=$(git diff --unified=0 ${{ github.base_ref }}...${{ github.head_ref }} -- backend/packagegroups/NuGet.props | grep Quartz | grep Version | grep + | sed -n 's/.*Version="\([^"]*\)".*/\1/p') | |
echo "quartz-version=$version" >> $GITHUB_OUTPUT | |
- name: Verify tables sql is not updated | |
id: check-tables-update | |
if: steps.check-quartz-update.outputs.is-updated == 'true' | |
run: | | |
download_url=$(curl https://api.github.com/repos/quartznet/quartznet/releases/tags/v${{ steps.get-quartz-version.outputs.quartz-version }} | \ | |
jq -r '.assets[] | select(.name | contains("Quartz.NET-${{ steps.get-quartz-version.outputs.quartz-version }}.zip")) | .browser_download_url') | |
mkdir qdwn | |
curl -L -o qdwn/quartz.zip $download_url && unzip qdwn/quartz.zip -d qdwn && rm qdwn/quartz.zip | |
diff=$(diff -u backend/src/Designer/Migrations/SqlScripts/QuartzTables/tables_postgres.sql qdwn/database/tables/tables_postgres.sql) | |
echo "outputing diff" | |
echo $diff | |
echo "finished outputing diff" | |
echo "repo file: " | |
cat backend/src/Designer/Migrations/SqlScripts/QuartzTables/tables_postgres.sql | |
echo "end repo file" | |
echo "quartz file: " | |
cat qdwn/database/tables/tables_postgres.sql | |
echo "end quartz file" | |
if [ -n "$diff" ]; then | |
exit 1; | |
else | |
echo "Tables file is up to date" | |
fi | |