-
Notifications
You must be signed in to change notification settings - Fork 50
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 #28 from vicradon/feat/add-pm2-setup-script
chore: include setup script for pm2
- Loading branch information
Showing
5 changed files
with
37 additions
and
5 deletions.
There are no files selected for viewing
File renamed without changes.
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 |
---|---|---|
@@ -1,13 +1,36 @@ | ||
#!/bin/bash | ||
|
||
# Check if the script is run as root | ||
# Ensure the script is run as root | ||
if [ "$(id -u)" -ne 0 ]; then | ||
echo "This script must be run as root. Use sudo." | ||
exit 1 | ||
fi | ||
|
||
chmod +x nginx.sh postgres_go.sh postgres_setup.sh | ||
# Ensure the script is run from the scripts directory directly | ||
SCRIPT_DIR_NAME="scripts" | ||
CURRENT_DIR_NAME=$(basename "$PWD") | ||
|
||
./nginx.sh | ||
./postgres_go.sh | ||
./postgres_setup.sh | ||
if [ "$CURRENT_DIR_NAME" != "$SCRIPT_DIR_NAME" ]; then | ||
echo "This script must be run from the $SCRIPT_DIR_NAME directory." | ||
exit 1 | ||
fi | ||
|
||
# Array of scripts to execute | ||
SCRIPTS=( | ||
"install_and_setup_nginx.sh" | ||
"install_postgres_and_go.sh" | ||
"install_pm2.sh" | ||
"setup_postgres.sh" | ||
) | ||
|
||
# Make all scripts executable and execute them | ||
for script in "${SCRIPTS[@]}"; do | ||
if [ -f "$script" ]; then | ||
chmod +x "$script" | ||
echo "Executing $script..." | ||
./"$script" | ||
else | ||
echo "Script $script does not exist." | ||
exit 1 | ||
fi | ||
done |
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,9 @@ | ||
#!/bin/bash | ||
|
||
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash | ||
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")" | ||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm | ||
|
||
nvm install 20 | ||
|
||
npm i -g pm2 |
File renamed without changes.
File renamed without changes.