From cc90248ab1ca1b9b1b277f75e0b48548d27f5664 Mon Sep 17 00:00:00 2001 From: Jo Basevi Date: Fri, 16 Aug 2024 14:01:21 +1000 Subject: [PATCH] Add verbose to rsync logs and create directory for deployment --- .github/workflows/deploy.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 8104b01..1b6e14f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -107,29 +107,27 @@ jobs: - name: Create deployment directory on ${{ matrix.deployment-environment }} run: | ssh ${{ secrets.USER }}@${{ secrets.HOST }} -i ${{ steps.ssh.outputs.private-key-path }} /bin/bash <<'EOT' + mkdir -p ${{env.DEPLOYMENT_LOCATION}} if [ $? -ne 0 ]; then exit $? fi - mkdir -p $(dirname ${{env.DEPLOYMENT_LOCATION}}) EOT - name: Copy to ${{ matrix.deployment-environment }} run: | - rsync -e 'ssh -i ${{ steps.ssh.outputs.private-key-path }}' \ + rsync -v -e 'ssh -i ${{ steps.ssh.outputs.private-key-path }}' \ ${{ env.NAME }}-${{ env.VERSION }}.tar.gz \ ${{ secrets.USER }}@${{ secrets.HOST_DATA }}:${{ vars.ENVIRONMENT_DIR }} - name: Deploy to ${{ matrix.deployment-environment }} run: | ssh ${{ secrets.USER }}@${{ secrets.HOST }} -i ${{ steps.ssh.outputs.private-key-path }} /bin/bash <<'EOT' - if [ $? -ne 0 ]; then - exit $? - fi tar -xzf ${{ vars.ENVIRONMENT_DIR }}/${{ env.NAME }}-${{ env.VERSION }}.tar.gz -C ${{ env.DEPLOYMENT_LOCATION }} source ${{ env.DEPLOYMENT_LOCATION }}/bin/activate conda-unpack source ${{ env.DEPLOYMENT_LOCATION }}/bin/deactivate - rm -r ${{ vars.ENVIRONMENT_DIR }}/${{ env.NAME }}-${{ env.VERSION }}.tar.gz + # TODO: Uncomment below line - just keeping environment for debugging + # rm -r ${{ vars.ENVIRONMENT_DIR }}/${{ env.NAME }}-${{ env.VERSION }}.tar.gz ln -s ${{ vars.MODULE_DIR }}/modules/conda/.common ${{ vars.MODULE_DIR }}/modules/conda/${{ env.NAME }}-${{ env.VERSION }} EOT