diff --git a/scripts/dev_deploy.sh b/scripts/dev_deploy.sh new file mode 100755 index 000000000..829383e3d --- /dev/null +++ b/scripts/dev_deploy.sh @@ -0,0 +1,23 @@ +#!/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 + diff --git a/scripts/prod_deploy.sh b/scripts/prod_deploy.sh new file mode 100755 index 000000000..e192db8c1 --- /dev/null +++ b/scripts/prod_deploy.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +if [ "$#" -ne 1 ]; then + echo "Usage: $0 {next|remix}" + exit 1 +fi + +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 diff --git a/scripts/staging_deploy.sh b/scripts/staging_deploy.sh new file mode 100755 index 000000000..cc2ba3194 --- /dev/null +++ b/scripts/staging_deploy.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +if [ "$#" -ne 1 ]; then + echo "Usage: $0 {next|remix}" + exit 1 +fi + +if [ "$1" == "next" ]; then + cd /home/nextjs/staging/hng_boilerplate_nextjs + git pull origin staging + docker compose -f docker/staging/docker-compose.yml build + docker compose -f docker/staging/docker-compose.yml up -d +elif [ "$1" == "remix" ]; then + cd /home/remixjs/staging/hng_boilerplate_remix + git pull origin staging + docker compose -f docker/staging/docker-compose.yml build + docker compose -f docker/staging/docker-compose.yml up -d +else + echo "Invalid argument. Use 'next' or 'remix'." + echo "Usage: $0 {next|remix}" + exit 1 +fi diff --git a/scripts/team_deploy.sh b/scripts/team_deploy.sh new file mode 100755 index 000000000..8f3f0eab6 --- /dev/null +++ b/scripts/team_deploy.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +set -e + +# Check if the team name is provided +if [ -z "$1" ]; then + echo "Error: Team name is required." + echo "Usage: $0 [team name] [port]" + exit 1 +fi + +# Check if the port is provided +if [ -z "$2" ]; then + echo "Error: Port number is required." + echo "Usage: $0 [team name] [port]" + exit 1 +fi + +# Assign arguments to variables for clarity +TEAM_NAME=$1 +PORT=$2 + +git pull origin dev +docker pull hngdevops/nextjs-boilerplate:dev +docker run -d --name "$TEAM_NAME" -p "$PORT:3000" hngdevops/nextjs-boilerplate:dev