You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@edgent.apache.org by dl...@apache.org on 2016/10/12 15:09:37 UTC
[1/3] incubator-edgent git commit: Add 'signAll' task
Repository: incubator-edgent
Updated Branches:
refs/heads/master b214477b1 -> b3248718a
Add 'signAll' task
Project: http://git-wip-us.apache.org/repos/asf/incubator-edgent/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-edgent/commit/a2d8f1cb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-edgent/tree/a2d8f1cb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-edgent/diff/a2d8f1cb
Branch: refs/heads/master
Commit: a2d8f1cb74808d1cd957ba63132445fd3dd756b7
Parents: df0d384
Author: Dale LaBossiere <dl...@us.ibm.com>
Authored: Wed Oct 12 10:10:00 2016 -0400
Committer: Dale LaBossiere <dl...@us.ibm.com>
Committed: Wed Oct 12 10:11:48 2016 -0400
----------------------------------------------------------------------
build.gradle | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 57 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a2d8f1cb/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 0056f4f..b94d50a 100644
--- a/build.gradle
+++ b/build.gradle
@@ -15,6 +15,9 @@
defaultTasks 'assemble'
apply from: 'other.gradle'
+
+import org.gradle.plugins.signing.Sign
+import java.io.Console
/* Configure root project */
allprojects {
@@ -97,6 +100,10 @@ ext {
samples_ext_dependencies,
// test_common_dependencies, // omit as tests aren't included in release tgz
].flatten()
+
+ ext."signing.keyId" = null
+ ext."signing.secretKeyRingFile" = null
+ ext."signing.password" = null
}
// Declare the common_ext_dependencies as dependencies of the root project
@@ -743,10 +750,56 @@ task srcReleaseTarGz(type: Tar) {
}
}
-signing {
-// creates circular dep... :assemble -> :signReleaseTgz -> :releaseTarGz -> :assemble
-// sign srcReleaseTarGz // creates task signSrcReleaseTarGz
-// sign releaseTarGz // creates task signReleaseTarGz
+gradle.taskGraph.whenReady { taskGraph ->
+ if (ext."signing.password"==null && taskGraph.allTasks.any { it instanceof Sign }) {
+ // Use Java console to read from the console (no good for a CI environment)
+ def Console console = System.console()
+ console.printf "\n\n#####################################" +
+ "\nWe have to sign some things in this build." +
+ "\nPlease enter your signing details.\n\n"
+ def id = System.env['GPG_ID']
+ try {
+ def tmpId = console.readLine("PGP Code Signing Key Id (default: $id): ")
+ if (!tmpId.isEmpty())
+ id = tmpId
+ } catch (NullPointerException e) {
+ throw new GradleException("You must run 'signAll --no-daemon'")
+ }
+ def file = System.env['GPG_SECRING']
+ if (file == null) {
+ file = "${System.properties['user.home']}/.gnupg/secring.gpg"
+ }
+ def tmpFile = console.readLine("PGP Secret Key Ring File (default: $file): ")
+ if (!tmpFile.isEmpty()) {
+ file = tmpFile
+ }
+ def password = String.valueOf(console.readPassword("PGP Private Key Password: "))
+
+ allprojects { ext."signing.keyId" = id }
+ allprojects { ext."signing.secretKeyRingFile" = file }
+ allprojects { ext."signing.password" = password }
+
+ console.printf "\n#####################################\n"
+ }
+}
+
+task signAll(type: Sign) {
+ description='Sign existing release artifacts in ${target_dir}/../release-edgent (run separetely after "release")'
+ fileTree("${target_dir}/../release-edgent") {
+ include '**/*.tgz'
+ }.each {
+ sign it
+ }
+ outputs.upToDateWhen { false }
+ doFirst {
+ if (getFilesToSign().isEmpty()) {
+ throw new GradleException("No artifacts to sign. Run the 'release' task first.")
+ }
+ //println "### files to sign: " + getFilesToSign().collect { it.name }.join(",")
+ }
+ doLast {
+ println "\nCreated signature files: " + getSignatureFiles().collect { it.name }.join(", ")
+ }
}
assemble {
[3/3] incubator-edgent git commit: Developer doc for 'signAll' task
Posted by dl...@apache.org.
Developer doc for 'signAll' task
Project: http://git-wip-us.apache.org/repos/asf/incubator-edgent/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-edgent/commit/b3248718
Tree: http://git-wip-us.apache.org/repos/asf/incubator-edgent/tree/b3248718
Diff: http://git-wip-us.apache.org/repos/asf/incubator-edgent/diff/b3248718
Branch: refs/heads/master
Commit: b3248718a087e014e7069c42756834bce1ba7a85
Parents: a2d8f1c
Author: Dale LaBossiere <dl...@us.ibm.com>
Authored: Wed Oct 12 10:50:37 2016 -0400
Committer: Dale LaBossiere <dl...@us.ibm.com>
Committed: Wed Oct 12 10:50:37 2016 -0400
----------------------------------------------------------------------
DEVELOPMENT.md | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/b3248718/DEVELOPMENT.md
----------------------------------------------------------------------
diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md
index 2c30057..63cd1a2 100644
--- a/DEVELOPMENT.md
+++ b/DEVELOPMENT.md
@@ -87,7 +87,10 @@ unique tasks:
* `reports` : Generate JUnit and Code Coverage reports in `build\distributions\reports`. Use after executing the `test` target.
* `reports\tests\overview-summary.html` - JUnit test report
* `reports\coverage\index.html` - Code coverage report
-* `release` : Build a release bundle in `build/release-edgent`, that includes subsets of the Edgent jars that run on Java 7 (`build/distributions/java7`) and Android (`build/distributions/android`).
+* `release` : Build release bundles in `build/release-edgent`, that includes subsets of the Edgent jars that run on Java 7 (`build/distributions/java7`) and Android (`build/distributions/android`).
+* `signAll` : Sign the release bundles in `build/release-edgent` (first run `release`). You will be promoted for your PGP code signing key's Id, the location of the keyring file, and the secret key password. Default response values may be set with environment variables:
+ * `GPG_ID` - the code signing key's id (e.g., D0F56CAD)
+ * `GPG_SECRING` - path to the secret key's keyring file
The build process has been tested on Linux and MacOSX.
[2/3] incubator-edgent git commit: [WIP] Edgent-274 Add support for
distribution signing
Posted by dl...@apache.org.
[WIP] Edgent-274 Add support for distribution signing
- update KEYS
- remove KEYS from tgz files
- rename src and binary release images to conform to the norm
- generate sha-512 with extension '.sha'
Project: http://git-wip-us.apache.org/repos/asf/incubator-edgent/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-edgent/commit/df0d3841
Tree: http://git-wip-us.apache.org/repos/asf/incubator-edgent/tree/df0d3841
Diff: http://git-wip-us.apache.org/repos/asf/incubator-edgent/diff/df0d3841
Branch: refs/heads/master
Commit: df0d3841e7578f28966f0256e2d37d88a79aecc1
Parents: b214477
Author: Dale LaBossiere <dl...@us.ibm.com>
Authored: Tue Oct 11 13:37:28 2016 -0400
Committer: Dale LaBossiere <dl...@us.ibm.com>
Committed: Wed Oct 12 10:11:48 2016 -0400
----------------------------------------------------------------------
KEYS | 98 ++++++++++++++++++++++++++++++++++++++++++++++++-------
build.gradle | 19 +++++++----
2 files changed, 100 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/df0d3841/KEYS
----------------------------------------------------------------------
diff --git a/KEYS b/KEYS
index b60ecc5..f8b89c0 100644
--- a/KEYS
+++ b/KEYS
@@ -1,15 +1,91 @@
-iThis file contains the PGP keys of various developers.
+This file contains GPG keys of Apache Edgent developers.
+Users: gpg --import KEYS
-Users: pgp < KEYS
-or
- gpg --import KEYS
+Developers:
+ Create a key:
+ gpg --gen-key
- Developers:
- pgp -kxa <your name> and append it to this file.
- or
- (pgpk -ll <your name> && pgpk -xa <your name>) >> this file.
- or
- (gpg --list-sigs <your name>
- && gpg --armor --export <your name>) >> this file.
+ Adding your key to this file:
+ (gpg --list-sigs <key id> && gpg --armor --export <key id>) >> KEYS.
+ Publish the key:
+ gpg --keyserver pgp.mit.edu --send-keys <key id>
+
+ Signing another developers key:
+ gpg --keyserver pgp.mit.edu --search-keys <name or email>
+ gpg --keyserver pgp.mit.edu --recv-keys <key id>
+ gpg --sign-key <key id>
+ gpg --keyserver pgp.mit.edu --send-keys <key id>
+
+ Additional Information:
+ http://www.apache.org/dev/openpgp.html#generate-key
+
+********************************* PLEASE NOTE **********************************
+
+ Releases will be signed using one of these keys in this file. This file will
+ be available with the distributed Apache Edgent releases at:
+
+ https://dist.apache.org/repos/dist/release/incubator/edgent/KEYS
+
+********************************************************************************
+
+
+pub 4096R/26518FEE 2016-10-11
+uid [ultimate] Dale LaBossiere (CODE SIGNING KEY) <dl...@apache.org>
+sig 3 26518FEE 2016-10-11 Dale LaBossiere (CODE SIGNING KEY) <dl...@apache.org>
+sub 4096R/D0F56CAD 2016-10-11
+sig 26518FEE 2016-10-11 Dale LaBossiere (CODE SIGNING KEY) <dl...@apache.org>
+
+-----BEGIN PGP PUBLIC KEY BLOCK-----
+Version: GnuPG v2
+
+mQINBFf896kBEAC076zJreSdSqVPtnkLpuf79g4e0FFfMXgq8Mc75tmzGySNVqzM
+lXcpD/PAQ6jOT9mbvUY5g5eY4EEemVjdm/deDP84j3DntXnFVCwvw7Blm3/gwabB
+J/ysebVcibn0gGDti1EobTXJsZpwlSsDQMR7MTjBn+cMt4r1eSDUiin2V6yVjCn8
+wrxelZXnbFVVOyFSecAnnuHigzmdZd6Mv7PhX0Y1MNrz/ky3MraQ3Ly+9uc+08kV
+WOg5Zihh52qt0SGdVUW/S7Ne5iMS/xKZGeWS3/nWeq+HadmdZRFGiS08K1/pYaqi
+3HzWm7C5lLkPZJQUA9SKiREUvgfk1MruyC2i0z5KqyyNGA+M7Yvx05ZTQa+dBeaD
+OZxRrxKPyIOvFLRL2O79xTkdQ9ckOVGlHD9vrBF1rTynNZ82EQWKW8lNqDhUFd0r
+fWPOMMwDEXMo87Xfj7tAYToEUgpjb8EGkFLC8w/D5NIa/etGy0j/nCwscatHikLL
+hXqo+5DddBwdHJRVW78Ku7gU6tOpbRIfxUv8fXtyTBEU5a4urxIHAOH9B+X8SppD
+Y9LP+bkKahfxl0k59YFXnEvPkF+N6Xg60u5u4SIGfW011iuU3oPUwsIfwOhEZJYZ
+fX2gwz5Tv4xhLZe13mVd7h6W7NVynoWx8mgfJJpnnRCDTTsjR7zwaNmI8QARAQAB
+tDdEYWxlIExhQm9zc2llcmUgKENPREUgU0lHTklORyBLRVkpIDxkbGFib3NzQGFw
+YWNoZS5vcmc+iQI3BBMBCg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KWsT3yK0oIjI/ujU3xGP1nHmmg/P5R6YiftNTytz4uvd6TUUpfQG4QrjAAyQ
+38NGZ0oQ0GKgYrvJhHPUsjMkUqxz
+=xPxf
+-----END PGP PUBLIC KEY BLOCK-----
http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/df0d3841/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index b3efe7e..0056f4f 100644
--- a/build.gradle
+++ b/build.gradle
@@ -32,6 +32,7 @@ apply plugin: 'java'
jar {
deleteAllActions() // Avoid creating/staging an empty jar for the "root"
}
+apply plugin: 'signing'
ext {
@@ -679,7 +680,7 @@ task addVersionDotTxt {
task releaseTarGz(type: Tar) {
description = 'Create binary release tgz in target_dir'
- archiveName = "${build_name}-v${build_version}-${DSTAMP}-${TSTAMP}.tgz"
+ archiveName = "${build_name}-${build_version}-${DSTAMP}-${TSTAMP}-bin.tgz"
compression = Compression.GZIP
destinationDir = new File("${target_dir}/../release-edgent")
duplicatesStrategy 'exclude'
@@ -697,7 +698,7 @@ task releaseTarGz(type: Tar) {
rename { 'binary-release-bundled-dependencies' }
from rootProject.file('legal/binary-release-bundled-dependencies')
}
- from 'DISCLAIMER', 'KEYS', 'JAVA_SUPPORT.md'
+ from 'DISCLAIMER', 'JAVA_SUPPORT.md'
with copySpec {
rename { 'README' }
from rootProject.file('legal/binary-release-readme')
@@ -708,21 +709,21 @@ task releaseTarGz(type: Tar) {
exclude '**/connectors/javax.websocket-server/' // just part of wsclient test harness
doLast {
ant.checksum algorithm: 'md5', file: archivePath
- ant.checksum algorithm: 'sha1', file: archivePath
+ ant.checksum algorithm: 'sha-512', fileext: '.sha', file: archivePath
println "created $destinationDir/$archiveName"
}
}
task srcReleaseTarGz(type: Tar) {
description = 'Create source release tgz in target_dir'
- archiveName = "${build_name}-source-v${build_version}-${DSTAMP}-${TSTAMP}.tgz"
+ archiveName = "${build_name}-${build_version}-${DSTAMP}-${TSTAMP}-src.tgz"
compression = Compression.GZIP
destinationDir = new File("${target_dir}/../release-edgent")
duplicatesStrategy 'exclude'
into "${build_name}"
// make some things first in the tgz
from 'LICENSE', 'NOTICE'
- from 'DISCLAIMER', 'KEYS', 'JAVA_SUPPORT.md'
+ from 'DISCLAIMER', 'JAVA_SUPPORT.md'
with copySpec {
rename { 'README' }
from rootProject.file('legal/source-release-readme')
@@ -737,11 +738,17 @@ task srcReleaseTarGz(type: Tar) {
exclude '**/classes/' // ant generated artifacts
doLast {
ant.checksum algorithm: 'md5', file: archivePath
- ant.checksum algorithm: 'sha1', file: archivePath
+ ant.checksum algorithm: 'sha-512', fileext: '.sha', file: archivePath
println "created $destinationDir/$archiveName"
}
}
+signing {
+// creates circular dep... :assemble -> :signReleaseTgz -> :releaseTarGz -> :assemble
+// sign srcReleaseTarGz // creates task signSrcReleaseTarGz
+// sign releaseTarGz // creates task signReleaseTarGz
+}
+
assemble {
description = "Assemble distribution artifacts and populate the target_dir with jars, doc, etc. Like 'build' w/o 'test'"
dependsOn filteredSubprojects.assemble, aggregateJavadoc, copyScripts