-
Notifications
You must be signed in to change notification settings - Fork 264
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #699 from hngprojects/team-deploy
ci: add scripts to boilerplate
- Loading branch information
Showing
4 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |