Skip to content

Commit

Permalink
Add Google Cloud Storage credentials to .travis.yml (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
BenFradet committed Nov 12, 2018
1 parent b0e6ccc commit a722f64
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
15 changes: 8 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
language: scala
services:
- docker
- docker
scala:
- 2.11.12
- 2.11.12
jdk:
- oraclejdk8
before_install:
- openssl aes-256-cbc -K $encrypted_a1a0961ea86f_key -iv $encrypted_a1a0961ea86f_iv -in service-account.json.enc -out ${HOME}/service-account.json -d
script:
- sbt test
- sbt test
before_deploy:
- pip install --user release-manager==0.3.0
- pip install --user release-manager==0.3.0
deploy:
- provider: script
skip_cleanup: true
script: ./.travis/deploy_template.sh $TRAVIS_TAG
script: "./.travis/deploy_template.sh $TRAVIS_TAG"
on:
tags: true
- provider: script
Expand All @@ -22,7 +24,7 @@ deploy:
tags: true
- provider: script
skip_cleanup: true
script: ./.travis/deploy_docker.sh $TRAVIS_TAG
script: "./.travis/deploy_docker.sh $TRAVIS_TAG"
on:
tags: true
env:
Expand All @@ -31,4 +33,3 @@ global:
- BINTRAY_SNOWPLOW_GENERIC_API_KEY
- BINTRAY_SNOWPLOW_DOCKER_USER
- BINTRAY_SNOWPLOW_DOCKER_API_KEY
- GCP_CREDENTIALS
12 changes: 5 additions & 7 deletions .travis/deploy_template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,17 @@

tag=$1

GOOGLE_APPLICATION_CREDENTIALS="${HOME}/credentials.json"
echo ${GCP_CREDENTIALS} > ${GOOGLE_APPLICATION_CREDENTIALS}
export GOOGLE_APPLICATION_CREDENTIALS
export GOOGLE_APPLICATION_CREDENTIALS="${HOME}/service-account.json"

cd ${TRAVIS_BUILD_DIR}

project_version=$(sbt -no-colors version | perl -ne 'print "$1\n" if /info.*(\d+\.\d+\.\d+[^\r\n]*)/' | tail -n 1 | tr -d '\n')
if [[ "${tag}" = *"${project_version}" ]]; then
sbt "runMain com.snowplowanalytics.storage.googlecloudstorage.loader.CloudStorageLoader --project=engineering-sandbox \
--templateLocation=gs://snowplow-hosted-assets/4-storage/snowplow-google-cloud-storage-loader/${tag}/SnowplowGoogleCloudStorageLoaderTemplate-${tag} \
--stagingLocation=gs://snowplow-hosted-assets/4-storage/snowplow-google-cloud-storage-loader/${tag}/staging \
sbt "runMain com.snowplowanalytics.storage.googlecloudstorage.loader.CloudStorageLoader --project=snowplow-assets \
--templateLocation=gs://sp-hosted-assets/4-storage/snowplow-google-cloud-storage-loader/${tag}/SnowplowGoogleCloudStorageLoaderTemplate-${tag} \
--stagingLocation=gs://sp-hosted-assets/4-storage/snowplow-google-cloud-storage-loader/${tag}/staging \
--runner=DataflowRunner \
--tempLocation=gs://snowplow-hosted-assets/tmp"
--tempLocation=gs://sp-hosted-assets-tmp/tmp"
else
echo "Tag version '${tag}' doesn't match version in scala project ('${project_version}'). aborting!"
exit 1
Expand Down
Binary file added service-account.json.enc
Binary file not shown.

0 comments on commit a722f64

Please sign in to comment.