felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pde...@apache.org
Subject svn commit: r1649258 - in /felix/sandbox/pderop/dependencymanager/release: ./ .classpath .gitignore .project .settings/ .settings/org.eclipse.jdt.core.prefs bnd.bnd build.gradle check_staged_dependencymanager.sh src/ src/.gitignore test/ test/.gitignore
Date Sat, 03 Jan 2015 22:43:05 GMT
Author: pderop
Date: Sat Jan  3 22:43:05 2015
New Revision: 1649258

URL: http://svn.apache.org/r1649258
Log:
First version of a gradle script that can be used to release DM 4.0 in Apache Felix.
(Still need to make a README.release file to describe the new release process, which 
is for now really similar to the one from Apache ACE).

Added:
    felix/sandbox/pderop/dependencymanager/release/
    felix/sandbox/pderop/dependencymanager/release/.classpath   (with props)
    felix/sandbox/pderop/dependencymanager/release/.gitignore
    felix/sandbox/pderop/dependencymanager/release/.project   (with props)
    felix/sandbox/pderop/dependencymanager/release/.settings/
    felix/sandbox/pderop/dependencymanager/release/.settings/org.eclipse.jdt.core.prefs
    felix/sandbox/pderop/dependencymanager/release/bnd.bnd
    felix/sandbox/pderop/dependencymanager/release/build.gradle
    felix/sandbox/pderop/dependencymanager/release/check_staged_dependencymanager.sh   (with
props)
    felix/sandbox/pderop/dependencymanager/release/src/
    felix/sandbox/pderop/dependencymanager/release/src/.gitignore
    felix/sandbox/pderop/dependencymanager/release/test/
    felix/sandbox/pderop/dependencymanager/release/test/.gitignore

Added: felix/sandbox/pderop/dependencymanager/release/.classpath
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager/release/.classpath?rev=1649258&view=auto
==============================================================================
Binary file - no diff available.

Propchange: felix/sandbox/pderop/dependencymanager/release/.classpath
------------------------------------------------------------------------------
    svn:mime-type = application/xml

Added: felix/sandbox/pderop/dependencymanager/release/.gitignore
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager/release/.gitignore?rev=1649258&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager/release/.gitignore (added)
+++ felix/sandbox/pderop/dependencymanager/release/.gitignore Sat Jan  3 22:43:05 2015
@@ -0,0 +1,3 @@
+/bin/
+/bin_test/
+/generated/

Added: felix/sandbox/pderop/dependencymanager/release/.project
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager/release/.project?rev=1649258&view=auto
==============================================================================
Binary file - no diff available.

Propchange: felix/sandbox/pderop/dependencymanager/release/.project
------------------------------------------------------------------------------
    svn:mime-type = application/xml

Added: felix/sandbox/pderop/dependencymanager/release/.settings/org.eclipse.jdt.core.prefs
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager/release/.settings/org.eclipse.jdt.core.prefs?rev=1649258&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager/release/.settings/org.eclipse.jdt.core.prefs (added)
+++ felix/sandbox/pderop/dependencymanager/release/.settings/org.eclipse.jdt.core.prefs Sat
Jan  3 22:43:05 2015
@@ -0,0 +1,11 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.7

Added: felix/sandbox/pderop/dependencymanager/release/bnd.bnd
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager/release/bnd.bnd?rev=1649258&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager/release/bnd.bnd (added)
+++ felix/sandbox/pderop/dependencymanager/release/bnd.bnd Sat Jan  3 22:43:05 2015
@@ -0,0 +1,7 @@
+-nobundles
+-dependson \
+	org.apache.felix.dependencymanager,\
+	org.apache.felix.dependencymanager.shell,\
+	org.apache.felix.dependencymanager.annotation,\
+	org.apache.felix.dependencymanager.runtime
+	
\ No newline at end of file

