Repository: qpid-dispatch Updated Branches: refs/heads/1.1.x 6502523b0 -> d44e8a98b
NO-JIRA - Copied export.sh from qpid-proton with minor changes. Removed release.sh Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/d44e8a98 Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/d44e8a98 Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/d44e8a98 Branch: refs/heads/1.1.x Commit: d44e8a98b5699a20920a35fbf69a48ab2289ea75 Parents: 6502523 Author: Ganesh Murthy <gmur...@redhat.com> Authored: Wed May 2 13:03:31 2018 -0400 Committer: Ganesh Murthy <gmur...@redhat.com> Committed: Wed May 9 11:09:34 2018 -0400 ---------------------------------------------------------------------- bin/export.sh | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++ bin/release.sh | 95 ----------------------------------------------------- 2 files changed, 92 insertions(+), 95 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/d44e8a98/bin/export.sh ---------------------------------------------------------------------- diff --git a/bin/export.sh b/bin/export.sh new file mode 100755 index 0000000..9162de1 --- /dev/null +++ b/bin/export.sh @@ -0,0 +1,92 @@ +#!/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. +# + +# export.sh - Create a release archive. +set -e +trap "cleanup" 0 1 2 3 9 11 13 15 + +# ME=export.sh +ME=$(basename ${0}) + +SRC=$(dirname $(dirname $(readlink -f $0))) +echo Source directory=${SRC} + +usage() +{ + echo + echo "Usage: ${ME} [DIR] [TAG]" + exit 1 +} + +cleanup() +{ + trap - 0 1 2 3 9 11 13 15 + echo + [ ${WORKDIR} ] && [ -d ${WORKDIR} ] && rm -rf ${WORKDIR} +} + + +DIR=$PWD + +# This will get the latest created tag +TAG=$(git describe --tags --always) +echo Using tag ${TAG} to create archive + +## +## Allow overrides to be passed on the cmdline +## +if [ $# -gt 2 ]; then + usage +elif [ $# -ge 1 ]; then + DIR=$1 + if [ $# -eq 2 ]; then + TAG=$2 + fi +fi + +# verify the tag exists +git rev-list -1 tags/${TAG} -- >/dev/null || usage + +# mktemp command creates a temp directory for example - /tmp/tmp.k8vDddIzni +WORKDIR=$(mktemp -d) +echo Working Directory=${WORKDIR} + + +## +## Create the archive +## +( + cd ${SRC} + MTIME=$(date -d @`git log -1 --pretty=format:%ct tags/${TAG}` '+%Y-%m-%d %H:%M:%S') + VERSION=$(git show tags/${TAG}:VERSION.txt) + ARCHIVE=$DIR/qpid-dispatch-${VERSION}.tar.gz + PREFIX=qpid-dispatch-${VERSION} + [ -d ${WORKDIR} ] || mkdir -p ${WORKDIR} + git archive --format=tar --prefix=${PREFIX}/ tags/${TAG} \ + | tar -x -C ${WORKDIR} + cd ${WORKDIR} + tar -c -z \ + --owner=root --group=root --numeric-owner \ + --mtime="${MTIME}" \ + -f ${ARCHIVE} ${PREFIX} + echo Created "${ARCHIVE}" + echo Success!!! +) http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/d44e8a98/bin/release.sh ---------------------------------------------------------------------- diff --git a/bin/release.sh b/bin/release.sh deleted file mode 100755 index aeb7d67..0000000 --- a/bin/release.sh +++ /dev/null @@ -1,95 +0,0 @@ -#!/usr/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. -# -# -# Script to pull together an Apache Release -# - -ME=$(basename $0) - -usage() { - cat <<-EOF -USAGE: ${ME} [options] BRANCH VERSION -Creates an Apache release tarball. - -Mandatory arguments: - BRANCH The git branch/tag for the build - VERSION The release version. - -Optional arguments: - -h This help screen -EOF -} - -while getopts "h" opt; do - case $opt in - h) - usage - exit 0 - ;; - - \?) - echo "Invalid option: -$OPTARG" >&2 - usage - exit 1 - ;; - - :) - echo "Option -$OPTARG requires an argument." >&2 - usage - exit 1 - ;; - esac -done - -BRANCH=${1-} -VERSION=${2-} - -if [[ -z "$BRANCH" ]] || [[ -z "$VERSION" ]]; then - printf "Missing one or more required argument.\n\n" >&2 - usage - exit 1 -fi - -URL=https://git-wip-us.apache.org/repos/asf/qpid-dispatch.git - -WORKDIR=$(mktemp -d) -BASENAME=qpid-dispatch-${VERSION} -GITDIR=$WORKDIR/$BASENAME -FILENAME=$PWD/${BASENAME}.tar.gz - -if [ -f $FILENAME ]; then rm -f $FILENAME; fi - -echo "Checking out to ${WORKDIR}..." -cd $WORKDIR -git clone $URL $BASENAME >/dev/null || exit 1 -cd $GITDIR -git checkout $BRANCH >/dev/null || exit 1 - -BUILD_VERSION=$(cat $GITDIR/VERSION.txt) || exit 1 -test "$VERSION" == "$BUILD_VERSION" || { - echo "Version mismatch: $VERSION != $BUILD_VERSION. Please update VERSION.txt in the source" - exit 1 -} - -echo "Building source tarball $FILENAME" -cd $WORKDIR -tar --exclude release.sh --exclude .git --exclude .gitignore -zcvf $FILENAME ${BASENAME} >/dev/null || exit 1 - -echo "Done!" --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org For additional commands, e-mail: commits-h...@qpid.apache.org