Skip to content

Commit 96699cc

Browse files
author
Les Vogel
committed
update to env-flex
1. app.yaml -> env:flex 2. remove any compat samples 3. Make sure we use new appengine & jetty plugins 4. Update artivactId’s and groupId’s to flexible where appropriate TODO: [] flexible/async-rest - shouldn’t be using Docker [] flexible/endpoints - does appengine:deploy work? [] flexible/* - See if we really want to use EnvVar’s to pass values, perhaps we should modify to use web.xml context vars. [] flexible/memcache — NEED WORK
1 parent c044248 commit 96699cc

File tree

64 files changed

+285
-305
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+285
-305
lines changed

flexible/analytics/pom.xml

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
<modelVersion>4.0.0</modelVersion>
1818
<packaging>war</packaging>
1919
<version>1.0-SNAPSHOT</version>
20-
<groupId>com.example.managedvms</groupId>
21-
<artifactId>managed-vms-analytics</artifactId>
20+
<groupId>com.example.flexible</groupId>
21+
<artifactId>flexible-analytics</artifactId>
2222

2323
<parent>
2424
<artifactId>doc-samples</artifactId>
@@ -30,11 +30,17 @@
3030
<properties>
3131
<maven.compiler.target>1.8</maven.compiler.target>
3232
<maven.compiler.source>1.8</maven.compiler.source>
33-
<maven-war-plugin-version>3.0.0</maven-war-plugin-version>
34-
<gcloud-maven-plugin-version>2.0.9.121.v20160815</gcloud-maven-plugin-version>
35-
<jetty-maven-plugin-version>9.3.7.v20160115</jetty-maven-plugin-version>
33+
34+
<appengine.maven.plugin>1.0.0</appengine.maven.plugin>
35+
<jetty.maven.plugin>9.3.8.v20160314</jetty.maven.plugin>
36+
37+
<failOnMissingWebXml>false</failOnMissingWebXml> <!-- REQUIRED -->
3638
</properties>
3739

40+
<prerequisites> <!-- Optional, but suggested -->
41+
<maven>3.3.9</maven> <!-- Recommended minimum maven version -->
42+
</prerequisites>
43+
3844
<dependencies>
3945
<dependency>
4046
<groupId>org.apache.httpcomponents</groupId>
@@ -54,22 +60,17 @@
5460
<outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>
5561
<plugins>
5662
<plugin>
57-
<groupId>com.google.appengine</groupId>
58-
<artifactId>gcloud-maven-plugin</artifactId>
59-
<version>${gcloud-maven-plugin-version}</version>
60-
</plugin>
61-
<plugin>
62-
<groupId>org.apache.maven.plugins</groupId>
63-
<artifactId>maven-war-plugin</artifactId>
64-
<version>${maven-war-plugin-version}</version>
63+
<groupId>com.google.cloud.tools</groupId>
64+
<artifactId>appengine-maven-plugin</artifactId>
65+
<version>${appengine.maven.plugin}</version>
6566
<configuration>
66-
<failOnMissingWebXml>false</failOnMissingWebXml>
6767
</configuration>
6868
</plugin>
69+
6970
<plugin>
7071
<groupId>org.eclipse.jetty</groupId>
7172
<artifactId>jetty-maven-plugin</artifactId>
72-
<version>${jetty-maven-plugin-version}</version>
73+
<version>${jetty.maven.plugin}</version>
7374
</plugin>
7475
</plugins>
7576
</build>

flexible/analytics/src/main/appengine/app.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
runtime: java
2-
vm: true
2+
env: flex
33

44
handlers:
55
- url: /.*

flexible/analytics/src/main/java/com/example/managedvms/analytics/AnalyticsServlet.java renamed to flexible/analytics/src/main/java/com/example/analytics/AnalyticsServlet.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package com.example.managedvms.analytics;
17+
package com.example.analytics;
1818

1919
import org.apache.http.client.HttpClient;
2020
import org.apache.http.client.methods.HttpPost;

flexible/async-rest/pom.xml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<project>
1818
<modelVersion>4.0.0</modelVersion>
1919
<groupId>com.google.appengine.demos</groupId>
20-
<artifactId>managed-vms-async-rest</artifactId>
20+
<artifactId>async-rest</artifactId>
2121
<version>1.0.0-SNAPSHOT</version>
2222
<packaging>war</packaging>
2323

@@ -29,11 +29,14 @@
2929
</parent>
3030

3131
<properties>
32+
<places.appkey>YOUR_PLACES_APP_KEY</places.appkey>
33+
3234
<appengine.maven.plugin>1.0.0</appengine.maven.plugin>
3335
<jetty.version>9.3.8.v20160314</jetty.version>
36+
3437
<maven.compiler.target>1.8</maven.compiler.target>
3538
<maven.compiler.source>1.8</maven.compiler.source>
36-
<places.appkey>YOUR_PLACES_APP_KEY</places.appkey>
39+
<failOnMissingWebXml>false</failOnMissingWebXml> <!-- REQUIRED -->
3740
</properties>
3841
<build>
3942
<plugins>
@@ -54,10 +57,6 @@
5457
<groupId>com.google.cloud.tools</groupId>
5558
<artifactId>appengine-maven-plugin</artifactId>
5659
<version>${appengine.maven.plugin}</version>
57-
<configuration>
58-
<deploy.promote>true</deploy.promote>
59-
<deploy.stopPreviousVersion>true</deploy.stopPreviousVersion>
60-
</configuration>
6160
</plugin>
6261
<plugin>
6362
<groupId>org.apache.maven.plugins</groupId>

flexible/async-rest/src/main/appengine/app.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414
# [START appyaml]
1515
runtime: custom
16-
vm: true
16+
env: flex
1717

1818
handlers:
1919
- url: /.*
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
FROM gcr.io/google_appengine/jetty9
2-
#FROM gcr.io/YOUR_PROJECT/jetty9
3-
ADD managed-vms-async-rest-1.0.0-SNAPSHOT.war $JETTY_BASE/webapps/root.war
2+
3+
ADD async-rest-1.0.0-SNAPSHOT.war $JETTY_BASE/webapps/root.war
44
ADD jetty-logging.properties $JETTY_BASE/resources/jetty-logging.properties
55
RUN chown jetty:jetty $JETTY_BASE/webapps/root.war $JETTY_BASE/resources/jetty-logging.properties
66
WORKDIR $JETTY_BASE
7-
#RUN java -jar $JETTY_HOME/start.jar --approve-all-licenses --add-to-startd=jmx,stats,hawtio
7+
#RUN java -jar $JETTY_HOME/start.jar --approve-all-licenses --add-to-startd=jmx,stats,hawtio
88

flexible/cloudsql/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ Before you can run or deploy the sample, you will need to do the following:
2929
$ mvn clean jetty:run
3030

3131
## Deploying
32-
$ mvn clean gcloud:deploy
32+
$ mvn clean appengine:deploy

flexible/cloudsql/pom.xml

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
<modelVersion>4.0.0</modelVersion>
1818
<packaging>war</packaging>
1919
<version>1.0-SNAPSHOT</version>
20-
<groupId>com.example.managedvms</groupId>
21-
<artifactId>managed-vms-cloudsql</artifactId>
20+
<groupId>com.example.flexible</groupId>
21+
<artifactId>flexible-cloudsql</artifactId>
2222

2323
<parent>
2424
<artifactId>doc-samples</artifactId>
@@ -30,9 +30,11 @@
3030
<properties>
3131
<maven.compiler.target>1.8</maven.compiler.target>
3232
<maven.compiler.source>1.8</maven.compiler.source>
33-
<maven-war-plugin-version>3.0.0</maven-war-plugin-version>
34-
<gcloud-maven-plugin-version>2.0.9.121.v20160815</gcloud-maven-plugin-version>
35-
<jetty-maven-plugin-version>9.3.7.v20160115</jetty-maven-plugin-version>
33+
34+
<appengine.maven.plugin>1.0.0</appengine.maven.plugin>
35+
<jetty.maven.plugin>9.3.8.v20160314</jetty.maven.plugin>
36+
37+
<failOnMissingWebXml>false</failOnMissingWebXml> <!-- REQUIRED -->
3638
</properties>
3739

3840
<dependencies>
@@ -56,22 +58,17 @@
5658
<outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>
5759
<plugins>
5860
<plugin>
59-
<groupId>com.google.appengine</groupId>
60-
<artifactId>gcloud-maven-plugin</artifactId>
61-
<version>${gcloud-maven-plugin-version}</version>
62-
</plugin>
63-
<plugin>
64-
<groupId>org.apache.maven.plugins</groupId>
65-
<artifactId>maven-war-plugin</artifactId>
66-
<version>${maven-war-plugin-version}</version>
61+
<groupId>com.google.cloud.tools</groupId>
62+
<artifactId>appengine-maven-plugin</artifactId>
63+
<version>${appengine.maven.plugin}</version>
6764
<configuration>
68-
<failOnMissingWebXml>false</failOnMissingWebXml>
6965
</configuration>
7066
</plugin>
67+
7168
<plugin>
7269
<groupId>org.eclipse.jetty</groupId>
7370
<artifactId>jetty-maven-plugin</artifactId>
74-
<version>${jetty-maven-plugin-version}</version>
71+
<version>${jetty.maven.plugin}</version>
7572
</plugin>
7673
</plugins>
7774
</build>

flexible/cloudsql/src/main/appengine/app.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ handlers:
2121
secure: always
2222

2323
# [START env_variables]
24+
# YOUR-INSTANCE-NAME is ProjectID:Region:DbInstance
25+
# YOUR-DB-NAME is your DatabaseName
2426
env_variables:
2527
SQL_URL: jdbc:mysql://google/YOUR-DB-NAME?cloudSqlInstance=YOUR-INSTANCE-NAME&socketFactory=com.google.cloud.sql.mysql.SocketFactory&user=USERNAME&password=PASSWORD
2628
# [END env_variables]

flexible/cloudsql/src/main/java/com/example/managedvms/cloudsql/CloudSqlServlet.java renamed to flexible/cloudsql/src/main/java/com/example/cloudsql/CloudSqlServlet.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package com.example.managedvms.cloudsql;
17+
package com.example.cloudsql;
1818

1919
import java.io.IOException;
2020
import java.io.PrintWriter;

flexible/cloudstorage/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ Before you can run or deploy the sample, you will need to do the following:
2222
$ mvn clean jetty:run
2323

2424
## Deploying
25-
$ mvn clean gcloud:deploy
25+
$ mvn clean appengine:deploy

flexible/cloudstorage/pom.xml

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
<modelVersion>4.0.0</modelVersion>
1818
<packaging>war</packaging>
1919
<version>1.0-SNAPSHOT</version>
20-
<groupId>com.example.managedvms</groupId>
21-
<artifactId>managed-vms-cloudstorage</artifactId>
20+
<groupId>com.example.flexible</groupId>
21+
<artifactId>flexible-cloudstorage</artifactId>
2222

2323
<parent>
2424
<artifactId>doc-samples</artifactId>
@@ -30,9 +30,11 @@
3030
<properties>
3131
<maven.compiler.target>1.8</maven.compiler.target>
3232
<maven.compiler.source>1.8</maven.compiler.source>
33-
<maven-war-plugin-version>3.0.0</maven-war-plugin-version>
34-
<gcloud-maven-plugin-version>2.0.9.121.v20160815</gcloud-maven-plugin-version>
35-
<jetty-maven-plugin-version>9.3.7.v20160115</jetty-maven-plugin-version>
33+
34+
<appengine.maven.plugin>1.0.0</appengine.maven.plugin>
35+
<jetty.maven.plugin>9.3.8.v20160314</jetty.maven.plugin>
36+
37+
<failOnMissingWebXml>false</failOnMissingWebXml> <!-- REQUIRED -->
3638
</properties>
3739

3840
<dependencies>
@@ -56,22 +58,17 @@
5658
<outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>
5759
<plugins>
5860
<plugin>
59-
<groupId>com.google.appengine</groupId>
60-
<artifactId>gcloud-maven-plugin</artifactId>
61-
<version>${gcloud-maven-plugin-version}</version>
62-
</plugin>
63-
<plugin>
64-
<groupId>org.apache.maven.plugins</groupId>
65-
<artifactId>maven-war-plugin</artifactId>
66-
<version>${maven-war-plugin-version}</version>
61+
<groupId>com.google.cloud.tools</groupId>
62+
<artifactId>appengine-maven-plugin</artifactId>
63+
<version>${appengine.maven.plugin}</version>
6764
<configuration>
68-
<failOnMissingWebXml>false</failOnMissingWebXml>
6965
</configuration>
7066
</plugin>
67+
7168
<plugin>
7269
<groupId>org.eclipse.jetty</groupId>
7370
<artifactId>jetty-maven-plugin</artifactId>
74-
<version>${jetty-maven-plugin-version}</version>
71+
<version>${jetty.maven.plugin}</version>
7572
</plugin>
7673
</plugins>
7774
</build>

flexible/cloudstorage/src/main/appengine/app.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
runtime: java
2-
vm: true
2+
env: flex
33

44
handlers:
55
- url: /.*
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package com.example.managedvms.cloudstorage;
17+
package com.example.cloudstorage;
1818

1919
import com.google.cloud.storage.Acl;
2020
import com.google.cloud.storage.Blob;

flexible/cron/pom.xml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@
3030
<properties>
3131
<maven.compiler.target>1.8</maven.compiler.target>
3232
<maven.compiler.source>1.8</maven.compiler.source>
33-
<maven-war-plugin-version>3.0.0</maven-war-plugin-version>
34-
<gcloud-maven-plugin-version>2.0.9.121.v20160815</gcloud-maven-plugin-version>
35-
<jetty-maven-plugin-version>9.3.7.v20160115</jetty-maven-plugin-version>
33+
34+
<appengine.maven.plugin>1.0.0</appengine.maven.plugin>
35+
<jetty.maven.plugin>9.3.8.v20160314</jetty.maven.plugin>
36+
37+
<failOnMissingWebXml>false</failOnMissingWebXml> <!-- REQUIRED -->
3638
</properties>
3739

3840
<!-- [START dependencies] -->
@@ -52,22 +54,17 @@
5254
<outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>
5355
<plugins>
5456
<plugin>
55-
<groupId>com.google.appengine</groupId>
56-
<artifactId>gcloud-maven-plugin</artifactId>
57-
<version>${gcloud-maven-plugin-version}</version>
58-
</plugin>
59-
<plugin>
60-
<groupId>org.apache.maven.plugins</groupId>
61-
<artifactId>maven-war-plugin</artifactId>
62-
<version>${maven-war-plugin-version}</version>
57+
<groupId>com.google.cloud.tools</groupId>
58+
<artifactId>appengine-maven-plugin</artifactId>
59+
<version>${appengine.maven.plugin}</version>
6360
<configuration>
64-
<failOnMissingWebXml>false</failOnMissingWebXml>
6561
</configuration>
6662
</plugin>
63+
6764
<plugin>
6865
<groupId>org.eclipse.jetty</groupId>
6966
<artifactId>jetty-maven-plugin</artifactId>
70-
<version>${jetty-maven-plugin-version}</version>
67+
<version>${jetty.maven.plugin}</version>
7168
</plugin>
7269
</plugins>
7370
</build>

flexible/cron/src/main/appengine/app.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
runtime: java
2-
vm: true
2+
env: flex
33

44
handlers:
55
- url: /.*

flexible/cron/src/main/java/com/example/managedvms/cron/CronServlet.java renamed to flexible/cron/src/main/java/com/example/cron/CronServlet.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package com.example.managedvms.cron;
17+
package com.example.cron;
1818

1919
import java.io.IOException;
2020
import java.io.PrintWriter;

flexible/datastore/pom.xml

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
<modelVersion>4.0.0</modelVersion>
1818
<packaging>war</packaging>
1919
<version>1.0-SNAPSHOT</version>
20-
<groupId>com.example.managedvms</groupId>
21-
<artifactId>managed-vms-datastore</artifactId>
20+
<groupId>com.example.flexible</groupId>
21+
<artifactId>flexible-datastore</artifactId>
2222

2323
<parent>
2424
<artifactId>doc-samples</artifactId>
@@ -30,9 +30,11 @@
3030
<properties>
3131
<maven.compiler.target>1.8</maven.compiler.target>
3232
<maven.compiler.source>1.8</maven.compiler.source>
33-
<maven-war-plugin-version>3.0.0</maven-war-plugin-version>
34-
<gcloud-maven-plugin-version>2.0.9.121.v20160815</gcloud-maven-plugin-version>
35-
<jetty-maven-plugin-version>9.3.7.v20160115</jetty-maven-plugin-version>
33+
34+
<appengine.maven.plugin>1.0.0</appengine.maven.plugin>
35+
<jetty.maven.plugin>9.3.8.v20160314</jetty.maven.plugin>
36+
37+
<failOnMissingWebXml>false</failOnMissingWebXml> <!-- REQUIRED -->
3638
</properties>
3739

3840
<dependencies>
@@ -56,22 +58,17 @@
5658
<outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>
5759
<plugins>
5860
<plugin>
59-
<groupId>com.google.appengine</groupId>
60-
<artifactId>gcloud-maven-plugin</artifactId>
61-
<version>${gcloud-maven-plugin-version}</version>
62-
</plugin>
63-
<plugin>
64-
<groupId>org.apache.maven.plugins</groupId>
65-
<artifactId>maven-war-plugin</artifactId>
66-
<version>${maven-war-plugin-version}</version>
61+
<groupId>com.google.cloud.tools</groupId>
62+
<artifactId>appengine-maven-plugin</artifactId>
63+
<version>${appengine.maven.plugin}</version>
6764
<configuration>
68-
<failOnMissingWebXml>false</failOnMissingWebXml>
6965
</configuration>
7066
</plugin>
67+
7168
<plugin>
7269
<groupId>org.eclipse.jetty</groupId>
7370
<artifactId>jetty-maven-plugin</artifactId>
74-
<version>${jetty-maven-plugin-version}</version>
71+
<version>${jetty.maven.plugin}</version>
7572
</plugin>
7673
</plugins>
7774
</build>

0 commit comments

Comments
 (0)