Skip to content

Commit a3259f3

Browse files
committed
---
yaml --- r: 1399 b: refs/heads/master c: 1830275 h: refs/heads/master i: 1397: 5be52de 1395: eb8f2a5 1391: f4e6cd7
1 parent 74ee913 commit a3259f3

133 files changed

Lines changed: 2104 additions & 14943 deletions

File tree

Some content is hidden

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

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 433c2869ef6d8d50516acfe4f7d8f632023ad9e4
2+
refs/heads/master: 18302758569d6a2a094a5a7986e2b10904f48e7a
33
refs/heads/travis: e21ee7b88a5edc3f3d8c71f90c3fc32abf7e8dd6
44
refs/heads/gh-pages: d1b373c30c176edc08692348167bec3a244bb823
55
refs/heads/bigquery: 762fa5830e6c398c0396177e3e7fd243bd62cfc3

trunk/.travis.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ before_install:
1010
install: mvn install -DskipTests=true -Dgpg.skip=true
1111
script:
1212
- utilities/verify.sh
13-
branches:
14-
only:
15-
- master
1613
after_success:
1714
- utilities/after_success.sh
1815
env:

trunk/README.md

Lines changed: 63 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ If you are using Maven, add this to your pom.xml file
2525
<dependency>
2626
<groupId>com.google.gcloud</groupId>
2727
<artifactId>gcloud-java</artifactId>
28-
<version>0.0.10</version>
28+
<version>0.0.12</version>
2929
</dependency>
3030
```
3131
If you are using Gradle, add this to your dependencies
3232
```Groovy
33-
compile 'com.google.gcloud:gcloud-java:jar:0.0.10'
33+
compile 'com.google.gcloud:gcloud-java:jar:0.0.12'
3434
```
3535
If you are using SBT, add this to your dependencies
3636
```Scala
37-
libraryDependencies += "com.google.gcloud" % "gcloud-java" % "0.0.10"
37+
libraryDependencies += "com.google.gcloud" % "gcloud-java" % "0.0.12"
3838
```
3939

4040
Example Applications
@@ -45,15 +45,63 @@ Example Applications
4545
- [`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
4646
- 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).
4747

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:
56+
57+
```java
58+
Datastore datastore = DatastoreOptions.builder().projectId("PROJECT_ID").build().service();
59+
```
60+
* 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+
4875
Authentication
4976
--------------
5077

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:
5281

5382
1. When using `gcloud-java` libraries from within Compute/App Engine, no additional authentication steps are necessary.
5483
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:
86+
```bash
87+
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/my/key.json
88+
```
89+
* 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:
90+
```java
91+
Storage storage = StorageOptions.builder()
92+
.authCredentials(AuthCredentials.createForJson(new FileInputStream("/path/to/my/key.json"))
93+
.build()
94+
.service();
95+
```
96+
* If running locally for development/testing, you can use use Google Cloud SDK. Download the SDK if you haven't already, then login using the SDK (`gcloud auth login` in command line). Be sure to set your project ID as described above.
97+
98+
`gcloud-java` looks for credentials in 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
103+
4. Google Cloud SDK credentials
104+
5. Compute Engine credentials
57105
58106
Google Cloud Datastore
59107
----------------------
@@ -75,7 +123,7 @@ import com.google.gcloud.datastore.Entity;
75123
import com.google.gcloud.datastore.Key;
76124
import com.google.gcloud.datastore.KeyFactory;
77125
78-
Datastore datastore = DatastoreOptions.getDefaultInstance().service();
126+
Datastore datastore = DatastoreOptions.defaultInstance().service();
79127
KeyFactory keyFactory = datastore.newKeyFactory().kind(KIND);
80128
Key key = keyFactory.newKey(keyName);
81129
Entity entity = datastore.get(key);
@@ -118,8 +166,7 @@ import com.google.gcloud.storage.StorageOptions;
118166
import java.nio.ByteBuffer;
119167
import java.nio.channels.WritableByteChannel;
120168
121-
StorageOptions options = StorageOptions.builder().projectId("project").build();
122-
Storage storage = options.service();
169+
Storage storage = StorageOptions.defaultInstance().service();
123170
BlobId blobId = BlobId.of("bucket", "blob_name");
124171
Blob blob = Blob.load(storage, blobId);
125172
if (blob == null) {
@@ -135,6 +182,11 @@ if (blob == null) {
135182
}
136183
```
137184
185+
Troubleshooting
186+
---------------
187+
188+
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+
138190
Java Versions
139191
-------------
140192
@@ -161,7 +213,7 @@ Contributing
161213
162214
Contributions to this library are always welcome and highly encouraged.
163215
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.
165217
166218
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.
167219
@@ -172,7 +224,7 @@ Apache 2.0 - See [LICENSE] for more information.
172224
173225
174226
[CONTRIBUTING]:https://github.com/GoogleCloudPlatform/gcloud-java/blob/master/CONTRIBUTING.md
175-
[code-of-conduct]:https://github.com/GoogleCloudPlatform/gcloud-java/blob/master/CODE_OF_CONDUCT.md
227+
[code-of-conduct]:https://github.com/GoogleCloudPlatform/gcloud-java/blob/master/CODE_OF_CONDUCT.md#contributor-code-of-conduct
176228
[LICENSE]: https://github.com/GoogleCloudPlatform/gcloud-java/blob/master/LICENSE
177229
[TESTING]: https://github.com/GoogleCloudPlatform/gcloud-java/blob/master/TESTING.md
178230
[cloud-platform]: https://cloud.google.com/

trunk/RELEASING.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@ This script takes an optional argument denoting the new version. By default, if
1010
2. Create a PR to update the pom.xml version.
1111
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.
1212

13-
3. Create a release on Github manually.
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.
14+
15+
4. Create a release on Github manually.
1416
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.
1517

16-
4. Run `utilities/update_pom_version.sh` again (to include "-SNAPSHOT" in the project version).
18+
5. Run `utilities/update_pom_version.sh` again (to include "-SNAPSHOT" in the project version).
1719
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`.
1820

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).
21+
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).
2022

2123
### To push a snapshot version
2224

trunk/gcloud-java-bigquery/README.md

Lines changed: 0 additions & 86 deletions
This file was deleted.

trunk/gcloud-java-bigquery/pom.xml

Lines changed: 0 additions & 50 deletions
This file was deleted.

0 commit comments

Comments
 (0)