Skip to content

Commit

Permalink
Updated - init.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
pdovhomilja committed Dec 15, 2023
1 parent 4b9a25c commit 92888ab
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion init.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@

#!/bin/bash

# Default instance value
instance="dev"
# Default port value
port="3000"

Expand All @@ -22,20 +26,44 @@ while getopts ":i:p:" opt; do
esac
done

echo "-------------------------------------- INIT SCRIPT --------------------------------------"
echo "Dont forget to set the environment variables in the .env file and the .env.local file!!"
echo "Before running this script, make sure you have installed pm2 globally with npm install -g pm2"
echo "-----------------------------------------------------------------------------------------"

# This script is used to initialize the project
echo "-------------------------------------- INIT SCRIPT --------------------------------------"
echo "Initializing the project..."
echo "-----------------------------------------------------------------------------------------"
npm install

# This script builds the project
echo "-------------------------------------- BUILD SCRIPT -------------------------------------"
echo "Building the project..."
echo "-----------------------------------------------------------------------------------------"
npm run build


# This script is used to generate the prisma client and schema
echo "-------------------------------------- PRISMA SCRIPT ------------------------------------"
echo "Generating the prisma client and schema..."
echo "-----------------------------------------------------------------------------------------"
npx prisma genereate

# This script is used to initialize the database
echo "-------------------------------------- PRISMA - DB PUSH SCRIPT --------------------------"
echo "Initializing the database..."
echo "-----------------------------------------------------------------------------------------"
npx prisma db push

# This script is used to seed the database with default data
echo "-------------------------------------- PRISMA - DB SEED SCRIPT --------------------------"
echo "Seeding the database..."
echo "-----------------------------------------------------------------------------------------"
npx prisma db seed

# This script is used to start the server
pm2 start npm --name "nextcrm-$instance" -- start -- --port $port
echo "-------------------------------------- START SCRIPT --------------------------------------"
echo "Starting the server..."
echo "------------------------------------------------------------------------------------------"
#pm2 start npm --name "nextcrm-$instance" -- start -- --port $port

4 comments on commit 92888ab

@vercel
Copy link

@vercel vercel bot commented on 92888ab Dec 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nextcrm-demo – ./

nextcrm-demo-git-main-e-osvc.vercel.app
demo.nextcrm.io
nextcrm-demo-e-osvc.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 92888ab Dec 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nextcrm-others – ./

others.nextcrm.io
nextcrm-others-e-osvc.vercel.app
nextcrm-others-git-main-e-osvc.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 92888ab Dec 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nextcrm-test – ./

test.nextcrm.io
nextcrm-test-e-osvc.vercel.app
nextcrm-test-git-main-e-osvc.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 92888ab Dec 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.