diff --git a/.travis.yml b/.travis.yml index 883a606..9b8c801 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,18 +1,20 @@ language: scala services: -- docker + - docker scala: -- 2.11.12 + - 2.11.12 jdk: -- oraclejdk8 + - 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 @@ -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: @@ -31,4 +33,3 @@ global: - BINTRAY_SNOWPLOW_GENERIC_API_KEY - BINTRAY_SNOWPLOW_DOCKER_USER - BINTRAY_SNOWPLOW_DOCKER_API_KEY - - GCP_CREDENTIALS diff --git a/.travis/deploy_template.sh b/.travis/deploy_template.sh index 23a1360..9d86493 100755 --- a/.travis/deploy_template.sh +++ b/.travis/deploy_template.sh @@ -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 \ + --templateLocation=gs://snowplow-hosted-assets-tmp/4-storage/snowplow-google-cloud-storage-loader/${tag}/SnowplowGoogleCloudStorageLoaderTemplate-${tag} \ + --stagingLocation=gs://snowplow-hosted-assets-tmp/4-storage/snowplow-google-cloud-storage-loader/${tag}/staging \ --runner=DataflowRunner \ - --tempLocation=gs://snowplow-hosted-assets/tmp" + --tempLocation=gs://snowplow-hosted-assets-tmp/tmp" else echo "Tag version '${tag}' doesn't match version in scala project ('${project_version}'). aborting!" exit 1 diff --git a/service-account.json.enc b/service-account.json.enc new file mode 100644 index 0000000..146e974 Binary files /dev/null and b/service-account.json.enc differ