You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by dr...@apache.org on 2018/02/20 14:33:39 UTC
svn commit: r1824887 - in /httpd/site/trunk/tools: push.sh tag.sh
Author: druggeri
Date: Tue Feb 20 14:33:38 2018
New Revision: 1824887
URL: http://svn.apache.org/viewvc?rev=1824887&view=rev
Log:
Add some additional convenience tooling
Added:
httpd/site/trunk/tools/push.sh (with props)
httpd/site/trunk/tools/tag.sh (with props)
Added: httpd/site/trunk/tools/push.sh
URL: http://svn.apache.org/viewvc/httpd/site/trunk/tools/push.sh?rev=1824887&view=auto
==============================================================================
--- httpd/site/trunk/tools/push.sh (added)
+++ httpd/site/trunk/tools/push.sh Tue Feb 20 14:33:38 2018
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+# Push candidate release tarballs in directory to the dev or release dist repos
+#
+# USAGE: push.sh directory dev|dist (scratch_dir)
+# directory: Directory to obtain release artifacts from
+# dev|dist: If "dev", push to https://dist.apache.org/repos/dist/dev/httpd/
+# If "dist", push to https://dist.apache.org/repos/dist/release/httpd
+# scratch_dir: Optional directory to use as the SVN clone and staging location.
+# Will be created and deleted automatically by this script
+
+#Useful for debugging
+set -x
+
+#Bail when non-zero return codes are encountered
+set -e
+
+usage () {
+ echo "USAGE: $0 directory dev|dist (scratch_dir)"
+ echo "WARNING: The scratch_dir will be purged if it exists"
+ exit 1
+}
+
+dir=$1
+repo=$2
+scratch=$3
+
+if test -z "$dir";then usage
+elif test -z "$repo"; then usage
+elif test "dev" = "$repo";then
+ svn=https://dist.apache.org/repos/dist/dev/httpd/
+elif test "dist" = "$repo";then
+ svn=https://dist.apache.org/repos/dist/release/httpd
+else usage
+fi
+
+if test -z "$scratch";then
+ scratch=./tmp_scratch
+fi
+
+#Ensure scratch space is clean and doesn't exist
+rm -rf "$scratch"
+
+svn checkout --depth=empty $svn "$scratch"
+cd "$scratch"
+svn update CHANGES*
+cd -
+cp "$dir"/*.tar.* "$scratch"/
+cp "$dir"/CHANGES* "$scratch"/
+
+#Push our changes up to DIST repo
+cd "$scratch"
+svn add *.tar.*
+svn commit -m 'Add release files'
Propchange: httpd/site/trunk/tools/push.sh
------------------------------------------------------------------------------
svn:executable = *
Added: httpd/site/trunk/tools/tag.sh
URL: http://svn.apache.org/viewvc/httpd/site/trunk/tools/tag.sh?rev=1824887&view=auto
==============================================================================
--- httpd/site/trunk/tools/tag.sh (added)
+++ httpd/site/trunk/tools/tag.sh Tue Feb 20 14:33:38 2018
@@ -0,0 +1,186 @@
+#!/bin/sh
+
+# Tag SVN in preparation for rolling a release candidate, verify the operator of this script
+# is in the dist/KEYS file and tickle a few files post-tag
+#
+# USAGE: tag.sh branch tag directory [SIGNING-USER]
+# EXAMPLE: tag.sh trunk 2.5.0-alpha /tmp/foo
+#
+# branch is one of "trunk" or a version under the branches directory
+# tag is the name of the directory svn copy will create under tags/
+# directory is a scratch space for obtaining files from svn and updating files
+# SIGNING-USER is optional. If the default key in a GPG keyring should not be used, specify the specific key here
+#
+# The "signing user" is the name of the key that you'll be signing the
+# release with.
+#
+
+#Useful for debugging
+#set -x
+
+#Bail when non-zero return codes are encountered
+set -e
+
+usage () {
+ echo "USAGE: $0 BRANCH VERSION DIRECTORY [SIGNING-USER]"
+ echo "WARNING: The directory will be purged if it exists"
+ exit 1
+}
+
+branch=$1
+version=$2
+dir=$3
+user=$4
+
+src_dir="$dir/release"
+tags_dir="$dir/tags"
+dist_dir="$dir/dist"
+major=`echo $version | cut -d "." -f 1`
+minor=`echo $version | cut -d "." -f 2`
+#Not currently used in this script, but make it available. Support -alpha, -beta -rcX names here
+patch=`echo $version | cut -d "." -f 3 | sed -e 's/-.*//'`
+
+#Allow for environment overrides
+test -z "$SVN_ROOT" && SVN_ROOT="https://svn.apache.org/repos/asf/httpd"
+
+#This feels brittle, but I'm missing the command to just print a fingerprint...
+if test -z "$user";then
+ #GPG states first key is the default key
+ fingerprint=`gpg --list-secret-keys --with-fingerprint 2>/dev/null | grep "Key fingerprint" | sed -e 's/.* = //g' | head -1`
+else
+ fingerprint=`gpg --list-secret-keys --with-fingerprint '$user' 2>/dev/null | grep "Key fingerprint" | sed -e 's/.* = //g' | head -1`
+fi
+
+if test -z "$branch";then usage
+elif test -z "$version"; then usage
+elif test -z "$dir"; then usage
+fi
+
+#If fingerprint is still unset, set it to empty string
+test -z "$fingerprint" && fingerprint=""
+
+#Consider any undefined variable substitution a failure from here out
+set -u
+
+#Ensure the directory exists and is empty by nuking it first
+rm -rf "$dir"
+mkdir -p "$dir"
+mkdir "$src_dir"
+mkdir "$tags_dir"
+mkdir "$dist_dir"
+
+if test "$branch" = "trunk";then
+ svn checkout "$SVN_ROOT/httpd/trunk" "$src_dir"
+else
+ svn checkout "$SVN_ROOT/httpd/branches/$branch" "$src_dir"
+fi
+svn checkout --depth=empty "$SVN_ROOT/httpd/tags" "$tags_dir"
+svn checkout --depth=empty https://dist.apache.org/repos/dist/release/httpd "$dist_dir"
+
+current_year=`date +%Y`
+
+#Gather information we will need
+cd "$src_dir"
+cur_major=`grep -E '#define\sAP_SERVER_MAJORVERSION_NUMBER' include/ap_release.h | awk '{print $3}'`
+cur_minor=`grep -E '#define\sAP_SERVER_MINORVERSION_NUMBER' include/ap_release.h | awk '{print $3}'`
+cur_patch=`grep -E '#define\sAP_SERVER_PATCHLEVEL_NUMBER' include/ap_release.h | awk '{print $3}'`
+cur_version="$cur_major.$cur_minor.$cur_patch"
+next_patch=`expr $cur_patch + 1`
+next_version="$major.$minor.$next_patch"
+date_string=`date '+%B %d, %Y'`
+
+
+#Begin the work in earnest
+#See steps from http://httpd.apache.org/dev/release.html
+
+
+# Ensure that the RM's PGP/GPG key is in the httpd-dist/KEYS file.
+cd "$dist_dir"
+svn update KEYS
+
+if test -z "$fingerprint";then
+ echo "ERROR: Could not find key fingerprint. Will not verify key is in KEYS file"
+else
+ #Permit failure of grep here so we can gracefully exit after reprting the error
+ set +e
+ found=`gpg --with-fingerprint KEYS 2>/dev/null | grep -c "$fingerprint"`
+ set -e
+ if test "$found" = 0;then
+ echo "ERROR: Key fingerprint '$fingerprint' not found in KEYS file"
+ exit 1
+ fi
+fi
+
+
+# Ensure the Copyright date reflects the current year in the NOTICE, docs/manual/style/latex/latex.xsl, and docs/manual/style/xsl/common.xsl files.
+perl -pi -e "s/Copyright \d+ The Apache Software Foundation./Copyright $current_year The Apache Software Foundation./g" NOTICE docs/manual/style/xsl/common.xsl
+
+
+# Execute ./build.sh all convmap to ensure that the documentation transformations are up to date.
+cd "$src_dir/docs/manual"
+#See http://httpd.apache.org/docs-project/docsformat.html for these instructions
+svn co https://svn.apache.org/repos/asf/httpd/docs-build/trunk build
+cd build
+./build.sh all convmap
+./build.sh validate-xml
+./build.sh validate-xhtml
+cd ../
+rm -rf build
+
+
+cd "$src_dir"
+# Set AP_SERVER_DEVBUILD_BOOLEAN to 0 in include/ap_release.h.
+perl -pi -e 's/(#define\s+AP_SERVER_DEVBUILD_BOOLEAN\s+)\d/${1}0/g' include/ap_release.h
+svn commit -m "Get ready to tag httpd $version"
+
+
+# Create an official X.Y.Z tag based on the candidate tree.
+svn copy "$src_dir" "$tags_dir/$version"
+
+
+# Revert the change to include/ap_release.h setting AP_SERVER_DEVBUILD_BOOLEAN back to 1, and bump AP_SERVER_PATCHLEVEL_NUMBER
+perl -pi -e '
+ s/(#define\s+AP_SERVER_DEVBUILD_BOOLEAN\s+)\d/${1}1/g;
+
+ if(/(#define\s+AP_SERVER_PATCHLEVEL_NUMBER\s+)(\d+)$/){
+ $new = $2 + 1;
+ $_ = "${1}${new}\n";
+ }
+ ' include/ap_release.h
+
+
+# Bump ENTITY httpd.patch in docs/manual/style/version.ent.
+perl -pi -e '
+ if(/(.*ENTITY httpd.patch ")(\d+)(.*)/){
+ $new=$2 + 1;
+ $_="${1}${new}${3}\n";
+ }
+ ' docs/manual/style/version.ent
+
+
+# Add the corresponding version placeholder in CHANGES.
+sed -i "/coding: utf-8/a Changes with Apache $next_version\n" CHANGES
+
+
+# Note the tag date in the STATUS file.
+perl -pi -e '
+ if(/^(\s+)('$cur_version'\s+):/){
+ $size = length $2;
+ $newline = sprintf("${1}%-${size}s", "'$next_version'") . ": In development\n";
+ $newline2 = sprintf("${1}%-${size}s", "'$cur_version'") . ": Tagged on '"$date_string"'\n";
+ $_="${newline1}${newline2}";
+ }
+ ' STATUS
+
+
+# Commit the last of our source code work
+cd "$tags_dir"
+svn commit -m "Tag $version"
+
+cd "$src_dir"
+svn commit -m "Post $version tag updates"
+
+#Outside the scope of this script...
+# Run the svn.apache.org/repos/asf/httpd/site/trunk/tools/release.sh script.
+# Commit the generated release tarballs and signatures to the subversion https://dist.apache.org/repos/dist/dev/httpd/ repository.
+# Email dev@httpd.apache.org with a [VOTE] Release X.Y.Z to call for testing and votes on this candidate.
Propchange: httpd/site/trunk/tools/tag.sh
------------------------------------------------------------------------------
svn:executable = *
Re: svn commit: r1824887 - in /httpd/site/trunk/tools: push.sh tag.sh
Posted by Jim Jagielski <ji...@jaguNET.com>.
This is what I've been using:
#!/bin/sh
#
if test "$#" != 1; then
echo "USAGE: $0 TAG" >&2
exit 1
fi
svn copy -m "Tag HEAD of 2.4.x as $1" https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x https://svn.apache.org/repos/asf/httpd/httpd/tags/$1
> On Feb 20, 2018, at 10:17 AM, Yann Ylavic <yl...@gmail.com> wrote:
>
> On Tue, Feb 20, 2018 at 3:33 PM, <dr...@apache.org> wrote:
>> Author: druggeri
>> Date: Tue Feb 20 14:33:38 2018
>> New Revision: 1824887
>>
>> URL: http://svn.apache.org/viewvc?rev=1824887&view=rev
>> Log:
>> Add some additional convenience tooling
>>
>> Added:
> []
>> httpd/site/trunk/tools/tag.sh (with props)
> []
>>
>> Added: httpd/site/trunk/tools/tag.sh
>> URL: http://svn.apache.org/viewvc/httpd/site/trunk/tools/tag.sh?rev=1824887&view=auto
>> ==============================================================================
>> --- httpd/site/trunk/tools/tag.sh (added)
>> +++ httpd/site/trunk/tools/tag.sh Tue Feb 20 14:33:38 2018
> []
>> +
>> +cd "$src_dir"
>> +# Set AP_SERVER_DEVBUILD_BOOLEAN to 0 in include/ap_release.h.
>> +perl -pi -e 's/(#define\s+AP_SERVER_DEVBUILD_BOOLEAN\s+)\d/${1}0/g' include/ap_release.h
>> +svn commit -m "Get ready to tag httpd $version"
>> +
>> +
>> +# Create an official X.Y.Z tag based on the candidate tree.
>> +svn copy "$src_dir" "$tags_dir/$version"
>
> Could we use remote urls here to avoid local modifications mixture?
> Eg.: svn copy ^/httpd/httpd/branches/$branch ^/httpd/httpd/tags/$version
> The tag shouldn't (possibly) include anything not in the branch.
>
> Regards,
> Yann.
Re: svn commit: r1824887 - in /httpd/site/trunk/tools: push.sh tag.sh
Posted by Yann Ylavic <yl...@gmail.com>.
On Tue, Feb 20, 2018 at 3:33 PM, <dr...@apache.org> wrote:
> Author: druggeri
> Date: Tue Feb 20 14:33:38 2018
> New Revision: 1824887
>
> URL: http://svn.apache.org/viewvc?rev=1824887&view=rev
> Log:
> Add some additional convenience tooling
>
> Added:
[]
> httpd/site/trunk/tools/tag.sh (with props)
[]
>
> Added: httpd/site/trunk/tools/tag.sh
> URL: http://svn.apache.org/viewvc/httpd/site/trunk/tools/tag.sh?rev=1824887&view=auto
> ==============================================================================
> --- httpd/site/trunk/tools/tag.sh (added)
> +++ httpd/site/trunk/tools/tag.sh Tue Feb 20 14:33:38 2018
[]
> +
> +cd "$src_dir"
> +# Set AP_SERVER_DEVBUILD_BOOLEAN to 0 in include/ap_release.h.
> +perl -pi -e 's/(#define\s+AP_SERVER_DEVBUILD_BOOLEAN\s+)\d/${1}0/g' include/ap_release.h
> +svn commit -m "Get ready to tag httpd $version"
> +
> +
> +# Create an official X.Y.Z tag based on the candidate tree.
> +svn copy "$src_dir" "$tags_dir/$version"
Could we use remote urls here to avoid local modifications mixture?
Eg.: svn copy ^/httpd/httpd/branches/$branch ^/httpd/httpd/tags/$version
The tag shouldn't (possibly) include anything not in the branch.
Regards,
Yann.