Repository: incubator-edgent Updated Branches: refs/heads/master d5a66832c -> a85c6c320
[WIP] Add some release process tools Add check_sigs.sh Add make_release_branch.sh Project: http://git-wip-us.apache.org/repos/asf/incubator-edgent/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-edgent/commit/bac43c8a Tree: http://git-wip-us.apache.org/repos/asf/incubator-edgent/tree/bac43c8a Diff: http://git-wip-us.apache.org/repos/asf/incubator-edgent/diff/bac43c8a Branch: refs/heads/master Commit: bac43c8a7c7e749ab0d824404949f7e47cae734e Parents: 79ba9f7 Author: Dale LaBossiere <dlab...@us.ibm.com> Authored: Fri Oct 21 16:56:12 2016 -0400 Committer: Dale LaBossiere <dlab...@us.ibm.com> Committed: Sat Oct 22 12:44:50 2016 -0400 ---------------------------------------------------------------------- buildTools/check_sigs.sh | 80 ++++++++++++++++++++++++++++++++++ buildTools/make_release_branch.sh | 62 ++++++++++++++++++++++++++ 2 files changed, 142 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/bac43c8a/buildTools/check_sigs.sh ---------------------------------------------------------------------- diff --git a/buildTools/check_sigs.sh b/buildTools/check_sigs.sh new file mode 100755 index 0000000..2eb30e4 --- /dev/null +++ b/buildTools/check_sigs.sh @@ -0,0 +1,80 @@ +#!/bin/sh -e + +################################################################################ +## +## 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. +## +################################################################################ + +# Checks the signatures of all bundles in the build/release-edgent directory +# Or checks the bundles in the specified directory + +if [ $1 == "-?" || $1 == "help" || $# -gt 1 ] +then + echo "Usage: check_sigs.sh [bundle-directory]" + exit 1 +fi + +# Assumes run from the root of the edgent git repo +EDGENT_ROOT=. + +BUNDLE_DIR="${EDGENT_ROOT}/build/release-edgent" +if [ $# -ge 1 ] +then + BUNDLE_DIR=$1 +fi + +if [ ! -d ${BUNDLE_DIR} ] +then + echo "Bundle directory '${BUNDLE_DIR}' does not exist" + exit 1 +fi + +function checkFile() { + FILE="$1" + + HASH=`md5 -q "${FILE}"` + CHECK=`cat "${FILE}.md5"` + + if [ "$HASH" != "$CHECK" ] + then + echo "${FILE} MD5 incorrect" + exit 1; + else + echo "${FILE} MD5 OK"; + fi + + HASH=`shasum -p -a 512 "${FILE}" | awk '{print$1}'` + CHECK=`cat "${FILE}.sha"` + + if [ "$HASH" != "$CHECK" ] + then + echo "${FILE} SHA incorrect" + exit 1; + else + echo "${FILE} SHA OK"; + fi + + gpg --verify "${FILE}.asc" + +} + +for bundle in "${BUNDLE_DIR}/*.tgz" +do + checkFile $bundle +done + +echo "SUCCESS: all checksum and signature files OK" http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/bac43c8a/buildTools/make_release_branch.sh ---------------------------------------------------------------------- diff --git a/buildTools/make_release_branch.sh b/buildTools/make_release_branch.sh new file mode 100755 index 0000000..8b4d377 --- /dev/null +++ b/buildTools/make_release_branch.sh @@ -0,0 +1,62 @@ +#!/bin/sh -e + +################################################################################ +## +## 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 creates a release branch for the Apache Edgent version from gradle.properties/build_version +# +# Must be run at the root of a clone of the master ASF git repository from https://git-wip-us.apache.org/repos/asf/incubator-edgent.git + +if [ $# -ne 0 ] +then + echo Usage: buildTools/make_release_branch.sh +fi + +EDGENT_VERSION=`grep build_version gradle.properties | awk '{print $2}'` +CHECK=`echo "$EDGENT_VERSION" | grep -q -E '[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,3}$'` + +if [ $? -ne 0 ] +then + echo "Apache Edgent version needs to be in the form [0-100].[0-100].[0-999]" + exit 1; +fi + +EDGENT_ROOT=. +RELEASE_BRANCH=release${EDGENT_VERSION} +RELEASE_CLONE_DIRNAME=asfclone-edgent${EDGENT_VERSION} + +echo "Updating local master branch" +git checkout master +git fetch origin +git rebase origin/master + +echo "Creating release branch ${RELEASE_BRANCH}" +git push -u origin master:${RELEASE_BRANCH} + +echo "Creating new clone ${RELEASE_CLONE_DIRNAME} for release work" +cd ${EDGENT_ROOT}/.. +mkdir "${RELEASE_CLONE_DIRNAME}" +cd "${RELEASE_CLONE_DIRNAME}" +git clone https://git-wip-us.apache.org/repos/asf/incubator-edgent.git . + +echo "Creating the RC1 tag" +git checkout ${RELEASE_BRANCH} +git tag -a apache-edgent-${EDGENT_VERSION}RC1 -m "Apache Edgent ${EDGENT_VERSION} RC1" +git push --tags