Created
June 30, 2015 10:49
-
-
Save superboum/b48698a7ba09380423f1 to your computer and use it in GitHub Desktop.
Gandi Simple Hosting - NodeJS Scripts - For Gulp + Babel (ES6 Harmony)
This file contains hidden or 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
| { | |
| "name": "package", | |
| "version": "0.0.1", | |
| "description": "package", | |
| "main": "server.js", | |
| "scripts": { | |
| "postinstall": "sh ./scripts/postinstall", | |
| "deploy": "git push gandi develop:master && ssh 00000000@git.dc0.gpaas.net 'deploy default.git'" | |
| }, | |
| "engines": { | |
| "node": ">=0.12.4" | |
| }, | |
| "author": "Quentin Dufour", | |
| "license": "MIT", | |
| "dependencies": { | |
| }, | |
| "devDependencies": { | |
| } | |
| } | |
This file contains hidden or 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
| #!/bin/sh | |
| HOSTNAME=`hostname` | |
| echo Hostname: $HOSTNAME | |
| HOSTID=`echo ${HOSTNAME} | cut -c1-4` | |
| echo Hostid: $HOSTID | |
| if [ ${HOSTID} = 'paas' ] | |
| then | |
| HOME=/srv/data/web/vhosts/default | |
| mv config.json.gandi config.json | |
| fi | |
| echo Homedir: $HOME | |
| node ./node_modules/gulp/bin/gulp.js |
This file contains hidden or 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
| process.env.BABEL_CACHE_PATH = __dirname + '/.babel-cache.json'; | |
| var babel = require("babel/register")({ignore:[ | |
| //Every deps which not require ES6 | |
| ]}); | |
| var app = require("./app.js"); | |
| var pack = require('./package.json'); | |
| var config = require('./config.json'); | |
| console.log('Starting '+pack.name+' server on 0.0.0.0:'+config.http.port); | |
| console.log('Version '+pack.version+' by '+pack.author); | |
| app.listen(config.http.port); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment