Skip to content

Commit

Permalink
Merge branch 'release/r10'
Browse files Browse the repository at this point in the history
  • Loading branch information
chuwy committed Aug 23, 2018
2 parents d66ffea + 2b5b19e commit adc6775
Show file tree
Hide file tree
Showing 120 changed files with 4,990 additions and 1,331 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ jdk:
script:
- cd 2-repositories/iglu-server
- ./scripts/create-test-user.bash
- sbt test
- cd ../..
before_deploy:
- pip install --user release-manager==0.3.0
Expand Down
2 changes: 2 additions & 0 deletions .travis/deploy_iglu_server.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -e

tag=$1

project="iglu-server/"
Expand Down
19 changes: 18 additions & 1 deletion .travis/deploy_igluctl.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -e

tag=$1

project="igluctl/"
Expand All @@ -18,8 +20,23 @@ else
exit 1
fi

cd "${TRAVIS_BUILD_DIR}"
cd "${TRAVIS_BUILD_DIR}/0-common/igluctl"
project_version=$(sbt version -Dsbt.log.noformat=true | tail -n 1 | perl -ne 'print $1 if /(\d+\.\d+[^\r\n]*)/')
if [ "${project_version}" == "${release}" ]; then
# local publish only dependency, scala-core
cd "${TRAVIS_BUILD_DIR}/0-common/scala-core"
sbt +publishLocal
sbt "project igluCoreCirce" +publishLocal --warn
sbt "project igluCoreJson4s" +publishLocal --warn
# universal publish schema-ddl
cd "${TRAVIS_BUILD_DIR}/0-common/schema-ddl"
sbt +publishLocal --warn
else
echo "Tag version '${release}' doesn't match version in scala project ('${project_version}'). Aborting!"
exit 1
fi

cd "${TRAVIS_BUILD_DIR}"
export TRAVIS_BUILD_RELEASE_TAG="${release}"
release-manager \
--config "./.travis/release_igluctl.yml" \
Expand Down
2 changes: 2 additions & 0 deletions .travis/deploy_scala_core.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -e

tag=$1

project="scala-core/"
Expand Down
5 changes: 2 additions & 3 deletions .travis/deploy_schema_ddl.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -e

tag=$1

project="schema-ddl/"
Expand Down Expand Up @@ -34,11 +36,8 @@ project_version=$(sbt version -Dsbt.log.noformat=true | tail -n 1 | perl -ne 'pr
if [ "${project_version}" == "${release}" ]; then
# local publish only dependency, scala-core
cd "${TRAVIS_BUILD_DIR}/0-common/scala-core"
sbt +test --warn
sbt +publishLocal
sbt "project igluCoreCirce" +test --warn
sbt "project igluCoreCirce" +publishLocal --warn
sbt "project igluCoreJson4s" +test --warn
sbt "project igluCoreJson4s" +publishLocal --warn
# universal publish schema-ddl
cd "${TRAVIS_BUILD_DIR}/0-common/schema-ddl"
Expand Down
3 changes: 3 additions & 0 deletions .travis/is_core_release_tag.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/bin/bash

set -e

tag=$1

cicd=${tag:0:11}
release=${tag:11}

Expand Down
3 changes: 3 additions & 0 deletions .travis/is_iglu_server_release_tag.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/bin/bash

set -e

tag=$1

cicd=${tag:0:12}
release=${tag:12}

Expand Down
3 changes: 3 additions & 0 deletions .travis/is_igluctl_release_tag.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/bin/bash

set -e

tag=$1

cicd=${tag:0:8}
release=${tag:8}

Expand Down
3 changes: 3 additions & 0 deletions .travis/is_schemaddl_release_tag.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/bin/bash

set -e

tag=$1

cicd=${tag:0:11}
release=${tag:11}

Expand Down
2 changes: 1 addition & 1 deletion .travis/release_iglu_server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ packages:
version : <%= FUNC['sbt_version(2-repositories/iglu-server/)'] %>
build_version : <%= ENV['TRAVIS_BUILD_RELEASE_TAG'] %>
build_commands:
- cd 2-repositories/iglu-server && sbt assembly && cd ../..
- cd 2-repositories/iglu-server && ./scripts/create-test-user.bash && sbt assembly && cd ../..

# Required: Artifact
artifacts:
Expand Down
2 changes: 1 addition & 1 deletion .travis/release_igluctl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ packages:

# The binaries to put in the zip
binary_paths:
- 0-common/igluctl/target/scala-2.12/igluctl
- 0-common/igluctl/target/scala-2.11/igluctl
46 changes: 46 additions & 0 deletions 0-common/igluctl/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/**
* Copyright (c) 2014-2017 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the Apache License Version 2.0 is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
*/

import Dependencies._
import BuildSettings._

lazy val root = project.in(file("."))
.settings(
name := "igluctl",
organization := "com.snowplowanalytics",
version := "0.5.0",
description := "Iglu Command Line Interface",
scalaVersion := "2.11.12",
)
.settings(buildSettings: _*)
.settings(
libraryDependencies ++= Seq(
// Java
Libraries.jsonValidator,
Libraries.awsJava,
// JAXB APIs
Libraries.javaxXmlBind,
Libraries.jaxbCore,
Libraries.jaxbImpl,
Libraries.activation,
// Scala
Libraries.schemaddl,
Libraries.igluClient,
Libraries.scopt,
Libraries.scalajHttp,
Libraries.awscala,
// Scala (test only)
Libraries.specs2,
Libraries.scalaCheck
)
)
57 changes: 13 additions & 44 deletions 0-common/igluctl/project/BuildSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
* express or implied. See the Apache License Version 2.0 for the specific
* language governing permissions and limitations there under.
*/
import bintray.{BintrayIvyResolver, BintrayRepo, BintrayCredentials}
import bintray.BintrayPlugin._
import bintray.BintrayKeys._
import sbtassembly.AssemblyPlugin.autoImport._
import sbtassembly.AssemblyPlugin.defaultShellScript
import sbt._
Expand All @@ -26,11 +23,6 @@ object BuildSettings {

// Basic settings for our app
lazy val basicSettings = Seq[Setting[_]](
name := "igluctl",
organization := "com.snowplowanalytics",
version := "0.4.1",
description := "Iglu Command Line Interface",
scalaVersion := "2.12.4",
scalacOptions := Seq(
"-deprecation",
"-encoding", "UTF-8",
Expand All @@ -54,43 +46,20 @@ object BuildSettings {
"-source", "1.8",
"-target", "1.8"
),
scalacOptions in Test := Seq("-Yrangepos")
scalacOptions in Test := Seq("-Yrangepos")
)

lazy val scalifySettings = Seq(sourceGenerators in Compile <+= (sourceManaged in Compile, version, name, organization, scalaVersion) map { (d, v, n, o, sv) =>
val file = d / "settings.scala"
IO.write(file, """package com.snowplowanalytics.iglu.ctl.generated
|object ProjectSettings {
| val version = "%s"
| val name = "%s"
|}
|""".stripMargin.format(v, n))
Seq(file)
})

// Bintray publish settings
lazy val publishSettings = bintraySettings ++ Seq[Setting[_]](
licenses += ("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0.html")),
bintrayOrganization := Some("snowplow"),
bintrayRepository := "snowplow-generic",
publishMavenStyle := false,

// Custom Bintray resolver used to publish package with custom Ivy patterns (custom path in Bintray)
// It requires ~/.bintray/credentials file and bintrayOrganization setting
publishTo in bintray := {
for {
bintrayOrg <- bintrayOrganization.value
credentials <- BintrayCredentials.read(bintrayCredentialsFile.value).right.toOption.flatten
bintrayRepo = BintrayRepo(credentials, Some(bintrayOrg), name.value)
connectedRepo = bintrayRepo.client.repo(bintrayOrg, bintrayRepository.value)
bintrayPackage = connectedRepo.get(name.value)
ivyResolver = BintrayIvyResolver(
bintrayRepository.value,
bintrayPackage.version(version.value),
Seq(s"${name.value}_${version.value.replace('-', '_')}.[ext]"), // Ivy Pattern
release = true)
} yield new RawRepository(ivyResolver)
}
lazy val scalifySettings = Seq(
sourceGenerators in Compile += Def.task {
val file = (sourceManaged in Compile).value / "settings.scala"
IO.write(file, """package com.snowplowanalytics.iglu.ctl.generated
|object ProjectSettings {
| val version = "%s"
| val name = "%s"
|}
|""".stripMargin.format(version.value, name.value, organization.value, scalaVersion.value))
Seq(file)
}.taskValue
)

// Assembly settings
Expand All @@ -106,5 +75,5 @@ object BuildSettings {
mainClass in assembly := Some("com.snowplowanalytics.iglu.ctl.Main")
)

lazy val buildSettings = basicSettings ++ scalifySettings ++ publishSettings ++ sbtAssemblySettings
lazy val buildSettings = basicSettings ++ scalifySettings ++ sbtAssemblySettings
}
4 changes: 3 additions & 1 deletion 0-common/igluctl/project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ object Dependencies {
val jaxbImpl = "2.3.0"
val activation = "1.1.1"
// Scala
val schemaddl = "0.7.0"
val schemaddl = "0.8.0"
val igluClient = "0.5.0"
val scopt = "3.5.0"
val scalajHttp = "2.3.0"
val awscala = "0.5.9"
Expand All @@ -45,6 +46,7 @@ object Dependencies {
val jaxbImpl = "com.sun.xml.bind" % "jaxb-impl" % V.jaxbImpl
val activation = "javax.activation" % "activation" % V.activation
// Scala
val igluClient = "com.snowplowanalytics" %% "iglu-scala-client" % V.igluClient
val schemaddl = "com.snowplowanalytics" %% "schema-ddl" % V.schemaddl
val scopt = "com.github.scopt" %% "scopt" % V.scopt
val scalajHttp = "org.scalaj" %% "scalaj-http" % V.scalajHttp
Expand Down
52 changes: 0 additions & 52 deletions 0-common/igluctl/project/IgluctlBuild.scala

This file was deleted.

2 changes: 1 addition & 1 deletion 0-common/igluctl/project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=0.13.11
sbt.version=1.2.1
3 changes: 1 addition & 2 deletions 0-common/igluctl/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
addSbtPlugin("me.lessis" % "bintray-sbt" % "0.3.0")
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.3")
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.7")
Loading

0 comments on commit adc6775

Please sign in to comment.