Skip to content

Commit

Permalink
Use the Java SDK Plugin (#479)
Browse files Browse the repository at this point in the history
1. We want to use the Java SDK plugin for now
  • Loading branch information
lesv authored Jan 9, 2017
1 parent 6efc455 commit df3c6ed
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
12 changes: 9 additions & 3 deletions appengine/cloudsql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,20 @@ Before you can run or deploy the sample, you will need to create a [Cloud SQL in
1. Create a new user and database for the application. The easiest way to do this is via the [Google
Developers Console](https://console.cloud.google.com/sql/instances). Alternatively, you can use MySQL tools such as the command line client or workbench.
2. Change the root password (under Access Control) and / or create a new user / password.
3. Create a Database (under Databases) (or use MySQL with `gcloud sql connect <instance> --user=root`)
3. Create a Database (under Databases) (or use MySQL with `gcloud beta sql connect <instance> --user=root`)
4. Note the **Instance connection name** under Overview > properties
(It will look like project:instance for 1st Generation or project:region:zone for 2nd Generation)

or

```bash
gcloud sql instances describe <instance> | grep connectionName
```

## Deploying

```bash
$ mvn clean appengine:deploy -DINSTANCE_CONNECTION_NAME=instanceConnectionName -Duser=root
$ mvn clean appengine:update -DINSTANCE_CONNECTION_NAME=instanceConnectionName -Duser=root
-Dpassword=myPassword -Ddatabase=myDatabase
```

Expand All @@ -23,7 +29,7 @@ Or you can update the properties in `pom.xml`
## Running locally

```bash
$ mvn clean appengine:run -DINSTANCE_CONNECTION_NAME=instanceConnectionName -Duser=root -Dpassword=myPassowrd -Ddatabase=myDatabase
$ mvn clean appengine:devserver -DINSTANCE_CONNECTION_NAME=instanceConnectionName -Duser=root -Dpassword=myPassowrd -Ddatabase=myDatabase
```
Note - you must use a local mysql instance for the 1st Generation instance and change the local Url
in `src/main/webapp/WEB-INF/appengine-web.xml` to use your local server.
12 changes: 10 additions & 2 deletions appengine/cloudsql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,16 @@
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-api-1.0-sdk</artifactId>
<version>${appengine.sdk.version}</version>
</dependency>

<dependency>
<groupId>com.google.api-client</groupId>
<artifactId>google-api-client-appengine</artifactId>
<version>1.21.0</version>
</dependency>


<!-- [START dependencies] -->
<dependency> <!-- ONLY USED LOCALY -->
<groupId>mysql</groupId>
Expand Down Expand Up @@ -93,18 +101,18 @@
</configuration>
</plugin>

<!--
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>${appengine.maven.plugin}</version>
</plugin>
<!--
-->
<plugin>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>${appengine.sdk.version}</version>
</plugin>
-->
</plugins>
</build>
</project>

0 comments on commit df3c6ed

Please sign in to comment.