From 6284f3d2d4a0b6d9d9eef1bfe35ad3a3415fdc33 Mon Sep 17 00:00:00 2001 From: SudharakaP Date: Sat, 10 Aug 2019 18:24:04 -0700 Subject: [PATCH 01/13] Explicitly use Java11 in travis deployment --- generators/ci-cd/templates/travis.yml.ejs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/generators/ci-cd/templates/travis.yml.ejs b/generators/ci-cd/templates/travis.yml.ejs index c87b155a1b66..bec2e64647d8 100644 --- a/generators/ci-cd/templates/travis.yml.ejs +++ b/generators/ci-cd/templates/travis.yml.ejs @@ -18,7 +18,6 @@ -%> os: - linux -dist: bionic services: - docker language: node_js @@ -44,6 +43,8 @@ env: - JHI_DISABLE_WEBPACK_LOGS=true - NG_CLI_ANALYTICS="false" before_install: + - wget https://github.com/sormuras/bach/raw/master/install-jdk.sh + - source install-jdk.sh --feature 11 - java -version - sudo /etc/init.d/mysql stop - sudo /etc/init.d/postgresql stop From f6bd8d019fbcb7c58cc28fcb8bea9d9cde905127 Mon Sep 17 00:00:00 2001 From: SudharakaP Date: Sat, 10 Aug 2019 19:44:55 -0700 Subject: [PATCH 02/13] Convert the existing appengine-web.xml.ejs to app.yaml.ejs for gae java11 support --- generators/gae/index.js | 2 +- generators/gae/templates/app.yaml.ejs | 22 ++++++++++ .../gae/templates/appengine-web.xml.ejs | 41 ------------------- 3 files changed, 23 insertions(+), 42 deletions(-) create mode 100644 generators/gae/templates/app.yaml.ejs delete mode 100644 generators/gae/templates/appengine-web.xml.ejs diff --git a/generators/gae/index.js b/generators/gae/index.js index 5629eaa19b34..e5d1530781eb 100644 --- a/generators/gae/index.js +++ b/generators/gae/index.js @@ -661,7 +661,7 @@ module.exports = class extends BaseGenerator { this.log(chalk.bold('\nCreating Google App Engine deployment files')); this.template('web.xml.ejs', `${constants.CLIENT_MAIN_SRC_DIR}/WEB-INF/web.xml`); - this.template('appengine-web.xml.ejs', `${constants.CLIENT_MAIN_SRC_DIR}/WEB-INF/appengine-web.xml`); + this.template('app.yaml.ejs', `${constants.MAIN_DIR}/appengine/app.yaml`); this.template('logging.properties.ejs', `${constants.CLIENT_MAIN_SRC_DIR}/WEB-INF/logging.properties`); this.template('application-prod-gae.yml.ejs', `${constants.SERVER_MAIN_RES_DIR}/config/application-prod-gae.yml`); if (this.buildTool === 'gradle') { diff --git a/generators/gae/templates/app.yaml.ejs b/generators/gae/templates/app.yaml.ejs new file mode 100644 index 000000000000..df5bc1a62bcf --- /dev/null +++ b/generators/gae/templates/app.yaml.ejs @@ -0,0 +1,22 @@ +runtime: java11 +instance_class: <%= gaeInstanceClass %> +service: <%=gaeServiceName%> +<%_ if (gaeScalingType === 'manual') { _%> +manual_scaling: + instances: <%= gaeInstances %> +<%_ } else if (gaeScalingType === 'basic') { _%> +basic_scaling: + <%_ if (gaeMaxInstances > 0) { _%> + max_instances: <%= gaeMaxInstances %> + <%_ } _%> + +<%_ } else if (gaeScalingType === 'automatic') { _%> + + <%_ if (gaeMinInstances > 0) { _%> + min_instances: <%= gaeMinInstances %> + <%_ } _%> + <%_ if (gaeMaxInstances > 0) { _%> + max_instances: <%= gaeMaxInstances %> + <%_ } _%> + +<%_ } _%> diff --git a/generators/gae/templates/appengine-web.xml.ejs b/generators/gae/templates/appengine-web.xml.ejs deleted file mode 100644 index ff814a38aa78..000000000000 --- a/generators/gae/templates/appengine-web.xml.ejs +++ /dev/null @@ -1,41 +0,0 @@ - - <%=gaeServiceName%> - true - java8 - - <%_ if (gaeScalingType === 'manual') { _%> - - <%= gaeInstances %> - - <%_ } else if (gaeScalingType === 'basic') { _%> - - <%_ if (gaeMaxInstances > 0) { _%> - <%= gaeMaxInstances %> - <%_ } _%> - - <%_ } else if (gaeScalingType === 'automatic') { _%> - - <%_ if (gaeMinInstances > 0) { _%> - <%= gaeMinInstances %> - <%_ } _%> - <%_ if (gaeMaxInstances > 0) { _%> - <%= gaeMaxInstances %> - <%_ } _%> - - <%_ } _%> - true - <%= gaeInstanceClass %> - false - - - - - - - - - - - - From 18b08744ed08d42269b4aef765a37f2e466d5bc0 Mon Sep 17 00:00:00 2001 From: SudharakaP Date: Sat, 10 Aug 2019 20:02:24 -0700 Subject: [PATCH 03/13] Remove unnecessary logging file as per; https://cloud.google.com/appengine/docs/standard/java11/java-differences#logging --- generators/gae/index.js | 1 - generators/gae/templates/logging.properties.ejs | 13 ------------- 2 files changed, 14 deletions(-) delete mode 100644 generators/gae/templates/logging.properties.ejs diff --git a/generators/gae/index.js b/generators/gae/index.js index e5d1530781eb..d45eba18c03e 100644 --- a/generators/gae/index.js +++ b/generators/gae/index.js @@ -662,7 +662,6 @@ module.exports = class extends BaseGenerator { this.template('web.xml.ejs', `${constants.CLIENT_MAIN_SRC_DIR}/WEB-INF/web.xml`); this.template('app.yaml.ejs', `${constants.MAIN_DIR}/appengine/app.yaml`); - this.template('logging.properties.ejs', `${constants.CLIENT_MAIN_SRC_DIR}/WEB-INF/logging.properties`); this.template('application-prod-gae.yml.ejs', `${constants.SERVER_MAIN_RES_DIR}/config/application-prod-gae.yml`); if (this.buildTool === 'gradle') { this.template('gae.gradle.ejs', 'gradle/gae.gradle'); diff --git a/generators/gae/templates/logging.properties.ejs b/generators/gae/templates/logging.properties.ejs deleted file mode 100644 index e23a81e59d6a..000000000000 --- a/generators/gae/templates/logging.properties.ejs +++ /dev/null @@ -1,13 +0,0 @@ -# A default java.util.logging configuration. -# (All App Engine logging is through java.util.logging by default). -# -# To use this configuration, copy it into your application's WEB-INF -# folder and add the following to your appengine-web.xml: -# -# -# -# -# - -# Set the default logging level for all loggers to INFO -.level = INFO From cc93334156cb9252cc968729dad3efbbbe3120c6 Mon Sep 17 00:00:00 2001 From: SudharakaP Date: Sat, 10 Aug 2019 20:33:16 -0700 Subject: [PATCH 04/13] Modify gradle bootWar task to exclude appengine-web.xml file --- generators/gae/templates/gae.gradle.ejs | 3 --- 1 file changed, 3 deletions(-) diff --git a/generators/gae/templates/gae.gradle.ejs b/generators/gae/templates/gae.gradle.ejs index 94a67b242d35..401cab3dc5fe 100644 --- a/generators/gae/templates/gae.gradle.ejs +++ b/generators/gae/templates/gae.gradle.ejs @@ -27,9 +27,6 @@ appengine { bootWar { webXml = file("${project.rootDir}/<%= CLIENT_MAIN_SRC_DIR %>WEB-INF/web.xml") - from("${project.rootDir}/<%= CLIENT_MAIN_SRC_DIR %>WEB-INF/appengine-web.xml") { - into("WEB-INF") - } } processResources { From 5de9edf0445b23d9d52d637444cd894339063c00 Mon Sep 17 00:00:00 2001 From: SudharakaP Date: Sat, 10 Aug 2019 20:40:08 -0700 Subject: [PATCH 05/13] Remove web.xml as java11 in gae runs as a jar file not on jetty --- generators/gae/index.js | 1 - generators/gae/templates/web.xml.ejs | 19 ------------------- 2 files changed, 20 deletions(-) delete mode 100644 generators/gae/templates/web.xml.ejs diff --git a/generators/gae/index.js b/generators/gae/index.js index d45eba18c03e..8c12456b216d 100644 --- a/generators/gae/index.js +++ b/generators/gae/index.js @@ -660,7 +660,6 @@ module.exports = class extends BaseGenerator { const done = this.async(); this.log(chalk.bold('\nCreating Google App Engine deployment files')); - this.template('web.xml.ejs', `${constants.CLIENT_MAIN_SRC_DIR}/WEB-INF/web.xml`); this.template('app.yaml.ejs', `${constants.MAIN_DIR}/appengine/app.yaml`); this.template('application-prod-gae.yml.ejs', `${constants.SERVER_MAIN_RES_DIR}/config/application-prod-gae.yml`); if (this.buildTool === 'gradle') { diff --git a/generators/gae/templates/web.xml.ejs b/generators/gae/templates/web.xml.ejs deleted file mode 100644 index 07d95dd4f7b8..000000000000 --- a/generators/gae/templates/web.xml.ejs +++ /dev/null @@ -1,19 +0,0 @@ - - - html - text/html;charset=utf-8 - - - json - application/json;charset=utf-8 - - - js - application/javascript;charset=utf-8 - - - From c0b11519b4ed932204ad968893c02c01cab4cf75 Mon Sep 17 00:00:00 2001 From: SudharakaP Date: Sun, 11 Aug 2019 13:13:36 -0700 Subject: [PATCH 06/13] Fix issues with the GAE generator (Java 8) Fix #9605 --- generators/gae/index.js | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/generators/gae/index.js b/generators/gae/index.js index 5629eaa19b34..a04a49e8d466 100644 --- a/generators/gae/index.js +++ b/generators/gae/index.js @@ -18,7 +18,6 @@ */ const os = require('os'); const exec = require('child_process').exec; -const spawn = require('child_process').spawn; const execSync = require('child_process').execSync; const chalk = require('chalk'); const _ = require('lodash'); @@ -59,23 +58,26 @@ module.exports = class extends BaseGenerator { const done = this.async(); const component = 'app-engine-java'; - exec('gcloud components list --quiet --filter="Status=Installed" --format="value(id)"', (err, stdout, srderr) => { - if (_.includes(stdout, component)) { - done(); - } else { - this.log(chalk.bold('\nInstalling App Engine Java SDK')); - this.log(`... Running: gcloud components install ${component} --quiet`); - const child = spawn('gcloud', ['components', 'install', component, '--quiet'], { - stdio: [process.stdin, process.stdout, process.stderr] - }); - child.on('exit', code => { - if (code !== 0) { - this.abort = true; - } + exec( + 'gcloud components list --quiet --filter="Status=Installed OR Status=\\"Update Available\\"" --format="value(id)"', + (err, stdout, srderr) => { + if (_.includes(stdout, component)) { done(); - }); + } else { + this.log(chalk.bold('\nInstalling App Engine Java SDK')); + this.log(`... Running: gcloud components install ${component} --quiet`); + const child = exec(`gcloud components install ${component} --quiet`, { + stdio: [process.stdin, process.stdout, process.stderr] + }); + child.on('exit', code => { + if (code !== 0) { + this.abort = true; + } + done(); + }); + } } - }); + ); }, loadConfig() { @@ -371,9 +373,8 @@ module.exports = class extends BaseGenerator { const done = this.async(); const cloudSqlInstances = [{ value: '', name: 'New Cloud SQL Instance' }]; - exec( - `gcloud sql instances list --format='value[separator=":"](project,region,name)' --project="${this.gcpProjectId}"`, + `gcloud sql instances list --format="value[separator=":"](project,region,name)" --project="${this.gcpProjectId}"`, (err, stdout, stderr) => { if (err) { this.log.error(err); From 643687bc8a146bbba5ac6651b742bf003f6b958d Mon Sep 17 00:00:00 2001 From: SudharakaP Date: Mon, 12 Aug 2019 11:45:43 -0700 Subject: [PATCH 07/13] Add support to give the user a choice in choosing Cloud SQL #10196 --- generators/gae/index.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/generators/gae/index.js b/generators/gae/index.js index ae107dae1138..8a2215223aee 100644 --- a/generators/gae/index.js +++ b/generators/gae/index.js @@ -106,6 +106,7 @@ module.exports = class extends BaseGenerator { this.gaeInstances = this.config.get('gaeInstances'); this.gaeMaxInstances = this.config.get('gaeMaxInstances'); this.gaeMinInstances = this.config.get('gaeMinInstances'); + this.gaeCloudInstanceNeeded = this.config.get('gaeCloudInstanceNeeded'); } }; } @@ -365,7 +366,31 @@ module.exports = class extends BaseGenerator { }); }, + askIfCloudSqlIsNeeded() { + if (this.abort) return; + const done = this.async(); + const prompts = []; + + prompts.push({ + type: 'input', + name: 'gaeCloudInstanceNeeded', + message: 'Initialize a new Cloud SQL instance (Y/N) ?', + default: this.gaeCloudInstanceNeeded ? this.gaeCloudInstanceNeeded : 'Y', + validate: input => { + if (input !== 'Y' && input !== 'N') { + return 'Input should be Y or N'; + } + return true; + } + }); + + this.prompt(prompts).then(props => { + done(); + }); + }, + askForCloudSqlInstance() { + if (this.gaeCloudInstanceNeeded === 'N') return; if (this.abort) return; if (this.prodDatabaseType !== 'mysql' && this.prodDatabaseType !== 'mariadb' && this.prodDatabaseType !== 'postgresql') return; @@ -405,6 +430,7 @@ module.exports = class extends BaseGenerator { }, promptForCloudSqlInstanceNameIfNeeded() { + if (this.gaeCloudInstanceNeeded === 'N') return; if (this.abort) return; if (this.gcpCloudSqlInstanceName) return; @@ -427,6 +453,7 @@ module.exports = class extends BaseGenerator { }, askForCloudSqlLogin() { + if (this.gaeCloudInstanceNeeded === 'N') return; if (this.abort) return; if (!this.gcpCloudSqlInstanceName) return; @@ -460,6 +487,7 @@ module.exports = class extends BaseGenerator { }, askForCloudSqlDatabaseName() { + if (this.gaeCloudInstanceNeeded === 'N') return; if (this.abort) return; if (!this.gcpCloudSqlInstanceNameExists) return; @@ -499,6 +527,7 @@ module.exports = class extends BaseGenerator { }, promptForCloudSqlDatabaseNameIfNeeded() { + if (this.gaeCloudInstanceNeeded === 'N') return; if (this.abort) return; if (this.gcpCloudSqlInstanceName !== 'new' && this.gcpCloudSqlDatabaseName) return; From 1d388a4482eb93f17bdf91a49ac0356aaa4ec124 Mon Sep 17 00:00:00 2001 From: SudharakaP Date: Mon, 12 Aug 2019 12:23:55 -0700 Subject: [PATCH 08/13] Change the app engine values to reflect the second generation runtimes; https://cloud.google.com/appengine/docs/standard/#instance_classes #10196 --- generators/gae/index.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/generators/gae/index.js b/generators/gae/index.js index 8a2215223aee..dc5e432361a9 100644 --- a/generators/gae/index.js +++ b/generators/gae/index.js @@ -247,15 +247,15 @@ module.exports = class extends BaseGenerator { name: 'gaeInstanceClass', message: 'Google App Engine Instance Class', choices: [ - { value: 'F1', name: 'F1 - 600MHz, 128MB, Automatic Scaling' }, - { value: 'F2', name: 'F2 - 1.2GHz, 256MB, Automatic Scaling' }, - { value: 'F4', name: 'F4 - 2.4GHz, 512MB, Automatic Scaling' }, - { value: 'F4_1G', name: 'F4_1G - 2.4GHz, 1GB, Automatic' }, - { value: 'B1', name: 'B1 - 600MHz, 128MB, Basic or Manual Scaling' }, - { value: 'B2', name: 'B2 - 1.2GHz, 256MB, Basic or Manual Scaling' }, - { value: 'B4', name: 'B4 - 2.4GHz, 512MB, Basic or Manual Scaling' }, - { value: 'B4_1G', name: 'B4_1G - 2.4GHz, 1GB, Basic or Manual Scaling' }, - { value: 'B8', name: 'B8 - 4.8GHz, 1GB, Basic or Manual Scaling' } + { value: 'F1', name: 'F1 - 600MHz, 256MB, Automatic Scaling' }, + { value: 'F2', name: 'F2 - 1.2GHz, 512MB, Automatic Scaling' }, + { value: 'F4', name: 'F4 - 2.4GHz, 1GB, Automatic Scaling' }, + { value: 'F4_1G', name: 'F4_1G - 2.4GHz, 2GB, Automatic' }, + { value: 'B1', name: 'B1 - 600MHz, 256MB, Basic or Manual Scaling' }, + { value: 'B2', name: 'B2 - 1.2GHz, 512MB, Basic or Manual Scaling' }, + { value: 'B4', name: 'B4 - 2.4GHz, 1GB, Basic or Manual Scaling' }, + { value: 'B4_1G', name: 'B4_1G - 2.4GHz, 2GB, Basic or Manual Scaling' }, + { value: 'B8', name: 'B8 - 4.8GHz, 2GB, Basic or Manual Scaling' } ], default: this.gaeInstanceClass ? this.gaeInstanceClass : 0 } From bcd8689297fbb5cd4a24fd8364fcca13aebb5d38 Mon Sep 17 00:00:00 2001 From: SudharakaP Date: Mon, 12 Aug 2019 12:57:23 -0700 Subject: [PATCH 09/13] Fix minor bug where I didn't record whether Cloud SQL instance is needed #10196 --- generators/gae/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/generators/gae/index.js b/generators/gae/index.js index dc5e432361a9..cf1333b5d29a 100644 --- a/generators/gae/index.js +++ b/generators/gae/index.js @@ -106,7 +106,7 @@ module.exports = class extends BaseGenerator { this.gaeInstances = this.config.get('gaeInstances'); this.gaeMaxInstances = this.config.get('gaeMaxInstances'); this.gaeMinInstances = this.config.get('gaeMinInstances'); - this.gaeCloudInstanceNeeded = this.config.get('gaeCloudInstanceNeeded'); + this.gaeCloudSQLInstanceNeeded = this.config.get('gaeCloudSQLInstanceNeeded'); } }; } @@ -375,7 +375,7 @@ module.exports = class extends BaseGenerator { type: 'input', name: 'gaeCloudInstanceNeeded', message: 'Initialize a new Cloud SQL instance (Y/N) ?', - default: this.gaeCloudInstanceNeeded ? this.gaeCloudInstanceNeeded : 'Y', + default: this.gaeCloudSQLInstanceNeeded ? this.gaeCloudSQLInstanceNeeded : 'Y', validate: input => { if (input !== 'Y' && input !== 'N') { return 'Input should be Y or N'; @@ -385,6 +385,7 @@ module.exports = class extends BaseGenerator { }); this.prompt(prompts).then(props => { + this.gaeCloudSQLInstanceNeeded = props.gaeCloudSQLInstanceNeeded; done(); }); }, From 51b33affabb8ae51479003762c9e620fa5c0038f Mon Sep 17 00:00:00 2001 From: SudharakaP Date: Mon, 12 Aug 2019 12:58:24 -0700 Subject: [PATCH 10/13] Fix minor bug where I didn't record whether Cloud SQL instance is needed #10196 --- generators/gae/index.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/generators/gae/index.js b/generators/gae/index.js index cf1333b5d29a..bef49dade462 100644 --- a/generators/gae/index.js +++ b/generators/gae/index.js @@ -373,7 +373,7 @@ module.exports = class extends BaseGenerator { prompts.push({ type: 'input', - name: 'gaeCloudInstanceNeeded', + name: 'gaeCloudSQLInstanceNeeded', message: 'Initialize a new Cloud SQL instance (Y/N) ?', default: this.gaeCloudSQLInstanceNeeded ? this.gaeCloudSQLInstanceNeeded : 'Y', validate: input => { @@ -391,7 +391,7 @@ module.exports = class extends BaseGenerator { }, askForCloudSqlInstance() { - if (this.gaeCloudInstanceNeeded === 'N') return; + if (this.gaeCloudSQLInstanceNeeded === 'N') return; if (this.abort) return; if (this.prodDatabaseType !== 'mysql' && this.prodDatabaseType !== 'mariadb' && this.prodDatabaseType !== 'postgresql') return; @@ -431,7 +431,7 @@ module.exports = class extends BaseGenerator { }, promptForCloudSqlInstanceNameIfNeeded() { - if (this.gaeCloudInstanceNeeded === 'N') return; + if (this.gaeCloudSQLInstanceNeeded === 'N') return; if (this.abort) return; if (this.gcpCloudSqlInstanceName) return; @@ -454,7 +454,7 @@ module.exports = class extends BaseGenerator { }, askForCloudSqlLogin() { - if (this.gaeCloudInstanceNeeded === 'N') return; + if (this.gaeCloudSQLInstanceNeeded === 'N') return; if (this.abort) return; if (!this.gcpCloudSqlInstanceName) return; @@ -488,7 +488,7 @@ module.exports = class extends BaseGenerator { }, askForCloudSqlDatabaseName() { - if (this.gaeCloudInstanceNeeded === 'N') return; + if (this.gaeCloudSQLInstanceNeeded === 'N') return; if (this.abort) return; if (!this.gcpCloudSqlInstanceNameExists) return; @@ -528,7 +528,7 @@ module.exports = class extends BaseGenerator { }, promptForCloudSqlDatabaseNameIfNeeded() { - if (this.gaeCloudInstanceNeeded === 'N') return; + if (this.gaeCloudSQLInstanceNeeded === 'N') return; if (this.abort) return; if (this.gcpCloudSqlInstanceName !== 'new' && this.gcpCloudSqlDatabaseName) return; From a51d4ecf1416cabd3aa78beaff373a97a96c774e Mon Sep 17 00:00:00 2001 From: SudharakaP Date: Mon, 12 Aug 2019 18:42:19 -0700 Subject: [PATCH 11/13] Fix some bugs and add support for choosing Cloud SQL #10196 --- generators/gae/index.js | 23 +++++++++++++++++------ generators/gae/templates/app.yaml.ejs | 4 +--- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/generators/gae/index.js b/generators/gae/index.js index bef49dade462..02321509bd7e 100644 --- a/generators/gae/index.js +++ b/generators/gae/index.js @@ -582,6 +582,7 @@ module.exports = class extends BaseGenerator { }, createCloudSqlInstance() { + if (this.gaeCloudSQLInstanceNeeded === 'N') return; if (this.abort) return; if (!this.gcpCloudSqlInstanceName) return; if (this.gcpCloudSqlInstanceNameExists) return; @@ -615,6 +616,7 @@ module.exports = class extends BaseGenerator { }, createCloudSqlLogin() { + if (this.gaeCloudSQLInstanceNeeded === 'N') return; if (this.abort) return; if (!this.gcpCloudSqlInstanceName) return; const done = this.async(); @@ -646,6 +648,7 @@ module.exports = class extends BaseGenerator { }, createCloudSqlDatabase() { + if (this.gaeCloudSQLInstanceNeeded === 'N') return; if (this.abort) return; if (!this.gcpCloudSqlInstanceName) return; if (this.gcpCloudSqlDatabaseNameExists) return; @@ -677,7 +680,8 @@ module.exports = class extends BaseGenerator { gaeScalingType: this.gaeScalingType, gaeInstances: this.gaeInstances, gaeMinInstances: this.gaeMinInstances, - gaeMaxInstances: this.gaeMaxInstances + gaeMaxInstances: this.gaeMaxInstances, + gaeCloudSQLInstanceNeeded: this.gaeCloudSQLInstanceNeeded }); } }; @@ -692,7 +696,9 @@ module.exports = class extends BaseGenerator { this.log(chalk.bold('\nCreating Google App Engine deployment files')); this.template('app.yaml.ejs', `${constants.MAIN_DIR}/appengine/app.yaml`); - this.template('application-prod-gae.yml.ejs', `${constants.SERVER_MAIN_RES_DIR}/config/application-prod-gae.yml`); + if (this.gaeCloudSQLInstanceNeeded === 'Y') { + this.template('application-prod-gae.yml.ejs', `${constants.SERVER_MAIN_RES_DIR}/config/application-prod-gae.yml`); + } if (this.buildTool === 'gradle') { this.template('gae.gradle.ejs', 'gradle/gae.gradle'); } @@ -703,6 +709,7 @@ module.exports = class extends BaseGenerator { }, addDependencies() { + if (this.gaeCloudSQLInstanceNeeded === 'N') return; if (this.prodDatabaseType === 'mysql' || this.prodDatabaseType === 'mariadb') { if (this.buildTool === 'maven') { this.addMavenDependency('com.google.cloud.sql', 'mysql-socket-factory', '1.0.8'); @@ -721,16 +728,20 @@ module.exports = class extends BaseGenerator { addGradlePlugin() { if (this.buildTool === 'gradle') { - this.addGradlePlugin('com.google.cloud.tools', 'appengine-gradle-plugin', '1.3.3'); + if (this.gaeCloudSQLInstanceNeeded === 'Y') { + this.addGradlePlugin('com.google.cloud.tools', 'appengine-gradle-plugin', '1.3.3'); + } this.applyFromGradleScript('gradle/gae'); } }, addMavenPlugin() { if (this.buildTool === 'maven') { - this.render('pom-plugin.xml.ejs', rendered => { - this.addMavenPlugin('com.google.cloud.tools', 'appengine-maven-plugin', '1.3.2', rendered.trim()); - }); + if (this.gaeCloudSQLInstanceNeeded === 'Y') { + this.render('pom-plugin.xml.ejs', rendered => { + this.addMavenPlugin('com.google.cloud.tools', 'appengine-maven-plugin', '1.3.2', rendered.trim()); + }); + } this.render('pom-profile.xml.ejs', rendered => { this.addMavenProfile('prod-gae', ` ${rendered.trim()}`); }); diff --git a/generators/gae/templates/app.yaml.ejs b/generators/gae/templates/app.yaml.ejs index df5bc1a62bcf..67fd9d6b8429 100644 --- a/generators/gae/templates/app.yaml.ejs +++ b/generators/gae/templates/app.yaml.ejs @@ -9,14 +9,12 @@ basic_scaling: <%_ if (gaeMaxInstances > 0) { _%> max_instances: <%= gaeMaxInstances %> <%_ } _%> - <%_ } else if (gaeScalingType === 'automatic') { _%> - +automatic_scaling: <%_ if (gaeMinInstances > 0) { _%> min_instances: <%= gaeMinInstances %> <%_ } _%> <%_ if (gaeMaxInstances > 0) { _%> max_instances: <%= gaeMaxInstances %> <%_ } _%> - <%_ } _%> From cba421c66fc620f71310a5108c9a47a823c611e3 Mon Sep 17 00:00:00 2001 From: SudharakaP Date: Fri, 16 Aug 2019 06:12:30 -0700 Subject: [PATCH 12/13] Revert the change to install openjdk through install-jdk scripts as per review --- generators/ci-cd/templates/travis.yml.ejs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/generators/ci-cd/templates/travis.yml.ejs b/generators/ci-cd/templates/travis.yml.ejs index bec2e64647d8..c87b155a1b66 100644 --- a/generators/ci-cd/templates/travis.yml.ejs +++ b/generators/ci-cd/templates/travis.yml.ejs @@ -18,6 +18,7 @@ -%> os: - linux +dist: bionic services: - docker language: node_js @@ -43,8 +44,6 @@ env: - JHI_DISABLE_WEBPACK_LOGS=true - NG_CLI_ANALYTICS="false" before_install: - - wget https://github.com/sormuras/bach/raw/master/install-jdk.sh - - source install-jdk.sh --feature 11 - java -version - sudo /etc/init.d/mysql stop - sudo /etc/init.d/postgresql stop From 75fecf7b05a8949c0aacb08e21dce592581ccaaf Mon Sep 17 00:00:00 2001 From: SudharakaP Date: Fri, 16 Aug 2019 06:34:44 -0700 Subject: [PATCH 13/13] Change the way jdk installation is done rather than relaying on the default bionic jdk #10175 --- generators/ci-cd/templates/travis.yml.ejs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/generators/ci-cd/templates/travis.yml.ejs b/generators/ci-cd/templates/travis.yml.ejs index c87b155a1b66..5e040d699ac0 100644 --- a/generators/ci-cd/templates/travis.yml.ejs +++ b/generators/ci-cd/templates/travis.yml.ejs @@ -18,7 +18,6 @@ -%> os: - linux -dist: bionic services: - docker language: node_js @@ -44,6 +43,17 @@ env: - JHI_DISABLE_WEBPACK_LOGS=true - NG_CLI_ANALYTICS="false" before_install: + - + if [[ $JHI_JDK = '11' ]]; then + echo '*** Using OpenJDK 11' + sudo add-apt-repository ppa:openjdk-r/ppa + sudo apt-get update + sudo apt-get install -y openjdk-11-jdk + sudo update-java-alternatives -s java-1.11.0-openjdk-amd64 + java -version + else + echo '*** Using OpenJDK 8 by default' + fi - java -version - sudo /etc/init.d/mysql stop - sudo /etc/init.d/postgresql stop