Skip to content
Snippets Groups Projects
Commit fcb7e60f authored by Gabriel Engel's avatar Gabriel Engel
Browse files

Adding pm2 and building scripts

parent 8f28ed2a
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
DATETIME=`date "+%d/%m/%Y %H:%M:%S"`
COMMIT_HASH=`git log --pretty=format:'%H' -n 1`
COMMIT_AUTHOR_NAME=`git log --pretty=format:'%an' -n 1`
COMMIT_AUTHOR_DATE=`git log --pretty=format:'%ad' -n 1`
COMMIT_AUTHOR_EMAIL=`git log --pretty=format:'%ae' -n 1`
COMMIT_SUBJECT=`git log --pretty=format:'%s' -n 1`
COMMIT_SUBJECT="${COMMIT_SUBJECT//\'/\"}"
echo "BuildInfo = {
date: '$DATETIME',
commit: {
hash: '$COMMIT_HASH',
subject: '$COMMIT_SUBJECT',
author: {
date: '$COMMIT_AUTHOR_DATE',
name: '$COMMIT_AUTHOR_NAME',
email: '$COMMIT_AUTHOR_EMAIL'
}
}
};" > ./BuildInfo.js
build.sh 0 → 100644
#!/bin/bash
if [ ! $1 ]; then
echo " Example of use: source build.sh production"
fi
if [ $1 ]; then
source ./build-info.sh
export METEOR_SETTINGS=$(cat settings.$1.json)
meteor build --server rocket.chat --directory /var/www/rocket.chat
cd /var/www/rocket.chat/bundle/programs/server
npm install
cd /var/www/rocket.chat
pm2 startOrRestart /var/www/rocket.chat/current/pm2.$1.json
fi
{
"apps": [{
"name": "rocket.chat",
"exec_mode": "fork_mode",
"max_memory_restart" : "400M",
"log_date_format": "YYYY-MM-DD HH:mm:ss SSS",
"script": "/var/www/rocket.chat/bundle/main.js",
"out_file": "/var/log/rocket.chat/app.log",
"error_file": "/var/log/rocket.chat/err.log",
"port": "80",
"env": {
"MONGO_URL": "mongodb://localhost:27017/rocketchat",
"MONGO_OPLOG_URL": "mongodb://localhost:27017/local",
"ROOT_URL": "http://rocket.chat",
"PORT": "80"
}
}]
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment