You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@toree.apache.org by ch...@apache.org on 2016/04/22 16:10:19 UTC

[25/32] incubator-toree git commit: Add GPG signing of jars * Updated sbt-dependency-graph plugin to latest version

Add GPG signing of jars
* Updated sbt-dependency-graph plugin to latest version

* Added GPG signing for published jars

* Added environment variable for GPG password and binary

* Added extra legal files to rat-excludes


Project: http://git-wip-us.apache.org/repos/asf/incubator-toree/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-toree/commit/23c3abb6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-toree/tree/23c3abb6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-toree/diff/23c3abb6

Branch: refs/heads/master
Commit: 23c3abb61b0c41efbe83732bf8144338dbcd4cac
Parents: 297914a
Author: Corey Stubbs <ca...@gmail.com>
Authored: Fri Apr 8 16:29:13 2016 -0500
Committer: Gino Bustelo <lb...@apache.org>
Committed: Thu Apr 21 14:46:28 2016 -0500

----------------------------------------------------------------------
 Makefile                | 19 ++++++++++++-------
 etc/tools/.rat-excludes |  2 ++
 etc/tools/sign-file     | 11 ++++++-----
 project/Build.scala     |  3 +--
 project/Common.scala    |  7 ++++++-
 project/plugins.sbt     |  5 ++++-
 6 files changed, 31 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-toree/blob/23c3abb6/Makefile
----------------------------------------------------------------------
diff --git a/Makefile b/Makefile
index 512c723..41aa1b0 100644
--- a/Makefile
+++ b/Makefile
@@ -29,6 +29,8 @@ endif
 APACHE_SPARK_VERSION?=1.6.1
 IMAGE?=jupyter/pyspark-notebook:8dfd60b729bf
 EXAMPLE_IMAGE?=apache/toree-examples
+GPG?=/usr/local/bin/gpg
+GPG_PASSWORD?=
 BINDER_IMAGE?=apache/toree-binder
 DOCKER_WORKDIR?=/srv/toree
 DOCKER_ARGS?=
@@ -189,17 +191,20 @@ dist/toree-src/toree-$(VERSION)-source-release.tar.gz:
 
 src-release: dist/toree-src/toree-$(VERSION)-source-release.tar.gz
 
-dist/toree-src/toree-$(VERSION)-source-release.tar.gz.md5 dist/toree-src/toree-$(VERSION)-source-release.tar.gz.asc dist/toree-src/toree-$(VERSION)-source-release.tar.gz.sha:
-	@etc/tools/./sign-file dist/toree-src/toree-$(VERSION)-source-release.tar.gz
+dist/toree-src/toree-$(VERSION)-source-release.tar.gz.md5 dist/toree-src/toree-$(VERSION)-source-release.tar.gz.asc dist/toree-src/toree-$(VERSION)-source-release.tar.gz.sha: dist/toree-src/toree-$(VERSION)-source-release.tar.gz
+	@GPG_PASSWORD=$(GPG_PASSWORD) GPG=$(GPG) etc/tools/./sign-file dist/toree-src/toree-$(VERSION)-source-release.tar.gz
 
-sign-src: src-release dist/toree-src/toree-$(VERSION)-source-release.tar.gz.md5 dist/toree-src/toree-$(VERSION)-source-release.tar.gz.asc dist/toree-src/toree-$(VERSION)-source-release.tar.gz.sha
+sign-src: dist/toree-src/toree-$(VERSION)-source-release.tar.gz.md5 dist/toree-src/toree-$(VERSION)-source-release.tar.gz.asc dist/toree-src/toree-$(VERSION)-source-release.tar.gz.sha
 
-dist/toree-bin/toree-$(VERSION)-binary-release.tar.gz.md5 dist/toree-bin/toree-$(VERSION)-binary-release.tar.gz.asc dist/toree-bin/toree-$(VERSION)-binary-release.tar.gz.sha:
-	@etc/tools/./sign-file dist/toree-bin/toree-$(VERSION)-binary-release.tar.gz
+dist/toree-bin/toree-$(VERSION)-binary-release.tar.gz.md5 dist/toree-bin/toree-$(VERSION)-binary-release.tar.gz.asc dist/toree-bin/toree-$(VERSION)-binary-release.tar.gz.sha: dist/toree-bin/toree-$(VERSION)-binary-release.tar.gz
+	@GPG_PASSWORD=$(GPG_PASSWORD) GPG=$(GPG) etc/tools/./sign-file dist/toree-bin/toree-$(VERSION)-binary-release.tar.gz
 
-sign-bin: bin-release dist/toree-bin/toree-$(VERSION)-binary-release.tar.gz.md5 dist/toree-bin/toree-$(VERSION)-binary-release.tar.gz.asc dist/toree-bin/toree-$(VERSION)-binary-release.tar.gz.sha
+sign-bin: dist/toree-bin/toree-$(VERSION)-binary-release.tar.gz.md5 dist/toree-bin/toree-$(VERSION)-binary-release.tar.gz.asc dist/toree-bin/toree-$(VERSION)-binary-release.tar.gz.sha
 
-sign: sign-bin sign-src
+sign:  sign-bin sign-src
+
+publish-release:
+	@GPG_PASSWORD=$(GPG_PASSWORD) GPG=$(GPG) sbt publish-local-signed
 
 audit: sign
 	@etc/tools/./check-licenses

