You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[`StorageExample`](https://github.com/GoogleCloudPlatform/gcloud-java/blob/master/gcloud-java-examples/src/main/java/com/google/gcloud/examples/StorageExample.java) - A simple command line interface providing some of Cloud Storage's functionality
46
46
- Read more about using this application on the [`gcloud-java-examples` docs page](http://googlecloudplatform.github.io/gcloud-java/apidocs/?com/google/gcloud/examples/StorageExample.html).
47
47
48
+
Specifying a Project ID
49
+
-----------------------
50
+
51
+
Most `gcloud-java` libraries require a project ID. There are multiple ways to specify this project ID.
52
+
53
+
1. When using `gcloud-java` libraries from within Compute/App Engine, there's no need to specify a project ID. It is automatically inferred from the production environment.
54
+
2. When using `gcloud-java` elsewhere, you can do one of the following:
55
+
* Supply the project ID when building the service options. For example, to use Datastore from a project with ID "PROJECT_ID", you can write:
* Specify the environment variable `GCLOUD_PROJECT` to be your desired project ID.
61
+
* Set the project ID using the [Google Cloud SDK](https://cloud.google.com/sdk/?hl=en). To use the SDK, [download the SDK](https://cloud.google.com/sdk/?hl=en) if you haven't already, and set the project ID from the command line. For example:
62
+
63
+
```
64
+
gcloud config set project PROJECT_ID
65
+
```
66
+
67
+
`gcloud-java` determines the project ID from the following sources in the listed order, stopping once it finds a value:
68
+
69
+
1. Project ID supplied when building the service options
70
+
2. Project ID specified by the environment variable `GCLOUD_PROJECT`
71
+
3. App Engine project ID
72
+
4. Google Cloud SDK project ID
73
+
5. Compute Engine project ID
74
+
48
75
Authentication
49
76
--------------
50
77
51
-
There are multiple ways to authenticate to use Google Cloud services.
78
+
First, ensure that the necessary Google Cloud APIs are enabled for your project. To do this, follow the instructions on the [authentication document](https://github.com/GoogleCloudPlatform/gcloud-common/blob/master/authentication/readme.md#authentication) shared by all the gcloud language libraries.
79
+
80
+
Next, choose a method for authenticating API requests from within your project:
52
81
53
82
1. When using `gcloud-java` libraries from within Compute/App Engine, no additional authentication steps are necessary.
54
83
2. When using `gcloud-java` libraries elsewhere, there are two options:
55
-
*[Generate a JSON service account key](https://cloud.google.com/storage/docs/authentication?hl=en#service_accounts). Supply a path to the downloaded JSON credentials file when building the options supplied to datastore/storage constructor.
56
-
* If running locally for development/testing, you can use use [Google Cloud SDK](https://cloud.google.com/sdk/?hl=en). To use the SDK authentication, [download the SDK](https://cloud.google.com/sdk/?hl=en) if you haven't already. Then login using the SDK (`gcloud auth login` in command line), and set your current project using `gcloud config set project PROJECT_ID`.
84
+
*[Generate a JSON service account key](https://cloud.google.com/storage/docs/authentication?hl=en#service_accounts). After downloading that key, you must do one of the following:
85
+
* Define the environment variable GOOGLE_APPLICATION_CREDENTIALS to be the location of the key. For example:
* Supply the JSON credentials file when building the service options. For example, this Storage object has the necessary permissions to interact with your Google Cloud Storage data:
* If running locally fordevelopment/testing, you can use use Google Cloud SDK. Download the SDK if you haven't already, then login using the SDK (`gcloud auth login`incommand line). Be sure to set your project ID as described above.
97
+
98
+
`gcloud-java` looks forcredentialsin the following order, stopping once it finds credentials:
99
+
100
+
1. Credentials supplied when building the service options
101
+
2. App Engine credentials
102
+
3. Key file pointed to by the GOOGLE_APPLICATION_CREDENTIALS environment variable
To get help, follow the `gcloud-java` links in the `gcloud-*` [shared Troubleshooting document](https://github.com/GoogleCloudPlatform/gcloud-common/blob/master/troubleshooting/readme.md#troubleshooting).
189
+
138
190
Java Versions
139
191
-------------
140
192
@@ -161,7 +213,7 @@ Contributing
161
213
162
214
Contributions to this library are always welcome and highly encouraged.
163
215
164
-
See [CONTRIBUTING] for more information on how to get started.
216
+
See `gcloud-java`'s [CONTRIBUTING] documentation and the `gcloud-*` [shared documentation](https://github.com/GoogleCloudPlatform/gcloud-common/blob/master/contributing/readme.md#how-to-contribute-to-gcloud) for more information on how to get started.
165
217
166
218
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more information.
167
219
@@ -172,7 +224,7 @@ Apache 2.0 - See [LICENSE] for more information.
Copy file name to clipboardExpand all lines: RELEASING.md
+12-4Lines changed: 12 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,13 +10,21 @@ This script takes an optional argument denoting the new version. By default, if
10
10
2. Create a PR to update the pom.xml version.
11
11
The PR should look something like [#225](https://github.com/GoogleCloudPlatform/gcloud-java/pull/225). After this PR is merged into GoogleCloudPlatform/gcloud-java, Travis CI will push a new website to GoogleCloudPlatform/gh-pages, push a new artifact to the Maven Central Repository, and update versions in the README files.
12
12
13
-
3. Create a release on Github manually.
14
-
Go to the [releases page](https://github.com/GoogleCloudPlatform/gcloud-java/releases) and click "Draft a new release." Use `vX.Y.Z` as the "Tag Version" and `X.Y.Z` as the "Release Title", where `X.Y.Z` is the release version as listed in the `pom.xml` files.
13
+
3. Before moving on, verify that the artifacts have successfully been pushed to the Maven Central Repository. Open Travis CI, click the ["Build History" tab](https://travis-ci.org/GoogleCloudPlatform/gcloud-java/builds), and open the second build's logs for Step 2's PR. Be sure that you are not opening the "Pull Request" build logs. When the build finishes, scroll to the end of the log and verify that the artifacts were successfully staged and deployed. You can also search for `gcloud-java` on the [Sonatype website](https://oss.sonatype.org/#nexus-search;quick~gcloud-java) and check the latest version number. If the deployment didn't succeed because of a flaky test, rerun the build.
15
14
16
-
4. Run `utilities/update_pom_version.sh` again (to include "-SNAPSHOT" in the project version).
15
+
4. Publish a release on Github manually.
16
+
Go to the [releases page](https://github.com/GoogleCloudPlatform/gcloud-java/releases) and open the appropriate release draft. Make sure the "Tag Version" is `vX.Y.Z` and the "Release Title" is `X.Y.Z`, where `X.Y.Z` is the release version as listed in the `pom.xml` files. The draft should already have all changes that impact users since the previous release. To double check this, you can use the `git log` command and look through the merged master branch pull requests. Here is an example of the log command to get non-merge commits between v0.0.12 and v0.1.0:
Ensure that the format is consistent with previous releases (for an example, see the [0.1.0 release](https://github.com/GoogleCloudPlatform/gcloud-java/releases/tag/v0.1.0)). After adding any missing updates and reformatting as necessary, publish the draft. Finally, create a new draft for the next release.
23
+
24
+
5. Run `utilities/update_pom_version.sh` again (to include "-SNAPSHOT" in the project version).
17
25
As mentioned before, there is an optional version argument. By default, the script will update the version from "X.Y.Z" to "X.Y.Z+1-SNAPSHOT". Suppose a different version is desired, for example X+1.0.0-SNAPSHOT. Then the appropriate command to run would be `utilities/update_pom_version.sh X+1.0.0-SNAPSHOT`.
18
26
19
-
5. Create and merge in another PR to reflect the updated project version. For an example of what this PR should look like, see [#227](https://github.com/GoogleCloudPlatform/gcloud-java/pull/227).
27
+
6. Create and merge in another PR to reflect the updated project version. For an example of what this PR should look like, see [#227](https://github.com/GoogleCloudPlatform/gcloud-java/pull/227).
To get help, follow the `gcloud-java` links in the `gcloud-*`[shared Troubleshooting document](https://github.com/GoogleCloudPlatform/gcloud-common/blob/master/troubleshooting/readme.md#troubleshooting).
36
+
32
37
Java Versions
33
38
-------------
34
39
@@ -39,7 +44,9 @@ Contributing
39
44
40
45
Contributions to this library are always welcome and highly encouraged.
41
46
42
-
See [CONTRIBUTING] for more information on how to get started.
47
+
See `gcloud-java`'s [CONTRIBUTING] documentation and the `gcloud-*`[shared documentation](https://github.com/GoogleCloudPlatform/gcloud-common/blob/master/contributing/readme.md#how-to-contribute-to-gcloud) for more information on how to get started.
48
+
49
+
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more information.
43
50
44
51
Versioning
45
52
----------
@@ -57,5 +64,6 @@ Apache 2.0 - See [LICENSE] for more information.
0 commit comments