This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git


The following commit(s) were added to refs/heads/master by this push:
     new 2c778a9  Fix #707: sign released artifacts
2c778a9 is described below

commit 2c778a9670a335155a9565bc222a73b862aed603
Author: nferraro <ni.ferr...@gmail.com>
AuthorDate: Thu May 30 18:07:02 2019 +0200

    Fix #707: sign released artifacts
---
 script/Makefile         | 5 ++++-
 script/cross_compile.sh | 9 +++++++--
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/script/Makefile b/script/Makefile
index 5be2b6f..affa872 100644
--- a/script/Makefile
+++ b/script/Makefile
@@ -9,6 +9,9 @@ IMAGE_NAME := docker.io/apache/camel-k
 RELEASE_GIT_REMOTE := upstream
 GIT_COMMIT := $(shell git rev-list -1 HEAD)
 
+# For signing binary artifacts
+GPG_PASS := $(GPG_PASS)
+
 GOLDFLAGS += -X main.GitCommit=$(GIT_COMMIT)
 GOFLAGS = -ldflags "$(GOLDFLAGS)"
 
@@ -132,7 +135,7 @@ git-tag:
        ./script/git_tag.sh $(VERSION) $(RELEASE_GIT_REMOTE)
 
 cross-compile:
-       ./script/cross_compile.sh $(VERSION)
+       ./script/cross_compile.sh $(VERSION) $(GPG_PASS)
 
 package-examples:
        ./script/package_examples.sh $(VERSION)
diff --git a/script/cross_compile.sh b/script/cross_compile.sh
index 2256c99..8ea8f9e 100755
--- a/script/cross_compile.sh
+++ b/script/cross_compile.sh
@@ -7,12 +7,13 @@ rm -rf ${builddir}
 
 basename=camel-k-client
 
-if [ "$#" -ne 1 ]; then
-    echo "usage: $0 version"
+if [ "$#" -lt 1 ] || [ "$#" -gt 2 ]; then
+    echo "usage: $0 version [pgp_pass]"
     exit 1
 fi
 
 version=$1
+gpg_pass=$2
 
 cross_compile () {
        local label=$1
@@ -27,6 +28,10 @@ cross_compile () {
        targetdir=${builddir}/${label}
        go build -o ${targetdir}/kamel${extension} ./cmd/kamel/...
 
+       if [ -n "$gpg_pass" ]; then
+           gpg --output ${targetdir}/kamel${extension}.asc --armor 
--detach-sig --passphrase ${gpg_pass} ${targetdir}/kamel${extension}
+       fi
+
        cp ${location}/../LICENSE ${targetdir}/
        cp ${location}/../NOTICE ${targetdir}/
 

Reply via email to