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,6 +50,7 @@ Bug Fixes
Build Build
---------------------- ----------------------
1. SOLR-776: Added in ability to sign artifacts via Ant for releases (gsingers)
Documentation Documentation

View File

@ -712,21 +712,47 @@
<arg value="update"/> <arg value="update"/>
</exec> </exec>
</target> </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"> <target name="clean-dist-signatures">
<arg value="--armor"/> <delete failonerror="false">
<arg value="--output"/> <fileset dir="${dist}">
<arg value="${dist}/${fullnamever}.tgz.asc"/> <include name="**/*.asc"/>
<arg value="--detach-sig"/> </fileset>
<arg value="${dist}/${fullnamever}.tgz"/> </delete>
</exec> </target>
<exec executable="gpg"> <target name="sign-artifacts" depends="clean-dist-signatures">
<arg value="--armor"/> <!--<input message="Enter signature passphrase" addproperty="passphrase"/>
<arg value="--output"/> <touch file="${user.home}/.pwd.txt"/>
<arg value="${dist}/${fullnamever}.zip.asc"/> <chmod file="${user.home}/.pwd.txt" perm="600"/>
<arg value="--detach-sig"/> <echo file="${user.home}/.pwd.txt">${passphrase}</echo>-->
<arg value="${dist}/${fullnamever}.zip"/> <sign-artifact input.file="${dist}/${fullnamever}.tgz" output.file="${dist}/${fullnamever}.tgz.asc"/>
</exec> <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"> <tar destfile="${dist}/solr-maven.tar">
<tarfileset dir="${dist}/maven" prefix="maven"/> <tarfileset dir="${dist}/maven" prefix="maven"/>
</tar> </tar>
@ -738,6 +764,14 @@
<target name="generate-maven-artifacts" depends="maven.ant.tasks-check, create-package"> <target name="generate-maven-artifacts" depends="maven.ant.tasks-check, create-package">
<sequential> <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.build.dir}"/>
<mkdir dir="${maven.dist.dir}"/> <mkdir dir="${maven.dist.dir}"/>

View File

@ -101,6 +101,8 @@
<property name="maven.build.dir" value="${basedir}/build/maven"/> <property name="maven.build.dir" value="${basedir}/build/maven"/>
<property name="maven.dist.dir" value="${basedir}/dist/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" --> <!-- The version suffix of the Lucene artifacts checked into "lib" -->
<property name="lucene_version" value="2.4-dev"/> <property name="lucene_version" value="2.4-dev"/>
<!-- The version number to assign to the Maven artifacts. --> <!-- The version number to assign to the Maven artifacts. -->
@ -267,6 +269,51 @@
</sequential> </sequential>
</macrodef> </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" <target name="clean-contrib"
description="Cleans all contrib modules and their tests"> description="Cleans all contrib modules and their tests">
<contrib-crawl target="clean"/> <contrib-crawl target="clean"/>