Testing signing artifacts 85/16485/1
authorAric Gardner <agardner@linuxfoundation.org>
Wed, 6 Jul 2016 19:18:30 +0000 (15:18 -0400)
committerAric Gardner <agardner@linuxfoundation.org>
Wed, 6 Jul 2016 19:19:31 +0000 (15:19 -0400)
gpg agent does not work in non interactive mode.
merging this so that I can reproduce and debug

Change-Id: I641e8988885aa2d0acf794c9ec7592cb6c90a3e9
Signed-off-by: Aric Gardner <agardner@linuxfoundation.org>
jjb/opnfv/test-sign.yml [new file with mode: 0644]
utils/test-sign-artifact.sh [new file with mode: 0755]

diff --git a/jjb/opnfv/test-sign.yml b/jjb/opnfv/test-sign.yml
new file mode 100644 (file)
index 0000000..b27d757
--- /dev/null
@@ -0,0 +1,42 @@
+- project:
+    name: test-sign
+
+    project: 'releng'
+
+    jobs:
+        - 'test-sign-daily-{stream}'
+
+    stream:
+        - master:
+            branch: '{stream}'
+            gs-pathname: ''
+
+
+- job-template:
+    name: 'test-sign-daily-{stream}'
+
+    # Job template for daily builders
+    #
+    # Required Variables:
+    #     stream:    branch with - in place of / (eg. stable)
+    #     branch:    branch (eg. stable)
+    node: master
+
+    disabled: false
+
+    parameters:
+        - project-parameter:
+            project: '{project}'
+
+    scm:
+        - git-scm:
+            credentials-id: '{ssh-credentials}'
+            refspec: ''
+            branch: '{branch}'
+
+    triggers:
+        - timed: 'H H * * *'
+
+    builders:
+        - shell: |
+            $WORKSPACE/utils/test-sign-artifact.sh
diff --git a/utils/test-sign-artifact.sh b/utils/test-sign-artifact.sh
new file mode 100755 (executable)
index 0000000..5ae91aa
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+# clone releng repository
+echo "Cloning releng repository..."
+[ -d releng ] && rm -rf releng
+git clone https://gerrit.opnfv.org/gerrit/releng $WORKSPACE/releng/ &> /dev/null
+#this is where we import the siging key
+if [ -f $WORKSPACE/releng/utils/gpg_import_key.sh ]; then 
+  source $WORKSPACE/releng/utils/gpg_import_key.sh
+fi
+
+artifact="foo"
+echo foo > foo
+
+testsign () {
+  echo "Signing artifact: ${artifact}"
+  gpg2 -vvv --batch \
+    --default-key opnfv-helpdesk@rt.linuxfoundation.org  \
+    --passphrase besteffort \
+    --detach-sig $artifact
+done
+}
+
+testsign
+