mirror of
https://github.com/rancher/rancher-docs.git
synced 2026-09-28 14:08:55 +00:00
Giddyup
This commit is contained in:
@@ -3,6 +3,9 @@ FROM rancher/docs:build
|
|||||||
VOLUME /usr/share/nginx/html/docs
|
VOLUME /usr/share/nginx/html/docs
|
||||||
WORKDIR /run
|
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/
|
COPY gulpfile.babel.js /run/
|
||||||
|
|
||||||
ENTRYPOINT ["gulp"]
|
ENTRYPOINT ["gulp"]
|
||||||
|
|||||||
+9
-5
@@ -194,18 +194,22 @@ gulp.task('publish:search-index', (cb) => {
|
|||||||
env: env
|
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) {
|
if (code === 0) {
|
||||||
|
console.log('Publishing to algolia', process.env.ALGOLIA_INDEX_NAME);
|
||||||
const rawdata = fs.readFileSync('public/final.algolia.json');
|
const rawdata = fs.readFileSync('public/final.algolia.json');
|
||||||
const merged = JSON.parse(rawdata);
|
const merged = JSON.parse(rawdata);
|
||||||
atomicalgolia(process.env.ALGOLIA_INDEX_NAME, merged, (err, result) => {
|
atomicalgolia(process.env.ALGOLIA_INDEX_NAME, merged, (err, result) => {
|
||||||
console.log(result);
|
console.log(result);
|
||||||
cb(err);
|
cb(err);
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
console.log('I am not the leader (' + code + ')');
|
||||||
|
cb(new Error('Not the leader'));
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user