diff --git a/scripts/prod_deploy.sh b/scripts/prod_deploy.sh index e192db8c1..38ab8d1a1 100755 --- a/scripts/prod_deploy.sh +++ b/scripts/prod_deploy.sh @@ -1,22 +1,8 @@ #!/bin/bash -if [ "$#" -ne 1 ]; then - echo "Usage: $0 {next|remix}" - exit 1 -fi +set -e -if [ "$1" == "next" ]; then - cd /home/nextjs/prod/hng_boilerplate_nextjs - git pull origin main - docker compose -f docker/prod/docker-compose.yml build - docker compose -f docker/prod/docker-compose.yml up -d -elif [ "$1" == "remix" ]; then - cd /home/remixjs/prod/hng_boilerplate_remix - git pull origin main - docker compose -f docker/prod/docker-compose.yml build - docker compose -f docker/prod/docker-compose.yml up -d -else - echo "Invalid argument. Use 'next' or 'remix'." - echo "Usage: $0 {next|remix}" - exit 1 -fi +cd "$(git rev-parse --show-toplevel)" +git pull origin main +docker pull hngdevops/nextjs-boilerplate:prod +docker compose --project-name prod-nextjs -f docker/prod/docker-compose.yml up -d