SOLR-776: artifact signing

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@697123 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Grant Ingersoll 2008-09-19 15:07:17 +00:00
parent 9fef1d8ddc
commit 020b3dcb6b
3 changed files with 98 additions and 16 deletions

View File

@ -50,7 +50,8 @@ Bug Fixes
Build
----------------------
1. SOLR-776: Added in ability to sign artifacts via Ant for releases (gsingers)
Documentation
----------------------

View File

@ -712,21 +712,47 @@
<arg value="update"/>
</exec>
</target>
<target name="prepare-release" depends="clean, svn-up, build-site, package" description="Prototype helper for Committers. Assumes gpg is in the path">
<exec executable="gpg">
<arg value="--armor"/>
<arg value="--output"/>
<arg value="${dist}/${fullnamever}.tgz.asc"/>
<arg value="--detach-sig"/>
<arg value="${dist}/${fullnamever}.tgz"/>
</exec>
<exec executable="gpg">
<arg value="--armor"/>
<arg value="--output"/>
<arg value="${dist}/${fullnamever}.zip.asc"/>
<arg value="--detach-sig"/>
<arg value="${dist}/${fullnamever}.zip"/>
</exec>
<target name="clean-dist-signatures">
<delete failonerror="false">
<fileset dir="${dist}">
<include name="**/*.asc"/>
</fileset>
</delete>
</target>
<target name="sign-artifacts" depends="clean-dist-signatures">
<!--<input message="Enter signature passphrase" addproperty="passphrase"/>
<touch file="${user.home}/.pwd.txt"/>
<chmod file="${user.home}/.pwd.txt" perm="600"/>
<echo file="${user.home}/.pwd.txt">${passphrase}</echo>-->
<sign-artifact input.file="${dist}/${fullnamever}.tgz" output.file="${dist}/${fullnamever}.tgz.asc"/>
<sign-artifact input.file="${dist}/${fullnamever}.zip" output.file="${dist}/${fullnamever}.zip.asc"/>
<!-- Maven artifacts -->
<sign-maven-artifacts artifact.id="solr-common"/>
<sign-maven-dependency-artifacts artifact.id="solr-commons-csv"/>
<sign-maven-artifacts artifact.id="solr-core"/>
<sign-maven-artifacts artifact.id="solr-dataimporthandler"/>
<sign-maven-dependency-artifacts artifact.id="solr-lucene-analyzers"/>
<sign-maven-dependency-artifacts artifact.id="solr-lucene-core"/>
<sign-maven-dependency-artifacts artifact.id="solr-lucene-highlighter"/>
<sign-maven-dependency-artifacts artifact.id="solr-lucene-queries"/>
<sign-maven-dependency-artifacts artifact.id="solr-lucene-snowball"/>
<sign-maven-dependency-artifacts artifact.id="solr-lucene-spellchecker"/>
<sign-maven-artifacts artifact.id="solr-solrj"/>
<!-- Thes are special since there are no jars, just poms -->
<sign-artifact input.file="${maven.dist.prefix}/solr-parent/${maven_version}/solr-parent-${maven_version}.pom"/>
<sign-artifact input.file="${maven.dist.prefix}/solr-lucene-contrib/${maven_version}/solr-lucene-contrib-${maven_version}.pom"/>
<!--<delete file="${user.home}/.pwd.txt"/>-->
</target>
<target name="prepare-release" depends="clean, svn-up, build-site, package, sign-artifacts" description="Prototype helper for Committers. Assumes gpg is in the path">
<tar destfile="${dist}/solr-maven.tar">
<tarfileset dir="${dist}/maven" prefix="maven"/>
</tar>
@ -738,6 +764,14 @@
<target name="generate-maven-artifacts" depends="maven.ant.tasks-check, create-package">
<sequential>
<!--
!!!!!!!!!!
NOTE: If you add new artifacts, please make sure you also add to the sign-artifacts target
so that they get signed during release.
!!!!!!!
-->
<mkdir dir="${maven.build.dir}"/>
<mkdir dir="${maven.dist.dir}"/>

View File

@ -101,6 +101,8 @@
<property name="maven.build.dir" value="${basedir}/build/maven"/>
<property name="maven.dist.dir" value="${basedir}/dist/maven"/>
<property name="maven.dist.prefix" value="${maven.dist.dir}/org/apache/solr"/>
<!-- The version suffix of the Lucene artifacts checked into "lib" -->
<property name="lucene_version" value="2.4-dev"/>
<!-- The version number to assign to the Maven artifacts. -->
@ -267,6 +269,51 @@
</sequential>
</macrodef>
<macrodef name="sign-artifact" description="Signs the artifact">
<attribute name="input.file"/>
<attribute name="output.file" default="@{input.file}.asc"/>
<!--<attribute name="password.file" default="${user.home}/.pwd.txt"/>-->
<sequential>
<echo >Signing @{input.file} Sig File: @{output.file}</echo><!--Pass: @{password.file}-->
<exec executable="gpg" > <!--input="@{password.file}"-->
<arg value="--armor"/>
<arg value="--output"/>
<arg value="@{output.file}"/>
<arg value="--detach-sig"/>
<arg value="@{input.file}"/>
</exec>
</sequential>
</macrodef>
<!--
We need to sign:
The POM
The library jar
The sources jar
the javadoc jar
-->
<macrodef name="sign-maven-artifacts" description="Signs maven artifacts">
<attribute name="artifact.id"/>
<attribute name="prefix.dir" default="${maven.dist.prefix}"/>
<attribute name="maven.version" default="${maven_version}"/>
<sequential>
<sign-artifact input.file="@{prefix.dir}/@{artifact.id}/@{maven.version}/@{artifact.id}-@{maven.version}.jar"/>
<sign-artifact input.file="@{prefix.dir}/@{artifact.id}/@{maven.version}/@{artifact.id}-@{maven.version}-javadoc.jar"/>
<sign-artifact input.file="@{prefix.dir}/@{artifact.id}/@{maven.version}/@{artifact.id}-@{maven.version}-sources.jar"/>
</sequential>
</macrodef>
<macrodef name="sign-maven-dependency-artifacts" description="Signs maven artifacts">
<attribute name="artifact.id"/>
<attribute name="prefix.dir" default="${maven.dist.prefix}"/>
<attribute name="maven.version" default="${maven_version}"/>
<sequential>
<sign-artifact input.file="@{prefix.dir}/@{artifact.id}/@{maven.version}/@{artifact.id}-@{maven.version}.jar"/>
</sequential>
</macrodef>
<target name="clean-contrib"
description="Cleans all contrib modules and their tests">
<contrib-crawl target="clean"/>