Skip to content
Permalink
Browse files
added script to help with deployment
  • Loading branch information
justinmclean committed Mar 16, 2014
1 parent 69ae08c commit a2e850699969969b45d3a01ca125a51a40ca91cf
Show file tree
Hide file tree
Showing 7 changed files with 446 additions and 0 deletions.
@@ -0,0 +1,84 @@
#!/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.
##
################################################################################

if [ $# -ne 3 ]
then
echo "Usage: check_sigs flexunit_version ([0-99].[0-99].[0-999]) flex_version ([0-99].[0-99].[0-999]) release_candidate ([0-100])"
exit 1
fi

FLEXUNIT_VERSION="$1"
CHECK=`echo "$FLEXUNIT_VERSION" | grep -q -E '[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,3}$'`

if [ $? -ne 0 ]
then
echo "Apache FlexUnit version needs to be in the form [0-99].[0-99].[0-999]"
exit 1
fi

FLEX_VERSION="$1"
CHECK=`echo "$FLEX_VERSION" | grep -q -E '[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,3}$'`

if [ $? -ne 0 ]
then
echo "Apache Flex version needs to be in the form [0-99].[0-99].[0-999]"
exit 1
fi

RELEASE_CANDIDATE="$3"
CHECK=`echo "$RELEASE_CANDIDATE" | grep -q -E '[0-9]{1,2}'`

if [ $? -ne 0 ]
then
echo "Apache FlexiUnit release candidate to be in the range 1-99"
exit 1;
fi

# Assumes FLEXUNIT_DEV_AREA has been set up and point to SVN checked out dev area

VERSION_DIR="${FLEXUNIT_DEV_AREA}/sdk/${FLEXUNIT_VERSION}"
RC_DIR="${FLEXUNIT_DEV_AREA}/sdk/${FLEXUNIT_VERSION}/rc${RELEASE_CANDIDATE}"
BIN_DIR="${FLEXUNIT_DEV_AREA}/sdk/${FLEXUNIT_VERSION}/rc${RELEASE_CANDIDATE}/binaries"

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

gpg --verify "${FILE}.asc"

}

checkFile "${RC_DIR}/apache-flexunit-${FLEXUNIT_VERSION}-${FLEX_VERSION}-src.tar.gz"
checkFile "${RC_DIR}/apache-flexunit-${FLEXUNIT_VERSION}-${FLEX_VERSION}-src.zip"

checkFile "${BIN_DIR}/apache-flexunit-${FLEXUNIT_VERSION}-${FLEX_VERSION}-bin.tar.gz"
checkFile "${BIN_DIR}/apache-flexunit-${FLEXUNIT_VERSION}-${FLEX_VERSION}-bin.zip"

@@ -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.
##
################################################################################

