This commit is contained in:
Vincent Fiduccia
2018-07-10 14:15:22 -07:00
parent e7f5f1a96b
commit ce9d855c51
2 changed files with 12 additions and 5 deletions
+3
View File
@@ -3,6 +3,9 @@ FROM rancher/docs:build
VOLUME /usr/share/nginx/html/docs
WORKDIR /run
ADD https://github.com/rancher/giddyup/releases/download/v0.19.0/giddyup /usr/bin/giddyup
RUN chmod +x /usr/bin/giddyup
COPY gulpfile.babel.js /run/
ENTRYPOINT ["gulp"]
+9 -5
View File
@@ -194,18 +194,22 @@ gulp.task('publish:search-index', (cb) => {
env: env
};
return exec('giddyup leader check', opts).on('close', code => {
return exec('giddyup leader check', opts, function(err, stdout, stderr) {
console.log('Error:', err);
console.log('Stdout:', stdout);
console.log('Stderr:', stderr);
}).on('close', code => {
if (code === 0) {
console.log('Publishing to algolia', process.env.ALGOLIA_INDEX_NAME);
const rawdata = fs.readFileSync('public/final.algolia.json');
const merged = JSON.parse(rawdata);
atomicalgolia(process.env.ALGOLIA_INDEX_NAME, merged, (err, result) => {
console.log(result);
cb(err);
});
} else {
console.log('I am not the leader (' + code + ')');
cb(new Error('Not the leader'));
}
});
});