directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r1683650 - in /directory/studio/trunk: ./ README.md tools/dist.sh tools/sign.sh
Date Thu, 04 Jun 2015 22:39:01 GMT
Author: seelmann
Date: Thu Jun  4 22:39:00 2015
New Revision: 1683650

URL: http://svn.apache.org/r1683650
Log:
DIRSTUDIO-1024: copy, check and sign distribution packages

Added:
    directory/studio/trunk/tools/dist.sh   (with props)
Modified:
    directory/studio/trunk/   (props changed)
    directory/studio/trunk/README.md
    directory/studio/trunk/tools/sign.sh

Propchange: directory/studio/trunk/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Thu Jun  4 22:39:00 2015
@@ -16,3 +16,4 @@ META-INF
 .metadata
 org.eclipse.tycho
 workspace
+dist

Modified: directory/studio/trunk/README.md
URL: http://svn.apache.org/viewvc/directory/studio/trunk/README.md?rev=1683650&r1=1683649&r2=1683650&view=diff
==============================================================================
--- directory/studio/trunk/README.md (original)
+++ directory/studio/trunk/README.md Thu Jun  4 22:39:00 2015
@@ -162,6 +162,26 @@ Define a variable for later use:
     mvn -Papache-release -Puserguides clean install/deploy
 
 
+#### Sign distribution packages
+
+There is a script that
+
+* creates `dist` folder
+* copies all distribution packages (sources, products, P2 repo) to dist folder
+* checks that all packages contain LICENSE.txt and NOTICE.txt
+* sign the packages
+
+For non-interactive signing with GPG agent define env variable with key to use
+
+	export RELEASE_KEY=28686142
+
+Run helper script
+
+    tools/dist.sh
+
+Afterwards all distribution packages are in `dist` folder.
+
+
 tbc.
 
 

Added: directory/studio/trunk/tools/dist.sh
URL: http://svn.apache.org/viewvc/directory/studio/trunk/tools/dist.sh?rev=1683650&view=auto
==============================================================================
--- directory/studio/trunk/tools/dist.sh (added)
+++ directory/studio/trunk/tools/dist.sh Thu Jun  4 22:39:00 2015
@@ -0,0 +1,65 @@
+#!/bin/sh
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# Helper script for release
+
+set -e
+
+if [ -z "$VERSION" ]; then
+  echo "VERSION is not set"
+  exit 1;
+fi
+
+echo "Creating dist folder"
+mkdir dist
+cd dist
+
+echo
+echo "Copying dist files"
+cp ../target/org.apache.directory.studio.parent-${VERSION}-source-release.zip ApacheDirectoryStudio-sources-${VERSION}.zip
+cp ../product/target/products/ApacheDirectoryStudio-${VERSION}-*.{zip,tar.gz} .
+cp ../p2repository/target/org.apache.directory.studio.p2repository-${VERSION}.zip .
+
+echo
+echo "Checking legal files"
+for file in *
+do
+    echo "Checking $file"
+    case $file in
+        *.zip)
+            cmd="unzip -l $file"
+            ;;
+        *.tar.gz)
+            cmd="tar -tzvf $file"
+            ;;
+        *)
+            echo "Unknown file type: $file"
+            exit 1
+            ;;
+    esac
+    eval "$cmd" | grep "LICENSE.txt"
+    eval "$cmd" | grep "NOTICE.txt"
+done
+
+echo
+echo "Signing dist files"
+../tools/sign.sh
+
+echo
+echo "Success"
+

Propchange: directory/studio/trunk/tools/dist.sh
------------------------------------------------------------------------------
    svn:executable = *

Modified: directory/studio/trunk/tools/sign.sh
URL: http://svn.apache.org/viewvc/directory/studio/trunk/tools/sign.sh?rev=1683650&r1=1683649&r2=1683650&view=diff
==============================================================================
--- directory/studio/trunk/tools/sign.sh (original)
+++ directory/studio/trunk/tools/sign.sh Thu Jun  4 22:39:00 2015
@@ -16,14 +16,16 @@
 # specific language governing permissions and limitations
 # under the License.
 
-echo "PGP Key ID: "
-read DEFAULT_KEY
-
-echo "PGP Key Password: "
-stty -echo
-read PASSWORD
-stty echo
-echo ""
+if [ -z "$RELEASE_KEY" ]; then
+    echo "PGP Key ID: "
+    read RELEASE_KEY
+
+    echo "PGP Key Password: "
+    stty -echo
+    read PASSWORD
+    stty echo
+    echo ""
+fi
 
 for FILE in $(find . -maxdepth 1 -not '(' -name "sign.sh" -or -name ".*" -or -name "*.md5"
-or -name "*.sha1" -or -name "*.asc" ')' -and -type f) ; do
     if [ -f "$FILE.asc" ]; then
@@ -45,7 +47,7 @@ for FILE in $(find . -maxdepth 1 -not '(
     # SHA1
     if [ ! -f "$FILE.sha1" ];
     then
-        gpg --default-key "$DEFAULT_KEY" --print-md SHA1 "$FILE" > "$FILE".sha1
+        gpg --default-key "$RELEASE_KEY" --print-md SHA1 "$FILE" > "$FILE".sha1
         echo "  - Generated '$FILE.sha1'"
     else
         echo "  - Skipped '$FILE.sha1' (file already existing)"
@@ -54,7 +56,7 @@ for FILE in $(find . -maxdepth 1 -not '(
     # ASC
     if [ ! -f "$FILE.asc" ];
     then
-        echo "$PASSWORD" | gpg --default-key "$DEFAULT_KEY" --detach-sign --armor --no-tty
--yes --passphrase-fd 0 "$FILE"
+        echo "$PASSWORD" | gpg --default-key "$RELEASE_KEY" --detach-sign --armor --no-tty
--yes --passphrase-fd 0 "$FILE"
         echo "  - Generated '$FILE.asc'"
     else
         echo "  - Skipped '$FILE.asc' (file already existing)"



Mime
View raw message