From 06c5c31cd65a631167207c5dbc5a9210f18c24b8 Mon Sep 17 00:00:00 2001 From: Destiny Saturday Date: Mon, 29 Jul 2024 03:09:02 +0100 Subject: [PATCH 1/5] Update dev_deploy.sh Signed-off-by: Destiny Saturday --- scripts/dev_deploy.sh | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/scripts/dev_deploy.sh b/scripts/dev_deploy.sh index 829383e3d..2e7f92f3c 100755 --- a/scripts/dev_deploy.sh +++ b/scripts/dev_deploy.sh @@ -1,23 +1,8 @@ #!/bin/bash -if [ "$#" -ne 1 ]; then - echo "Usage: $0 {next|remix}" - exit 1 -fi - -if [ "$1" == "next" ]; then - cd /home/nextjs/dev/hng_boilerplate_nextjs - git pull origin dev - docker compose -f docker/development/docker-compose.yml build - docker compose -f docker/development/docker-compose.yml up -d -elif [ "$1" == "remix" ]; then - cd /home/remixjs/dev/hng_boilerplate_remix - git pull origin dev - docker compose -f docker/development/docker-compose.yml build - docker compose -f docker/development/docker-compose.yml up -d -else - echo "Invalid argument. Use 'next' or 'remix'." - echo "Usage: $0 {next|remix}" - exit 1 -fi +set -e +cd "$(git rev-parse --show-toplevel)" +git pull origin dev +docker pull hngdevops/nextjs-boilerplate:dev +docker compose --project-name dev-nextjs -f docker/development/docker-compose.yml up -d From 2be7e234aa8a7f1a4f77829952e1e2562dae21e3 Mon Sep 17 00:00:00 2001 From: Destiny Saturday Date: Mon, 29 Jul 2024 03:10:27 +0100 Subject: [PATCH 2/5] Update build-and-push.yml Signed-off-by: Destiny Saturday --- .github/workflows/build-and-push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-push.yml b/.github/workflows/build-and-push.yml index a1e55b444..9df933681 100644 --- a/.github/workflows/build-and-push.yml +++ b/.github/workflows/build-and-push.yml @@ -6,7 +6,7 @@ on: - dev jobs: - docker: + build_and_push: runs-on: ubuntu-latest steps: - name: Checkout From 6d5f61cd17e7cc10cb7e9ad10971b06564acae82 Mon Sep 17 00:00:00 2001 From: Destiny Saturday Date: Mon, 29 Jul 2024 03:13:01 +0100 Subject: [PATCH 3/5] Update dev-deployment.yml Signed-off-by: Destiny Saturday --- .github/workflows/dev-deployment.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dev-deployment.yml b/.github/workflows/dev-deployment.yml index 47bf4b464..a5fc7e53b 100644 --- a/.github/workflows/dev-deployment.yml +++ b/.github/workflows/dev-deployment.yml @@ -23,4 +23,5 @@ jobs: username: ${{ secrets.USERNAME }} password: ${{ secrets.PASSWORD }} script: | - ./deploy_dev.sh next + cd hng_boilerplate_nextjs + ./scripts/dev_deploy.sh From 3199ef975fdf9ebc2412bbd7d01906c3a1c11eab Mon Sep 17 00:00:00 2001 From: Destiny Saturday Date: Mon, 29 Jul 2024 03:15:52 +0100 Subject: [PATCH 4/5] Update docker-compose.yml Signed-off-by: Destiny Saturday --- docker/development/docker-compose.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docker/development/docker-compose.yml b/docker/development/docker-compose.yml index bb422631e..c6ac4a386 100644 --- a/docker/development/docker-compose.yml +++ b/docker/development/docker-compose.yml @@ -1,12 +1,11 @@ services: next-dev-frontend-1: - build: - context: ../../ - dockerfile: docker/development/Dockerfile + image: hngdevops/nextjs-boilerplate:dev ports: - 3100:3000 - restart: always + volumes: + - ../../.env:/app/.env # next-dev-frontend-2: # build: From d4aded88c0f08143d5a49bc947c7ef66851c81ce Mon Sep 17 00:00:00 2001 From: Destiny Saturday Date: Mon, 29 Jul 2024 03:18:12 +0100 Subject: [PATCH 5/5] Update docker-compose.yml Signed-off-by: Destiny Saturday --- docker/development/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/development/docker-compose.yml b/docker/development/docker-compose.yml index c6ac4a386..869ed04f3 100644 --- a/docker/development/docker-compose.yml +++ b/docker/development/docker-compose.yml @@ -1,6 +1,6 @@ services: - next-dev-frontend-1: + frontend: image: hngdevops/nextjs-boilerplate:dev ports: - 3100:3000