Added: felix/sandbox/pderop/dependencymanager/release/build.gradle
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager/release/build.gradle?rev=1649258&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager/release/build.gradle (added)
+++ felix/sandbox/pderop/dependencymanager/release/build.gradle Sat Jan  3 22:43:05 2015
@@ -0,0 +1,106 @@
+/**
+ * Gradle script used to perform DM releases (really similar to Apache ACE build.xml)
+ */
+import aQute.bnd.build.Workspace
+
+// Misc properties (you must update the ext.dmVersion property before each release)
+ext.svnStagingPath = "https://dist.apache.org/repos/dist/dev/felix"
+ext.svnReleasePath = "https://dist.apache.org/repos/dist/release/felix"
+ext.dmVersion = "4.0.0"
+
+apply plugin: 'java'
+
+// Add bnd as a build dependency
+buildscript {
+    dependencies {
+        classpath files('cnf/gradle/biz.aQute.bnd.gradle.jar')
+    }
+}
+
+// Setup the workspace
+Workspace workspace
+workspace = Workspace.getWorkspace(".")
+
+// Package the source and binary distributions into the staging directory.
+task makeStaging << {
+    // Collect bundles into the staging dir
+    new File('.').eachFile { 
+        if(new File(it, 'bnd.bnd').exists()) {
+    	    def bndProject = workspace.getProject(it.name)
+	    if (! bndProject.getProperty("Test-Cases") && ! bndProject.isNoBundles()) {
+		logger.lifecycle("    Packaging release for ${bndProject.name}")
+
+		// Copy binary project artifacts to the staging directory
+		copy { 
+		    from "../${bndProject.name}/generated"
+		    into "staging"
+		    include "*.jar"
+		    rename { 
+		    	String fileName -> fileName.replace(".jar", "-" + bndProject.getVersion("${bndProject.name}")
+ ".jar")
+		    }
+		}
+	    }
+        }
+    }
+
+    // Package source distribution
+    ant.zip(destfile: "staging/apache-felix-dependencymanager-" + dmVersion + ".zip", excludes:
"../release/**, staging/**") {
+	zipfileset(dir: "../", 
+		   prefix: "apache-felix-dependencymanager-" + dmVersion + "-src",
+		   includes: "*/.project, */.classpath, */.settings/**, */src/**, */test/**, */.bnd, */.bndrun,
cnf/**")
+    }
+}
+
+// Sign staging directory 
+task signStaging << { 
+    fileTree("staging").visit { FileVisitDetails details -> 
+	logger.lifecycle("    Signing " + details.file.path)
+	getProject().exec {
+	    commandLine 'gpg', '--armor', '--output', details.file.path + ".asc", '--detach-sig',
details.file.path
+	}
+	getProject().exec {
+	    standardOutput = new FileOutputStream(new File(details.file.path+".md5"))
+	    commandLine 'gpg', '--print-md', 'MD5', details.file.path
+	}
+	getProject().exec { 
+	    standardOutput = new FileOutputStream(new File(details.file.path+".sha"))
+	    commandLine 'gpg', '--print-md', 'SHA512', details.file.path
+	}
+    }
+}
+
+
+// Moves the source and binary distributions to staging.
+// (you must provide svn user/password using gradle "-PsvnUser=xxx -PsvnPassword=xxx" options)
+task commitToStaging << {
+    getProject().exec { 
+    	commandLine 'svn', '--username', svnUser, '--password', svnPassword, 
+	'import', 'staging', svnStagingPath + "/apache-felix-dependencymanager-" + dmVersion + "/",

+	'-m', "Staging Apache Felix Dependency Manager version " + dmVersion + "."
+    }
+}
+
+// Promotes the staged distributions to release
+// (you must provide svn user/password using gradle "-PsvnUser=xxx -PsvnPassword=xxx" options)
+task promoteToRelease << { 
+    getProject().exec { 
+    	commandLine 'svn', '--username', svnUser, '--password', svnPassword, 
+	'move', svnStagingPath+"/apache-felix-dependencymanager-" + dmVersion , svnReleasePath,

+	'-m', "Releasing Apache Felix Dependency Manager version " + dmVersion + "."
+    }
+}
+
+// Removes the staged distributions from staging
+// (you must provide svn user/password using gradle "-PsvnUser=xxx -PsvnPassword=xxx" options)
+task deleteFromStaging << { 
+    getProject().exec { 
+    	commandLine 'svn', '--username', svnUser, '--password', svnPassword, 
+	'delete', svnStagingPath+"/apache-felix-dependencymanager-" + dmVersion + "/",
+	"-m", "Removing Apache Felix Dependency Manager version " + dmVersion + " from staging."
+    }
+}
+
+// Clean staging directory
+task clean(overwrite: true) << { 
+    new File("staging").deleteDir()
+}

Added: felix/sandbox/pderop/dependencymanager/release/check_staged_dependencymanager.sh
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager/release/check_staged_dependencymanager.sh?rev=1649258&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager/release/check_staged_dependencymanager.sh (added)
+++ felix/sandbox/pderop/dependencymanager/release/check_staged_dependencymanager.sh Sat Jan
 3 22:43:05 2015
@@ -0,0 +1,120 @@
+#!/bin/bash
+#
+# 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.
+# This script verifies the signatures and checksums of a release.
+#
+# This script can be used to check the signatures and checksums of staged 
+# Apache Felix Dependency Manager release using gpg.
+# Usage:
+#
+#   check_staged_dependencymanager.sh <version> [<temp-dir>]
+# 
+# Where:
+#   <version> represents the staged release version, e.g., 2.0.0;
+#   <temp-dir> represents the location where the release artifacts
+#              should be stored, defaults to /tmp/felix-staging if
+#              omitted.
+
+
+version=${1}
+tmpDir=${2:-/tmp/felix-staging}
+
+if [ ! -d "${tmpDir}" ]; then
+    mkdir "${tmpDir}"
+fi
+
+if [ -z "${version}" -o ! -d "${tmpDir}" ]; then
+    echo "Usage: check_staged_dependencymanager.sh <release-version> [temp-directory]"
+    exit
+fi
+
+checkSig() {
+    sigFile="$1.asc"
+    if [ ! -f $sigFile ]; then
+        echo "$sigFile is missing!!!"
+        exit 1
+    fi
+
+    gpg --verify $sigFile 2>/dev/null >/dev/null
+    if [ "$?" = "0" ]; then echo "OK"; else echo "BAD!!!"; fi
+}
+
+checkSum() {
+    archive=$1
+    sumFile=$2
+    alg=$3
+    if [ ! -f $sumFile ]; then
+        echo "$sumFile is missing!!!"
+        exit 1
+    fi
+
+    orig=`cat $sumFile | sed 's/.*: *//' | tr -d ' \t\n\r'`
+    actual=`gpg --print-md $alg $archive | sed 's/.*: *//' | tr -d ' \t\n\r'`
+    if [ "$orig" = "$actual" ]; then echo "OK"; else echo "BAD!!!"; fi
+}
+
+KEYS_URL="http://www.apache.org/dist/felix/KEYS"
+#REL_URL="https://dist.apache.org/repos/dist/dev/felix/apache-felix-dependencymanager-${version}/"
+REL_URL="http://nx0012/svnrepos/dist/dev/felix/apache-felix-dependencymanager-${version}/"
+PWD=`pwd`
+
+echo "################################################################################"
+echo "                               IMPORTING KEYS                                   "
+echo "################################################################################"
+if [ ! -e "${tmpDir}/KEYS" ]; then
+    wget --no-check-certificate -P "${tmpDir}" $KEYS_URL 
+fi
+gpg --import "${tmpDir}/KEYS" 
+
+if [ ! -e "${tmpDir}/apache-felix-dependencymanager-${version}" ]
+then
+    echo "################################################################################"
+    echo "                           DOWNLOAD STAGED REPOSITORY                         
 "
+    echo "################################################################################"
+
+    wget \
+      -e "robots=off" --wait 1 -r -np "--reject=html,txt" "--follow-tags=" \
+      -P "${tmpDir}/apache-felix-dependencymanager-${version}" -nH "--cut-dirs=5" --ignore-length
--no-check-certificate \
+      $REL_URL
+else
+    echo "################################################################################"
+    echo "                       USING EXISTING STAGED REPOSITORY                       
 "
+    echo "################################################################################"
+    echo "${tmpDir}/apache-felix-dependencymanager-${version}"
+fi
+
+echo "################################################################################"
+echo "                          CHECK SIGNATURES AND DIGESTS                          "
+echo "################################################################################"
+
+cd ${tmpDir}/apache-felix-dependencymanager-${version}
+for f in `find . -type f | grep -v '\.\(asc\|sha1\?\|md5\)$'`; do
+    echo "checking $f" 
+
+    echo -e "    ASC: \c"
+    checkSig $f
+    echo -e "    MD5: \c"
+    checkSum $f "$f.md5" MD5
+    echo -e "    SHA: \c"
+    checkSum $f "$f.sha" SHA512
+    echo ""
+done
+
+cd $PWD
+echo "################################################################################"
+

Propchange: felix/sandbox/pderop/dependencymanager/release/check_staged_dependencymanager.sh
------------------------------------------------------------------------------
    svn:executable = *

Added: felix/sandbox/pderop/dependencymanager/release/src/.gitignore
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager/release/src/.gitignore?rev=1649258&view=auto
==============================================================================
    (empty)

Added: felix/sandbox/pderop/dependencymanager/release/test/.gitignore
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager/release/test/.gitignore?rev=1649258&view=auto
==============================================================================
    (empty)



Mime
View raw message