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

@@ -2,14 +2,12 @@
.*
*.soy
*.komodoproject
/deploy
deploy
/static/appengine/
/static/closure/
/static/demos/plane/soy/*.jar
/static/demos/plane/xlf/
/static/externs/
/static/msg/json/
/static/node_modules/
/static/scripts/
/static/typings/

View File

@@ -1,16 +0,0 @@
#!/bin/bash
# Script to deploy on GAE.
APP=./app.yaml
if ! [ -f $APP ] ; then
echo $APP not found 1>&2
exit 1
fi
PROJECT=blockly-demo
VERSION=37
echo 'Beginning deployment...'
gcloud app deploy --project $PROJECT --version $VERSION --no-promote
echo 'Deployment finished.'

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
);