if [ $# -ne 2 ]
then
echo "Usage: deploy_candidate flexunit_version ([0-99].[0-99].[0-999]) release_candidate ([0-100])"
fi

FLEXUNIT_VERSION="$1"
CHECK=`echo "$FLEXUNIT_VERSION" | grep -q -E '[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,3}$'`

if [ $? -ne 0 ]
then
echo "Apache FlexUnit version needs to be in the form [0-99].[0-99].[0-999]"
exit 1;
fi

RELEASE_CANDIDATE="$2"
CHECK=`echo "$RELEASE_CANDIDATE" | grep -q -E '[0-9]{1,2}'`

if [ $? -ne 0 ]
then
echo "Apache FlexUnit release candidate to be in the range 1-99"
exit 1;
fi

# Assumes FLEXUNIT_DEV_AREA has been set up and point to SVN dev area
# Assumes FLEXUNIT_REL_AREA has been set up and point to SVN release area

RC_DIR="${FLEXUNIT_DEV_AREA}/sdk/${FLEXUNIT_VERSION}/rc${RELEASE_CANDIDATE}"
RC_BIN_DIR="${FLEXUNIT_DEV_AREA}/sdk/${FLEXUNIT_VERSION}/rc${RELEASE_CANDIDATE}/binaries"

REL_VERSION_DIR="${FLEXUNIT_REL_AREA}/${FLEXUNIT_VERSION}"
REL_DIR="${FLEXUNIT_REL_AREA}/${FLEXUNIT_VERSION}"
REL_BIN_DIR="${FLEXUNIT_REL_AREA}/${FLEXUNIT_VERSION}/binaries"
REL_DOC_DIR="${FLEXUNIT_REL_AREA}/${FLEXUNIT_VERSION}/docs"

echo "RC directory is ${RC_DIR}"
echo "Release directory is ${REL_DIR}"

if [ ! -d "${REL_VERSION_DIR}" ]
then
mkdir "${REL_VERSION_DIR}"
fi

if [ ! -d "${REL_BIN_DIR}" ]
then
mkdir "${REL_BIN_DIR}"
fi

if [ ! -d "${REL_DOC_DIR}" ]
then
mkdir "${REL_DOC_DIR}"
fi

cp "${RC_DIR}"/README "${REL_DIR}"
cp "${RC_DIR}"/RELEASE_NOTES "${REL_DIR}"
cp "${RC_DIR}"/*-src.* "${REL_DIR}"
cp "${RC_BIN_DIR}"/*-bin.* "${REL_BIN_DIR}"



@@ -0,0 +1,83 @@
#!/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.
##
################################################################################


if [ $# -ne 2 ]
then
echo "Usage: deploy_release_candidate flex_version ([0-99].[0-99].[0-999]) release_candidate ([0-100])"
fi

FLEX_VERSION="$1"
CHECK=`echo "$FLEX_VERSION" | grep -q -E '[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,3}$'`

if [ $? -ne 0 ]
then
echo "Apache Flex version needs to be in the form [0-99].[0-99].[0-999]"
exit 1;
fi

RELEASE_CANDIDATE="$2"
CHECK=`echo "$RELEASE_CANDIDATE" | grep -q -E '[0-9]{1,2}'`

if [ $? -ne 0 ]
then
echo "Apache Flex release candidate to be in the range 1-99"
exit 1;
fi

# Assumes FLEX_DEV_AREA has been set up and point to SVN checked out dev area

VERSION_DIR="${FLEX_DEV_AREA}/sdk/${FLEX_VERSION}"
RC_DIR="${FLEX_DEV_AREA}/sdk/${FLEX_VERSION}/rc${RELEASE_CANDIDATE}"
BIN_DIR="${FLEX_DEV_AREA}/sdk/${FLEX_VERSION}/rc${RELEASE_CANDIDATE}/binaries"
DOC_DIR="${FLEX_DEV_AREA}/sdk/${FLEX_VERSION}/rc${RELEASE_CANDIDATE}/docs"

echo "RC directory is ${RC_DIR}"

if [ ! -d "${VERSION_DIR}" ]
then
mkdir "${VERSION_DIR}"
fi

if [ ! -d "${RC_DIR}" ]
then
mkdir "${RC_DIR}"
fi

if [ ! -d "${BIN_DIR}" ]
then
mkdir "${BIN_DIR}"
fi

if [ ! -d "${DOC_DIR}" ]
then
mkdir "${DOC_DIR}"
fi

cp README "${RC_DIR}"
cp RELEASE_NOTES "${RC_DIR}"
cp ./out/*-src.* "${RC_DIR}"
cp ./out/*-bin.* "${BIN_DIR}"
cp ./out/*-config.xml "${BIN_DIR}"
cp ./out/*-asdocs.* "${DOC_DIR}"



@@ -0,0 +1,49 @@
#!/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 release branch for the next Apache FlexUnit version

if [ $# -ne 1 ]
then
echo Usage: make_release_branch [0-100].[0-100].[0-1000]
fi

FLEXUNIT_VERSION="$1"
CHECK=`echo "$FLEXUNIT_VERSION" | grep -q -E '[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,3}$'`

if [ $? -ne 0 ]
then
echo "Apache FlexUnit version needs to be in the form [0-100].[0-100].[0-1000]"
exit 1;
fi

echo "Creating branch for Apache FlexUnit Version ${FLEXUNIT_VERSION}"

git push -u origin develop:release${FLEXUNIT_VERSION}

cd ..
mkdir "ApacheFlexUnit${FLEXUNIT_VERSION}"
cd "ApacheFlexUnit${FLEXUNIT_VERSION}"
git clone https://git-wip-us.apache.org/repos/asf/flex-sdk.git .
git checkout release${FLEXUNIT_VERSION}
git tag -a apache-flexunit-${FLEXUNIT_VERSION}RC1 -m \'"Apache FlexUnit ${FLEXUNIT_VERSION} RC1"\'
git push --tags
@@ -0,0 +1,65 @@
#!/bin/sh
#------------------------------------------------------------------------------
# Copyright 2004 The Apache Software Foundation
#
# Licensed 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.
#------------------------------------------------------------------------------
# $Id$
#
# Creates detached ascii signatures and md5 hashes for each of the files in the
# current directory.
#
# Also verifies the signatures.
#
# For each file in the current directory, two new files are created:
#
# <name>.asc -- ascii-armored detached PGP digital signature
# <name>.md5 -- md5 hash (checksum)
#
# where <name> is the name of the file, not including file path.
#
# For example, foo-1.0-src.tar.gz in the current directory will result in
# foo-1.0-src.tar.gz.asc and foo-1.0-src.tar.gz.md5 added to the current
# directory.
#
# Deletes any .asc or .md5 files in the current directory before processing
# and does NOT recurse subdirectories.
#
# Assumes that you have a pgp id and keypair set up and prompts for the
# passphrase for each signature created.
#
# usage:
# sign_and_hash.sh
#
# requires:
# gpg
# md5sum
#------------------------------------------------------------------------------
`rm -f *.asc`
`rm -f *.md5`
for file in *.zip; do
if [ -f "$file" ]; then
#md5sum -b $file > ${file}.md5
md5 -q $file > ${file}.md5
gpg --armor --output ${file}.asc --detach-sig $file
gpg --verify ${file}.asc $file
fi
done
for file in *.gz; do
if [ -f "$file" ]; then
#md5sum -b $file > ${file}.md5
md5 -q $file > ${file}.md5
gpg --armor --output ${file}.asc --detach-sig $file
gpg --verify ${file}.asc $file
fi
done

0 comments on commit a2e8506

Please sign in to comment.