Comparing version 1.0.9 to 1.1.0
@@ -7,6 +7,6 @@ #!/usr/bin/env node | ||
let deployConfig = yaml.load(fs.readFileSync('./src/config/deploy.yaml', 'utf8')); | ||
console.log("Backing build"); | ||
execSync('react-scripts build', { encoding: 'utf-8' }); | ||
console.log("Publishing build on github"); | ||
execSync('git add build', { encoding: 'utf-8' }); | ||
try{ | ||
@@ -20,6 +20,6 @@ execSync(`git commit -m \"deploy build_${+ new Date()}\"`, { encoding: 'utf-8' }); | ||
execSync(`git push origin ${deployConfig.staging_branch}`, { encoding: 'utf-8' }); | ||
execSync(`npx shipit --shipitfile ./node_modules/j-frd/shipitfile.js ${deployConfig.env} deploy`, { encoding: 'utf-8' }); | ||
} | ||
console.log("Deploying build to server"); | ||
execSync(`npx shipit --shipitfile ./node_modules/j-frd/shipitfile.js ${deployConfig.env} deploy`, { encoding: 'utf-8' }); | ||
} | ||
else | ||
throw("No deploy.yaml found inside 'src/config/deploy'"); |
{ | ||
"name": "j-frd", | ||
"version": "1.0.9", | ||
"version": "1.1.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "shipitfile.js", |
@@ -42,3 +42,4 @@ module.exports = shipit => { | ||
shipit.task('createNgnixConf', async () => { | ||
shipit.task('update-ngnix', async () => { | ||
console.log("Updating Ngnix conf"); | ||
await shipit.remote( | ||
@@ -55,5 +56,12 @@ `echo \"${ngnixConf}\" > /etc/nginx/sites-available/${appName}` | ||
shipit.on('deploy', function() { | ||
console.log("DEPLOY"); | ||
shipit.start('update-ngnix'); | ||
}) | ||
shipit.on('deployed', function() { | ||
shipit.emit('createNgnixConf') | ||
console.log("DEPLOYED"); | ||
shipit.start('update-ngnix'); | ||
//shipit.start('update-ngnix') | ||
}) | ||
} |
4158
80