Skip to content

Instantly share code, notes, and snippets.

@superboum
Created June 30, 2015 10:49
Show Gist options
  • Select an option

  • Save superboum/b48698a7ba09380423f1 to your computer and use it in GitHub Desktop.

Select an option

Save superboum/b48698a7ba09380423f1 to your computer and use it in GitHub Desktop.
Gandi Simple Hosting - NodeJS Scripts - For Gulp + Babel (ES6 Harmony)
{
"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": {
}
}
#!/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
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