-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
117 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
language: scala | ||
services: | ||
- docker | ||
scala: | ||
- 2.11.12 | ||
jdk: | ||
- oraclejdk8 | ||
script: | ||
- sbt test | ||
before_deploy: | ||
- pip install --user release-manager==0.3.0 | ||
deploy: | ||
- provider: script | ||
skip_cleanup: true | ||
script: release-manager --config ./.travis/release.yml --check-version --make-version --make-artifact --upload-artifact | ||
on: | ||
tags: true | ||
- provider: script | ||
skip_cleanup: true | ||
script: ./.travis/deploy_docker.sh $TRAVIS_TAG | ||
on: | ||
tags: true | ||
- provider: script | ||
skip_cleanup: true | ||
script: ./.travis/deploy_template.sh $TRAVIS_TAG | ||
on: | ||
tags: true | ||
env: | ||
global: | ||
- BINTRAY_SNOWPLOW_GENERIC_USER | ||
- BINTRAY_SNOWPLOW_GENERIC_API_KEY | ||
- BINTRAY_SNOWPLOW_DOCKER_USER | ||
- BINTRAY_SNOWPLOW_DOCKER_API_KEY | ||
- GCP_CREDENTIALS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
|
||
tag=$1 | ||
|
||
file="${HOME}/.dockercfg" | ||
docker_repo="snowplow-docker-registry.bintray.io" | ||
curl -X GET \ | ||
-u${BINTRAY_SNOWPLOW_DOCKER_USER}:${BINTRAY_SNOWPLOW_DOCKER_API_KEY} \ | ||
https://${docker_repo}/v2/auth > $file | ||
|
||
cd ${TRAVIS_BUILD_DIR} | ||
|
||
project_version=$(sbt version -dsbt.log.noformat=true | perl -ne 'print "$1\n" if /info.*(\d+\.\d+\.\d+[^\r\n]*)/' | tail -n 1 | tr -d '\n') | ||
if [[ "${tag}" = *"${project_version}" ]]; then | ||
sbt docker:publishlocal | ||
docker push "${docker_repo}/snowplow/snowplow-cloud-storage-loader:${tag}" | ||
else | ||
echo "Tag version '${tag}' doesn't match version in scala project ('${project_version}'). aborting!" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
tag=$1 | ||
|
||
GOOGLE_APPLICATION_CREDENTIALS="${HOME}/credentials.json" | ||
echo ${GCP_CREDENTIALS} > ${GOOGLE_APPLICATION_CREDENTIALS} | ||
export GOOGLE_APPLICATION_CREDENTIALS | ||
|
||
cd ${TRAVIS_BUILD_DIR} | ||
|
||
project_version=$(sbt version -dsbt.log.noformat=true | 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.CloudStorageLoader --project=engineering-sandbox \ | ||
--templateLocation=gs://snowplow-hosted-assets/4-storage/cloud-storage-loader/${tag}/CloudStorageLoaderTemplate-${tag} \ | ||
--stagingLocation=gs://snowplow-hosted-assets/4-storage/cloud-storage-loader/${tag}/staging \ | ||
--runner=DataflowRunner \ | ||
--tempLocation=gs://snowplow-hosted-assets/tmp" | ||
else | ||
echo "Tag version '${tag}' doesn't match version in scala project ('${project_version}'). aborting!" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
# --- Variables --- # | ||
|
||
local : | ||
root_dir : <%= ENV['TRAVIS_BUILD_DIR'] %> | ||
|
||
# --- Release Manager Config --- # | ||
|
||
# Required: deployment targets | ||
targets : | ||
- type : "bintray" | ||
user : <%= ENV['BINTRAY_SNOWPLOW_GENERIC_USER'] %> | ||
password : <%= ENV['BINTRAY_SNOWPLOW_GENERIC_API_KEY'] %> | ||
|
||
# Required: packages to be deployed | ||
packages : | ||
- repo : "snowplow-generic" | ||
name : "snowplow-cloud-storage-loader" | ||
user_org : "snowplow" | ||
publish : true | ||
override : false | ||
continue_on_conflict : false | ||
version : <%= FUNC['sbt_version(.)'] %> | ||
build_version : <%= ENV['TRAVIS_BUILD_RELEASE_TAG'] %> | ||
build_commands : | ||
- sbt universal:packageBin | ||
artifacts : | ||
- type : "asis" | ||
prefix : "snowplow_cloud_storage_loader_" | ||
suffix : ".zip" | ||
binary_paths : | ||
- "target/universal/cloud-storage-loader-{{ packages.0.build_version }}.zip" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,6 @@ lazy val compilerOptions = Seq( | |
|
||
lazy val commonSettings = Defaults.coreDefaultSettings ++ Seq( | ||
organization := "com.snowplowanalytics", | ||
// Semantic versioning http://semver.org/ | ||
version := "0.1.0-SNAPSHOT", | ||
scalaVersion := "2.12.7", | ||
scalacOptions ++= compilerOptions, | ||
|
@@ -40,12 +39,19 @@ lazy val macroSettings = Seq( | |
addCompilerPlugin(paradiseDependency) | ||
) | ||
|
||
import com.typesafe.sbt.packager.docker._ | ||
dockerRepository := Some("snowplow-docker-registry.bintray.io") | ||
dockerUsername := Some("snowplow") | ||
dockerBaseImage := "snowplow-docker-registry.bintray.io/snowplow/base-debian:0.1.0" | ||
maintainer in Docker := "Snowplow Analytics Ltd. <[email protected]>" | ||
daemonUser in Docker := "snowplow" | ||
|
||
lazy val root: Project = project | ||
.in(file(".")) | ||
.settings(commonSettings) | ||
.settings(macroSettings) | ||
.settings( | ||
name := "snowplow-cloud-storage-loader", | ||
name := "cloud-storage-loader", | ||
description := "Snowplow Google Cloud Storage Loader", | ||
publish / skip := true, | ||
libraryDependencies ++= Seq( | ||
|
@@ -57,7 +63,7 @@ lazy val root: Project = project | |
"org.mockito" % "mockito-core" % mockitoVersion % Test | ||
) | ||
) | ||
.enablePlugins(PackPlugin) | ||
.enablePlugins(JavaAppPackaging) | ||
|
||
lazy val repl: Project = project | ||
.in(file(".repl")) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "1.0.0") | ||
addSbtPlugin("org.xerial.sbt" % "sbt-pack" % "0.11") | ||
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.3.12") |