Update demo deploy script and fix gcloudignore file (#4566)

This commit is contained in:
Monica Kozbial
2021-01-06 14:58:28 -08:00
committed by GitHub
parent 688ba16ae6
commit dc22b30849
3 changed files with 11 additions and 24 deletions

View File

@@ -12,6 +12,7 @@ var gulp = require('gulp');
var fs = require('fs');
var rimraf = require('rimraf');
var path = require('path');
var execSync = require('child_process').execSync;
var packageJson = require('../../package.json');
@@ -45,13 +46,16 @@ function copyStaticSrc(done) {
* Copies appengine files into deploy directory.
*/
function copyAppengineSrc() {
return gulp.src(['appengine/**/*', 'appengine/.gcloudignore',])
.pipe(gulp.dest(demoTmpDir));
const appengineSrc = [
path.join(demoStaticTmpDir, 'appengine/**/*'),
path.join(demoStaticTmpDir, 'appengine/.gcloudignore'),
];
return gulp.src(appengineSrc).pipe(gulp.dest(demoTmpDir));
}
/**
* Deploys files from tmp directory to appengine to the minor version defined in
* package.json and then cleans the tmp directory.
* Deploys files from tmp directory to appengine to version based on the version
* specified in package.json and then cleans the tmp directory.
*/
function deployAndClean(done) {
const minorVersion = packageJson.version.split('.')[1];
@@ -76,7 +80,8 @@ function deployAndClean(done) {
*/
const deployDemos = gulp.series(
prepareDeployDir,
gulp.parallel(copyStaticSrc, copyAppengineSrc),
copyStaticSrc,
copyAppengineSrc,
deployAndClean
);