Skip to content

Commit fdff896

Browse files
committed
Add templates for READMEs.
This uses https://github.com/jreese/markdown-pp to include markdown from other files. The templates in this repository can also be used in other repositories with the `!INCLUDEURL` directive.
1 parent 83af039 commit fdff896

File tree

6 files changed

+122
-27
lines changed

6 files changed

+122
-27
lines changed

.github/templates/README.md

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Markdown Templates for Google Cloud Platform Samples for Java
2+
3+
The `.mdpp` files in this directory are templates used in READMEs relating to
4+
Google Cloud samples for Java.
5+
6+
## Before you begin
7+
8+
Install [MarkdownPP](https://github.com/jreese/markdown-pp), a preprocessor for
9+
Markdown files. (Requires Python and PIP)
10+
11+
pip install MarkdownPP
12+
13+
## Rendering the templates
14+
15+
for readme in **/README.mdpp; do
16+
(
17+
cd $(dirname "$readme")
18+
markdown-pp README.mdpp -o README.md
19+
)
20+
done
21+
22+
Java is a registered trademark of Oracle Corporation and/or its affiliates.
23+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
## Before you begin
2+
3+
1. Follow the [quickstart for Java in the App Engine flexible
4+
environment](https://cloud.google.com/appengine/docs/flexible/java/quickstart) to
5+
set up your environment to deploy the sample applications App Engine.
6+
1. Download and install the [Google Cloud SDK](https://cloud.google.com/sdk/docs/).
7+
1. [Install and configure Apache Maven](http://maven.apache.org/index.html).
8+
1. [Create a new Google Cloud Platform project, or use an existing
9+
one](https://console.cloud.google.com/project).
10+
1. [Enable billing for your
11+
project](https://support.google.com/cloud/answer/6293499#enable-billing).
12+
1. Initialize the Cloud SDK.
13+
14+
gcloud init
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
## Deploying to App Engine
2+
3+
To run the application locally, use the Maven Jetty plugin.
4+
5+
mvn clean jetty:run-exploded
6+
7+
View the app at [localhost:8080](http://localhost:8080).
8+
9+
To deploy the app to App Engine, run
10+
11+
mvn clean appengine:deploy
12+
13+
After the deploy finishes (can take up to 10 minutes), you can view your application at
14+
`https://YOUR_PROJECT.appspot.com`, where `YOUR_PROJECT` is your Google Cloud project ID. You can
15+
see the new version deployed on the [App Engine section of the Google Cloud
16+
Console](https://console.cloud.google.com/appengine/versions).
17+
18+
For a more detailed walkthrough, see the [getting started
19+
guide for Java in the App Engine flexible
20+
environment](https://cloud.google.com/java/getting-started/hello-world).
21+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## Getting the sample code
2+
3+
Get the latest sample code from GitHub using Git or download the repository as a ZIP file.
4+
([Download](https://github.com/GoogleCloudPlatform/java-docs-samples/archive/master.zip))
5+
6+
git clone https://github.com/GoogleCloudPlatform/java-docs-samples.git
7+

flexible/README.md

+33-27
Original file line numberDiff line numberDiff line change
@@ -9,44 +9,50 @@ scaffolding for other frameworks and use cases.
99

1010
[aeflex-docs]: https://cloud.google.com/appengine/docs/flexible/
1111

12-
## Run Locally
13-
1. Install the [Google Cloud SDK](https://cloud.google.com/sdk/), including the [gcloud tool](https://cloud.google.com/sdk/gcloud/), and [gcloud app component](https://cloud.google.com/sdk/gcloud-app).
14-
1. Setup the gcloud tool.
12+
## Getting the sample code
1513

16-
```
17-
gcloud init
18-
```
14+
Get the latest sample code from GitHub using Git or download the repository as a ZIP file.
15+
([Download](https://github.com/GoogleCloudPlatform/java-docs-samples/archive/master.zip))
1916

20-
1. Clone this repo.
17+
git clone https://github.com/GoogleCloudPlatform/java-docs-samples.git
2118

22-
```
23-
git clone https://github.com/GoogleCloudPlatform/java-docs-samples.git
24-
```
2519

26-
1. Run this project locally from the command line.
20+
## Before you begin
2721

28-
```
29-
mvn clean jetty:run
30-
```
22+
1. Follow the [quickstart for Java in the App Engine flexible
23+
environment](https://cloud.google.com/appengine/docs/flexible/java/quickstart) to
24+
set up your environment to deploy the sample applications App Engine.
25+
1. Download and install the [Google Cloud SDK](https://cloud.google.com/sdk/docs/).
26+
1. [Install and configure Apache Maven](http://maven.apache.org/index.html).
27+
1. [Create a new Google Cloud Platform project, or use an existing
28+
one](https://console.cloud.google.com/project).
29+
1. [Enable billing for your
30+
project](https://support.google.com/cloud/answer/6293499#enable-billing).
31+
1. Initialize the Cloud SDK.
3132

32-
1. Visit the application at [http://localhost:8080](http://localhost:8080).
33+
gcloud init
3334

34-
## Deploying
35+
## Deploying to App Engine
3536

36-
1. Use the [Cloud Developer Console](https://console.developer.google.com) to create a project/app id. (App id and project id are identical)
37-
1. Setup the gcloud tool.
37+
To run the application locally, use the Maven Jetty plugin.
3838

39-
```
40-
gcloud init
41-
```
42-
1. Use the [Admin Console](https://appengine.google.com) to view data, queues, and other App Engine specific administration tasks.
43-
1. Use gcloud to deploy your app.
39+
mvn clean jetty:run
4440

45-
```
46-
mvn clean gcloud:deploy
47-
```
41+
View the app at [localhost:8080](http://localhost:8080).
42+
43+
To deploy the app to App Engine, run
44+
45+
mvn clean appengine:deploy
46+
47+
After the deploy finishes (can take up to 10 minutes), you can view your application at
48+
`https://YOUR_PROJECT.appspot.com`, where `YOUR_PROJECT` is your Google Cloud project ID. You can
49+
see the new version deployed on the [App Engine section of the Google Cloud
50+
Console](https://console.cloud.google.com/appengine/versions).
51+
52+
For a more detailed walkthrough, see the [getting started
53+
guide for Java in the App Engine flexible
54+
environment](https://cloud.google.com/java/getting-started/hello-world).
4855

49-
1. Congratulations! Your application is now live at your-app-id.appspot.com
5056

5157
## Contributing changes
5258

flexible/README.mdpp

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Google App Engine Flexible Environment Java Samples
2+
3+
This is a repository that contains Java code samples for [Google App Engine
4+
flexible environment][aeflex-docs].
5+
6+
See our other [Google Cloud Platform GitHub
7+
repos](https://github.com/GoogleCloudPlatform) for sample applications and
8+
scaffolding for other frameworks and use cases.
9+
10+
[aeflex-docs]: https://cloud.google.com/appengine/docs/flexible/
11+
12+
!INCLUDE "../.github/templates/getting-sample-code.mdpp"
13+
14+
!INCLUDE "../.github/templates/appengine-flexible-before-you-begin.mdpp"
15+
16+
!INCLUDE "../.github/templates/appengine-flexible-deploy.mdpp"
17+
18+
## Contributing changes
19+
20+
* See [CONTRIBUTING.md](CONTRIBUTING.md)
21+
22+
## Licensing
23+
24+
* See [LICENSE](LICENSE)

0 commit comments

Comments
 (0)