http://git-wip-us.apache.org/repos/asf/incubator-toree/blob/23c3abb6/etc/tools/.rat-excludes
----------------------------------------------------------------------
diff --git a/etc/tools/.rat-excludes b/etc/tools/.rat-excludes
index 7af785c..5a36746 100644
--- a/etc/tools/.rat-excludes
+++ b/etc/tools/.rat-excludes
@@ -33,6 +33,8 @@ DESCRIPTION
 .*\.md5
 .*\.asc
 .*\.sha
+NOTICE_extras
+LICENSE_extras
 
 # Auto-generated files and directories
 .*iml

http://git-wip-us.apache.org/repos/asf/incubator-toree/blob/23c3abb6/etc/tools/sign-file
----------------------------------------------------------------------
diff --git a/etc/tools/sign-file b/etc/tools/sign-file
index e4c9196..ef65394 100755
--- a/etc/tools/sign-file
+++ b/etc/tools/sign-file
@@ -18,9 +18,10 @@
 #
 
 # Check if gpg is installed
-which gpg > /dev/null
+echo "GPG is ${GPG} and file is ${1}"
+which ${GPG} > /dev/null
 if [[ "$?" -ne "0" ]]; then
-	echo "ERROR:	gpg not installed!
+	echo "ERROR:	gpg not installed at ${GPG}!
 Please install via your system's package manager or from the gnu site, 
 https://www.gnupg.org/download/. Once installed, follow the Apache guidelines 
 for making your key, http://www.apache.org/dev/openpgp.html."
@@ -32,9 +33,9 @@ FWDIR="$(cd `dirname $0`/../../; pwd)"
 file_to_sign="${FWDIR}/$1"
 if [[ -f "${file_to_sign}"  ]]; then
 		echo "Generating signature and sums for ${file_to_sign}"
-		gpg --armor --output "${file_to_sign}.asc" --detach-sig "${file_to_sign}"
-		gpg --print-md MD5 "${file_to_sign}" >  "${file_to_sign}.md5"
-		gpg --print-md SHA512 "${file_to_sign}" >  "${file_to_sign}.sha"
+		echo ${GPG_PASSWORD} | ${GPG} --passphrase-fd 0 --armor --output "${file_to_sign}.asc" --detach-sig "${file_to_sign}"
+		echo ${GPG_PASSWORD} | ${GPG} --passphrase-fd 0 --print-md MD5 "${file_to_sign}" >  "${file_to_sign}.md5"
+		echo ${GPG_PASSWORD} | ${GPG} --passphrase-fd 0 --print-md SHA512 "${file_to_sign}" >  "${file_to_sign}.sha"
 		exit 0
 else
 	echo "ERROR: File ${file_to_sign} does not exist"

http://git-wip-us.apache.org/repos/asf/incubator-toree/blob/23c3abb6/project/Build.scala
----------------------------------------------------------------------
diff --git a/project/Build.scala b/project/Build.scala
index 5e4c460..90077fb 100644
--- a/project/Build.scala
+++ b/project/Build.scala
@@ -67,8 +67,7 @@ trait Settings {
   lazy val fullSettings =
     Common.settings ++ Seq(
       ScoverageSbtPlugin.ScoverageKeys.coverageHighlighting := false
-    ) ++
-    net.virtualvoid.sbt.graph.Plugin.graphSettings
+    )
 }
 
 /**

http://git-wip-us.apache.org/repos/asf/incubator-toree/blob/23c3abb6/project/Common.scala
----------------------------------------------------------------------
diff --git a/project/Common.scala b/project/Common.scala
index 339ebdf..05dafc9 100644
--- a/project/Common.scala
+++ b/project/Common.scala
@@ -19,13 +19,15 @@ import org.apache.commons.io.FileUtils
 import sbt._
 import Keys._
 import coursier.Keys._
-
+import com.typesafe.sbt.pgp.PgpKeys._
 import scala.util.{Try, Properties}
 
 object Common {
   //  Parameters for publishing to artifact repositories
   val versionNumber             = Properties.envOrElse("VERSION", "0.0.0-dev")
   val snapshot                  = Properties.envOrElse("IS_SNAPSHOT","true").toBoolean
+  val gpgLocation               = Properties.envOrElse("GPG","/usr/local/bin/gpg")
+  val gpgPassword               = Properties.envOrElse("GPG_PASSWORD","")
 
   private val buildOrganization = "org.apache.toree"
   private val buildVersion      =
@@ -77,6 +79,9 @@ object Common {
 
   val settings: Seq[Def.Setting[_]] = Seq(
     organization := buildOrganization,
+    useGpg := true,
+    gpgCommand := gpgLocation,
+    pgpPassphrase in Global := Some(gpgPassword.toArray),
     version := buildVersion,
     scalaVersion := buildScalaVersion,
     libraryDependencies ++= buildLibraryDependencies,

http://git-wip-us.apache.org/repos/asf/incubator-toree/blob/23c3abb6/project/plugins.sbt
----------------------------------------------------------------------
diff --git a/project/plugins.sbt b/project/plugins.sbt
index 081776e..4025fd5 100644
--- a/project/plugins.sbt
+++ b/project/plugins.sbt
@@ -29,7 +29,7 @@ addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.3.1")
 
 // Provides the ability to list dependencies in a readable format using
 // `sbt dependencyTree`; there are other commands provided as well
-addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.7.4")
+addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.8.2")
 
 // Provides abilit to create an uber-jar
 addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.0")
@@ -51,3 +51,6 @@ addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.5.3")
 
 // Provides alternative resolving/downloading over sbt
 addSbtPlugin("com.github.alexarchambault" % "coursier-sbt-plugin" % "1.0.0-M10")
+
+//  Used for signing jars published via `sbt publish-signed`
+addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0")