From ba7acba020edb464818142bc28b6c00baa0f4c22 Mon Sep 17 00:00:00 2001 From: Samuel John Date: Mon, 1 Jan 2024 12:49:45 +0100 Subject: [PATCH] fix for run.sh --- .github/workflows/deploy.yml | 22 ---------------------- ops/sh/app.sh | 4 ++-- ops/sh/run.sh | 8 ++++---- 3 files changed, 6 insertions(+), 28 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 26e84f2..70e7eb6 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -128,18 +128,7 @@ jobs: echo -e "$NGX" > vhost.conf tr -d '\r' < vhost.conf > vhost_fixed.conf mv vhost_fixed.conf vhost.conf - echo -e "This is create-nginx-vhost step:\n\nI was here at $(date)" > ngx.txt scp -o "StrictHostKeyChecking=no" -r vhost.conf "$HOST_USER@$HOST_URL:$GA_ENV_DEST" - scp -o "StrictHostKeyChecking=no" -r ngx.txt "$HOST_USER@$HOST_URL:$GA_ENV_DEST" - # - name: copy file via ssh key - # uses: appleboy/scp-action@v0.1.6 - # with: - # host: ${{ secrets.HOST_URL }} - # username: ${{ secrets.HOST_USER }} - # port: 22 - # key: ${{ secrets.HOST_SSH_KEY }} - # source: "vhost.conf,ngx.txt" - # target: $GA_ENV_DEST - name: Create Nginx vhost env: GA_NGX_PROXY: ${{ secrets.GA_NGX_PROXY }} @@ -254,18 +243,7 @@ jobs: - name: Copy envfile run: | # Copy .env file into deploy server - echo -e "This is deploy-app ga step speaking\n\nI was here at $(date)" > v.txt scp -o "StrictHostKeyChecking=no" -r "$GA_ENV_SRC/$GA_ENV_FILE" "$HOST_USER@$HOST_URL:$GA_ENV_DEST" - scp -o "StrictHostKeyChecking=no" -r v.txt "$HOST_USER@$HOST_URL:$GA_ENV_DEST" - # - name: copy envfile - # uses: appleboy/scp-action@v0.1.6 - # with: - # host: ${{ secrets.HOST_URL }} - # username: ${{ secrets.HOST_USER }} - # port: 22 - # key: ${{ secrets.HOST_SSH_KEY }} - # source: "$GA_ENV_SRC/$GA_ENV_FILE,v.txt" - # target: $GA_ENV_DEST - name: Deploy app run: | ssh -T -o "StrictHostKeyChecking=no" "$HOST_USER@$HOST_URL" \ diff --git a/ops/sh/app.sh b/ops/sh/app.sh index fe5bb5d..13e9db2 100755 --- a/ops/sh/app.sh +++ b/ops/sh/app.sh @@ -231,7 +231,7 @@ docker_build() { case "$dkr_build" in yes|Y|y) echo -e "${GREEN}Building $DK_IMAGE image${RESET}" - docker build -t $DK_IMAGE -f $DL_DFILE . + docker build -t $DK_IMAGE -f $DK_FILE . docker images | grep $DL_IU/$DL_IN ;; no|N|n) @@ -881,7 +881,7 @@ create_nginx_vhost() { # Remove temporary files echo -e "\nRemoving temporary files..." rm -f "$temp_file" - #rm -f "$ngxx" + rm -f "$ngxx" } # function to deploy app diff --git a/ops/sh/run.sh b/ops/sh/run.sh index b1edbf9..626d1f8 100755 --- a/ops/sh/run.sh +++ b/ops/sh/run.sh @@ -11,7 +11,7 @@ # Based on https://gist.github.com/2206527 # load .env -source ./.env +# source ./.env # laravel things laravel() { @@ -26,10 +26,10 @@ laravel() { nodejs() { echo "\033[31mInstalling dependencies\033[0m" # for development - if [ "$NODE_ENV" == "development"] + if [ "$NODE_ENV" == "development"]; then npm install # for production - elif [ "$NODE_ENV" == "production" ] + elif [ "$NODE_ENV" == "production" ]; then npm ci --only=production else echo "Nodejs NODE_ENV variable not defined" @@ -45,7 +45,7 @@ supervisor() { # run -if ["$DL_STACK" == "laravel" ]; then +if [ "$DL_STACK" == "laravel" ]; then laravel supervisor elif [ "$DL_STACK" == "nodejs" ]; then