Skip to content

Commit d6f6cfd

Browse files
authored
Merge pull request #97 from GoogleCloudPlatform/fix_environment_variables
Fix environment variables (updated run-all.sh, circleci, and travis to reflect changes)
2 parents 86e7d88 + bbe3168 commit d6f6cfd

File tree

27 files changed

+69
-82
lines changed

27 files changed

+69
-82
lines changed

.travis.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ cache:
2727
- vendor/bundle
2828

2929
env:
30-
global:
31-
- GOOGLE_APPLICATION_CREDENTIALS=$TRAVIS_BUILD_DIR/client_secrets.json
3230
matrix:
3331
- TEST_DIR=storage
3432
- TEST_DIR=pubsub
@@ -43,8 +41,7 @@ env:
4341
- TEST_DIR=vision
4442

4543
before_install:
46-
- openssl aes-256-cbc -K $encrypted_aeb4e2af7332_key -iv $encrypted_aeb4e2af7332_iv
47-
-in client_secrets.json.enc -out client_secrets.json -d
44+
- echo $GOOGLE_APPLICATION_CREDENTIALS_JSON | base64 --decode > $HOME/service-account.json
4845

4946
install:
5047
- cd $TEST_DIR

appengine/datastore/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ project id with `gcloud config list`.
1515

1616

1717
```
18-
export GCLOUD_PROJECT=<your-project-id>
18+
export GOOGLE_CLOUD_PROJECT=<your-project-id>
1919
bundle
2020
bundle exec ruby ./app.rb
2121
```

appengine/pubsub/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ string.
3434
```
3535
export PUBSUB_VERIFICATION_TOKEN=<your-token>
3636
export PUBSUB_TOPIC=<your-topic-name>
37-
export GCLOUD_PROJECT=<your-project-id>
37+
export GOOGLE_CLOUD_PROJECT=<your-project-id>
3838
bundle
3939
bundle exec ruby ./app.rb
4040
```
@@ -65,7 +65,7 @@ your repo.
6565

6666
```
6767
gcloud auth activate-service-account --key-file ../../client_secrets.json
68-
export GCLOUD_PROJECT=<your-project-id>
68+
export GOOGLE_CLOUD_PROJECT=<your-project-id>
6969
export TEST_DIR=appengine/pubsub/
7070
bundle exec rspec
7171
```

appengine/storage/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ $ gsutil mb gs://<your-project-id>
2323
## Run
2424

2525
```
26-
export GCLOUD_PROJECT=<your-project-id>
27-
export GCLOUD_STORAGE_BUCKET=<your-project-id>
26+
export GOOGLE_CLOUD_PROJECT=<your-project-id>
27+
export GOOGLE_CLOUD_STORAGE_BUCKET=<your-project-id>
2828
bundle
2929
bundle exec ruby app.rb
3030
```
@@ -52,7 +52,7 @@ your repo.
5252

5353
```
5454
gcloud auth activate-service-account --key-file ../../client_secrets.json
55-
export GCLOUD_PROJECT=<your-project-id>
55+
export GOOGLE_CLOUD_PROJECT=<your-project-id>
5656
export TEST_DIR=appengine/storage/
5757
bundle exec rspec
5858
```

appengine/storage/app.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
gcloud = Google::Cloud.new
2020
storage = gcloud.storage
21-
bucket = storage.bucket ENV["GCLOUD_STORAGE_BUCKET"]
21+
bucket = storage.bucket ENV["GOOGLE_CLOUD_STORAGE_BUCKET"]
2222

2323
get "/" do
2424
# Present the user with an upload form

appengine/storage/app.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ vm: true
1818
entrypoint: bundle exec ruby app.rb -p 8080
1919

2020
env_variables:
21-
GCLOUD_STORAGE_BUCKET: <your-bucket-name>
21+
GOOGLE_CLOUD_STORAGE_BUCKET: <your-bucket-name>
2222
# [END app_yaml]

appengine/storage/spec/storage_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
before :all do
2424
app_yaml = File.expand_path("../../app.yaml", __FILE__)
2525
configuration = File.read(app_yaml)
26-
.sub("<your-bucket-name>", ENV["GCLOUD_STORAGE_BUCKET"])
26+
.sub("<your-bucket-name>", ENV["GOOGLE_CLOUD_STORAGE_BUCKET"])
2727
File.write(app_yaml, configuration)
2828

2929
@url = E2E.url

bigquery/spec/bigquery_sample_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
describe "Google Cloud BigQuery samples" do
2222

2323
before do
24-
@project_id = ENV["GOOGLE_PROJECT_ID"]
24+
@project_id = ENV["GOOGLE_CLOUD_PROJECT"]
2525
@gcloud = Google::Cloud.new @project_id
2626
@bigquery = @gcloud.bigquery
2727
@storage = @gcloud.storage
28-
@bucket = @storage.bucket ENV["STORAGE_BUCKET"]
28+
@bucket = @storage.bucket ENV["GOOGLE_CLOUD_STORAGE_BUCKET"]
2929
@tempfiles = []
3030

3131
# Examples assume that newly created test_dataset and test_table exist

client_secrets.json.enc

-2.31 KB
Binary file not shown.

datastore/spec/sample_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
attr_reader :datastore
2020

2121
before :all do
22-
@gcloud = Google::Cloud.new
22+
@gcloud = Google::Cloud.new ENV["GOOGLE_CLOUD_PROJECT"]
2323
@datastore = @gcloud.datastore
2424

2525
task_list = datastore.entity "TaskList", "default"

0 commit comments

Comments
 (0)