From e5fa50fe6e234929093c3a7433137728d764305c Mon Sep 17 00:00:00 2001 From: Colin Kennedy Date: Sat, 2 Sep 2023 07:41:26 -0300 Subject: [PATCH 1/2] write to .env.development.local... temporary workaround for #258 --- .github/workflows/deploy-express.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy-express.yml b/.github/workflows/deploy-express.yml index f9ab28b5..fb06ddd9 100644 --- a/.github/workflows/deploy-express.yml +++ b/.github/workflows/deploy-express.yml @@ -39,13 +39,13 @@ jobs: rsync -rl ./packages/express/assets/ ${{ secrets.DO_USERNAME }}@eduquilt.com:/home/skuilder/dist/express/${{github.SHA}}/assets ssh ${{ secrets.DO_USERNAME }}@eduquilt.com ln -sfn /home/skuilder/dist/express/${{github.SHA}} /home/skuilder/api - ssh ${{ secrets.DO_USERNAME }}@eduquilt.com rm /home/skuilder/.env.production + ssh ${{ secrets.DO_USERNAME }}@eduquilt.com rm /home/skuilder/.env.development.local - ssh -t ${{ secrets.DO_USERNAME }}@eduquilt.com 'echo VERSION=${{ github.SHA }} >> /home/skuilder/.env.production' - ssh -t ${{ secrets.DO_USERNAME }}@eduquilt.com 'echo COUCHDB_ADMIN=${{ secrets.COUCHDB_ADMIN }} >> /home/skuilder/.env.production' - ssh -t ${{ secrets.DO_USERNAME }}@eduquilt.com 'echo COUCHDB_PASSWORD=${{ secrets.COUCHDB_PASSWORD }} >> /home/skuilder/.env.production' - ssh -t ${{ secrets.DO_USERNAME }}@eduquilt.com 'echo COUCHDB_PROTOCOL=${{ secrets.COUCHDB_PROTOCOL }} >> /home/skuilder/.env.production' - ssh -t ${{ secrets.DO_USERNAME }}@eduquilt.com 'echo COUCHDB_SERVER=${{ secrets.COUCHDB_SERVER }} >> /home/skuilder/.env.production' + ssh -t ${{ secrets.DO_USERNAME }}@eduquilt.com 'echo VERSION=${{ github.SHA }} >> /home/skuilder/.env.development.local' + ssh -t ${{ secrets.DO_USERNAME }}@eduquilt.com 'echo COUCHDB_ADMIN=${{ secrets.COUCHDB_ADMIN }} >> /home/skuilder/.env.development.local' + ssh -t ${{ secrets.DO_USERNAME }}@eduquilt.com 'echo COUCHDB_PASSWORD=${{ secrets.COUCHDB_PASSWORD }} >> /home/skuilder/.env.development.local' + ssh -t ${{ secrets.DO_USERNAME }}@eduquilt.com 'echo COUCHDB_PROTOCOL=${{ secrets.COUCHDB_PROTOCOL }} >> /home/skuilder/.env.development.local' + ssh -t ${{ secrets.DO_USERNAME }}@eduquilt.com 'echo COUCHDB_SERVER=${{ secrets.COUCHDB_SERVER }} >> /home/skuilder/.env.development.local' ssh -t ${{ secrets.DO_USERNAME }}@eduquilt.com 'echo ${{ secrets.DO_PASSWORD }} | sudo -S systemctl restart eqExpress' # todo: toss a buildinfo.md file into the (ecount+1) folder, linking PR, listing time, logging build errors, etc From 30f57d445a9bf6a663d24403017bfecd5b6f9618 Mon Sep 17 00:00:00 2001 From: Colin Kennedy Date: Sat, 2 Sep 2023 07:44:31 -0300 Subject: [PATCH 2/2] add a success/fail check on deployment --- .github/workflows/deploy-express.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/deploy-express.yml b/.github/workflows/deploy-express.yml index fb06ddd9..13671951 100644 --- a/.github/workflows/deploy-express.yml +++ b/.github/workflows/deploy-express.yml @@ -48,4 +48,14 @@ jobs: ssh -t ${{ secrets.DO_USERNAME }}@eduquilt.com 'echo COUCHDB_SERVER=${{ secrets.COUCHDB_SERVER }} >> /home/skuilder/.env.development.local' ssh -t ${{ secrets.DO_USERNAME }}@eduquilt.com 'echo ${{ secrets.DO_PASSWORD }} | sudo -S systemctl restart eqExpress' + + sleep 10s + + if curl eduquilt.com/express | grep -q ${{ github.SHA }}; then + echo "Success. Current version found in production" + exit 0 + else + echo "Error! Current version not reported by production." + exit 1 + fi # todo: toss a buildinfo.md file into the (ecount+1) folder, linking PR, listing time, logging build errors, etc