-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] add setup and deploy scripts
- Loading branch information
Arkady Fukzon
committed
Jan 20, 2016
1 parent
3ded71f
commit 4941688
Showing
8 changed files
with
384 additions
and
143 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 |
---|---|---|
|
@@ -3,10 +3,23 @@ | |
An application allowing to monitor the state of servers and requests of different kinds (pullrequests, graylogs). | ||
|
||
<h2>Prerequisites:</h2> | ||
|
||
|
||
* NodeJS and npm | ||
* MongoDB | ||
* Google Account and App with Google+ API enabled | ||
|
||
<h2>Setup and Local Use:</h2> | ||
|
||
* Create a google app with Google+ API enabled in the google developers console, and prepare the: Client ID, Secret and Callback Url | ||
* Run: "npm install" | ||
* Run: "node setup" and enter the requested parameters | ||
* Add this line to your hosts file: 127.0.0.1 devflow.yourdomain.com # devflow | ||
* Run with "npm start" | ||
* Enter: localhost:3000 or http://devflow.yourdomain.com:3000/ | ||
|
||
( Please Run "npm install" again whenever changing node packages, | ||
In order to debug it's possible to run "node debug app.js" - node's built-in debugger ) | ||
|
||
<h2>Optional Services Integration:</h2> | ||
|
||
* GitHub | ||
|
@@ -21,70 +34,24 @@ An application allowing to monitor the state of servers and requests of differen | |
* Server Configuration - global, google, hipchat, slack, mail and jobs settings. | ||
* Client Configuration - display setting for request types, links and the page refresh interval. | ||
|
||
See examples in the config.js.dev in the project | ||
|
||
<h2>Web Management Console (for admin role only):</h2> | ||
|
||
* User Management. | ||
* Server Management. (No enviroment additions/deletions available) | ||
|
||
<h2>Setup and Local Use:</h2> | ||
|
||
* Create config.js in the root folder of the project (- rename config.js.dev to config.js and replace with your values) | ||
* Create a google app with Google+ API enabled in the google developers console | ||
* Update the google clientId, secret and callback in the config. | ||
|
||
Database setup: | ||
|
||
1. Enter mongo console by running: "mongo" | ||
2. Create the devflow db: "use devflow" | ||
3. Run the following scripts for initial population and creation of collections: | ||
|
||
Users: | ||
See examples in the config.js.dev in the project | ||
|
||
db.Users.insert({id: null, email:'[email protected]', name: null, image: null, associated: false, role: "admin" }) | ||
<h2>Web Management Console:</h2> | ||
|
||
Servers: | ||
|
||
db.ServerEnvironments.insert({name: "Env1", order: 1, queue: [], servers: [{environment: "Env1", name:"Server11", queue: [], taken_since: null, user: null, url: null},{environment: "Env1", name:"Server12", queue: [], taken_since: null, user: null, url: null}]}) | ||
db.ServerEnvironments.insert({name: "Env2", order: 2, queue: [], servers: [{environment: "Env2", name:"Server21", queue: [], taken_since: null, user: null, url: null},{environment: "Env2", name:"Server22", queue: [], taken_since: null, user: null, url: null}]}) | ||
|
||
Please Run "npm install" on first use or if changing node packages. | ||
|
||
In order to run locally please add this line to your hosts file: | ||
|
||
127.0.0.1 devflow.yourdomain.com # devflow | ||
|
||
Run with "npm start" | ||
|
||
(In order to debug it's possible to run "node debug app.js" - node's built-in debugger, breakpoints using: "debugger", evaluating vars: "repl", regular debug control commands) | ||
|
||
Enter: http://devflow.yourdomain.com:3000/ or localhost:3000 | ||
* User Management. (admin role only) | ||
* Server Management. (admin role only, no enviroment additions/deletions available) | ||
* Tags Management | ||
|
||
<h2>Deploy and Production Settings:</h2> | ||
|
||
configuration setup: | ||
Configuration setup: | ||
|
||
use: export DEVFLOW_CONFIG=path in order to add a path to your production config. | ||
For custom configuration path use: export DEVFLOW_CONFIG=path. | ||
(you can also include this in your .bash_profile or .bashrc) | ||
|
||
Kill all node/npm processes related to devflow, for example: | ||
|
||
ps -eaf | grep node | ||
ps -eaf | grep npm | ||
kill x, y ,z | ||
|
||
Pull from master: | ||
|
||
git pull origin master | ||
|
||
Install packages if neccessary: | ||
|
||
npm install | ||
|
||
Run devflow in background on server: | ||
Deploy latest version and Restart (on Linux): | ||
|
||
NODE_ENV=production nohup npm start & | ||
Enter your folder and run: ./deploy | ||
|
||
Log and Errors: | ||
|
||
|
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
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
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,11 @@ | ||
|
||
PROCESS_ID=`pwdx $(pgrep npm) | grep devflow | cut -d ":" -f 1` | ||
if [ -n "$PROCESS_ID" ]; then | ||
kill $PROCESS_ID || true | ||
fi | ||
|
||
git reset --hard origin/master | ||
git pull -r | ||
npm install | ||
sleep 5 | ||
NODE_ENV=production nohup npm start & |
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
Oops, something went wrong.