-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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 #7555 from RocketChat/improve-build-example
[FIX] Improve build script example
- Loading branch information
Showing
2 changed files
with
32 additions
and
16 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,32 @@ | ||
#!/bin/bash | ||
set -x | ||
set -euvo pipefail | ||
IFS=$'\n\t' | ||
|
||
# Requies Node.js version 4.x | ||
# Do not run as root | ||
|
||
DEPLOY_DIR=/var/www/rocket.chat | ||
|
||
### BUILD | ||
meteor npm install | ||
|
||
# on the very first build, meteor build command should fail due to a bug on emojione package (related to phantomjs installation) | ||
# the command below forces the error to happen before build command (not needed on subsequent builds) | ||
set +e | ||
meteor add rocketchat:lib | ||
set -e | ||
|
||
meteor build --server-only --directory $DEPLOY_DIR | ||
|
||
### RUN | ||
cd $DEPLOY_DIR/bundle/programs/server | ||
npm install | ||
|
||
cd $DEPLOY_DIR/bundle | ||
NODE_ENV=production \ | ||
PORT=3000 \ | ||
ROOT_URL=http://localhost:3000 \ | ||
MONGO_URL=mongodb://localhost:27017/rocketchat \ | ||
MONGO_OPLOG_URL=mongodb://localhost:27017/local \ | ||
node main.js |
This file was deleted.
Oops, something went wrong.