This is an automated email from the ASF dual-hosted git repository.
rohit pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cloudstack-primate.git
The following commit(s) were added to refs/heads/master by this push:
new c5f8d98 tools: release and docker script
c5f8d98 is described below
commit c5f8d988b48badc96fa416b158336223eb5d0c26
Author: Rohit Yadav <[email protected]>
AuthorDate: Sat May 9 11:27:37 2020 +0530
tools: release and docker script
Also moves misc files to tools/
Signed-off-by: Rohit Yadav <[email protected]>
---
README.md | 4 +-
{docs => tools}/api/apis.old | 0
{docs => tools}/api/apis.primate.sh | 4 +-
{docs => tools}/api/apis.remaining | 0
build.sh => tools/docker.sh | 2 +-
{legacy => tools/legacy}/fieldsFromOldLayout.json | 0
{legacy => tools/legacy}/filterTranslations.py | 0
{legacy => tools/legacy}/generateOldLayout.js | 0
{legacy => tools/legacy}/manualNeededLabels.json | 0
tools/performrelease.sh | 153 ++++++++++++++++++++++
10 files changed, 158 insertions(+), 5 deletions(-)
diff --git a/README.md b/README.md
index b31835f..0e63b6b 100644
--- a/README.md
+++ b/README.md
@@ -106,9 +106,9 @@ server {
A production-ready Docker container can also be built with the provided
Dockerfile and build script.
-Make sure Docker is installed, then run build.sh:
+Make sure Docker is installed, then run:
- ./build.sh
+ bash tools/docker.sh
Change the example configuration in `nginx/default.conf` according to your
needs.
diff --git a/docs/api/apis.old b/tools/api/apis.old
similarity index 100%
rename from docs/api/apis.old
rename to tools/api/apis.old
diff --git a/docs/api/apis.primate.sh b/tools/api/apis.primate.sh
similarity index 95%
rename from docs/api/apis.primate.sh
rename to tools/api/apis.primate.sh
index b12d004..568eece 100644
--- a/docs/api/apis.primate.sh
+++ b/tools/api/apis.primate.sh
@@ -6,8 +6,8 @@ grep store.getters.apis -R . | sed "s/' in.*//g" | sed
"s/').*//g" | grep "'" |
grep 'permission:\ \[' -R config | sed "s/.*permission: \['//g" | grep -v .js
| sed "s/', '/\\n/g" | sed "s/'.*//g" >> apis.txt
cat apis.txt | sort | uniq > apis.uniq
rm -f apis.txt
-mv apis.uniq ../docs/api/apis.txt
-cd ../docs/api
+mv apis.uniq ../tools/api/apis.txt
+cd ../tools/api
diff -Naur apis.old apis.txt | grep ^- | grep -v "^--" | sed 's/^-//g' | grep
-v -i -e cisco -e nicira -e baremetal -e srx -e f5 -e brocade -e palo -e
autoscale -e counter -e condition -e ucs -e netscaler -e bigswitch -e ovs -e
globalloadbalancer -e opendaylight -e region -e quota | sort | uniq >
apis.remaining
echo "$(cat apis.txt | wc -l) APIs are supported by Primate"
diff --git a/docs/api/apis.remaining b/tools/api/apis.remaining
similarity index 100%
rename from docs/api/apis.remaining
rename to tools/api/apis.remaining
diff --git a/build.sh b/tools/docker.sh
similarity index 98%
rename from build.sh
rename to tools/docker.sh
index 059d374..21406b6 100755
--- a/build.sh
+++ b/tools/docker.sh
@@ -28,4 +28,4 @@ LABEL_DATE="--label
\"org.opencontainers.image.created=${DATE}\""
GIT_REV="$(git rev-parse HEAD)"
LABEL_GIT_REV="--label \"org.opencontainers.image.revision=${GIT_REV}\""
-docker build -t cloudstack-primate ${LABEL_DATE} ${LABEL_GIT_REV}
${LABEL_GIT_TAG} .
+docker build -t cloudstack-primate ${LABEL_DATE} ${LABEL_GIT_REV}
${LABEL_GIT_TAG} ..
diff --git a/legacy/fieldsFromOldLayout.json
b/tools/legacy/fieldsFromOldLayout.json
similarity index 100%
rename from legacy/fieldsFromOldLayout.json
rename to tools/legacy/fieldsFromOldLayout.json
diff --git a/legacy/filterTranslations.py b/tools/legacy/filterTranslations.py
similarity index 100%
rename from legacy/filterTranslations.py
rename to tools/legacy/filterTranslations.py
diff --git a/legacy/generateOldLayout.js b/tools/legacy/generateOldLayout.js
similarity index 100%
rename from legacy/generateOldLayout.js
rename to tools/legacy/generateOldLayout.js
diff --git a/legacy/manualNeededLabels.json
b/tools/legacy/manualNeededLabels.json
similarity index 100%
rename from legacy/manualNeededLabels.json
rename to tools/legacy/manualNeededLabels.json
diff --git a/tools/performrelease.sh b/tools/performrelease.sh
new file mode 100755
index 0000000..c6d6438
--- /dev/null
+++ b/tools/performrelease.sh
@@ -0,0 +1,153 @@
+#!/bin/sh
+# 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.
+
+version='TESTBUILD'
+sourcedir=~/cloudstack-primate
+outputdir=/tmp/cloudstack-primate-build/
+branch='master'
+tag='no'
+certid='X'
+committosvn='X'
+
+usage(){
+ echo "usage: $0 -v version [-b branch] [-s source dir] [-o output dir]
[-t] [-u] [-c] [-h]"
+ echo " -v sets the version"
+ echo " -b sets the branch (defaults to 'master')"
+ echo " -s sets the source directory (defaults to $sourcedir)"
+ echo " -o sets the output directory (defaults to $outputdir)"
+ echo " -t tags the git repo with the version"
+ echo " -u sets the certificate ID to sign with (if not provided, the
default key is attempted)"
+ echo " -c commits build artifacts to cloudstack dev dist dir in svn"
+ echo " -h"
+}
+
+while getopts v:s:o:b:u:tch opt
+do
+ case "$opt" in
+ v) version="$OPTARG";;
+ s) sourcedir="$OPTARG";;
+ o) outputdir="$OPTARG";;
+ b) branch="$OPTARG";;
+ t) tag="yes";;
+ u) certid="$OPTARG";;
+ c) committosvn="yes";;
+ h) usage
+ exit 0;;
+ /?) # unknown flag
+ usage
+ exit 1;;
+ esac
+done
+shift `expr $OPTIND - 1`
+
+if [ $version == "TESTBUILD" ]; then
+ echo >&2 "A version must be specified with the -v option: $0 -v 1.0.0.RC1"
+ exit 1
+fi
+
+echo "Using version: $version"
+echo "Using source directory: $sourcedir"
+echo "Using output directory: $outputdir"
+echo "Using branch: $branch"
+if [ "$tag" == "yes" ]; then
+ if [ "$certid" == "X" ]; then
+ echo "Tagging the branch with the version number, and signing the
branch with your default certificate."
+ else
+ echo "Tagging the branch with the version number, and signing the
branch with certificate ID $certid."
+ fi
+else
+ echo "The branch will not be tagged. You should consider doing this."
+fi
+
+echo $PWD
+
+exit
+
+if [ -d "$outputdir" ]; then
+ rm -r $outputdir/*
+else
+ mkdir $outputdir
+fi
+
+cd $sourcedir
+
+echo 'checking out correct branch'
+git checkout $branch
+
+git clean -f
+
+export commitsh=`git show HEAD | head -n 1 | cut -d ' ' -f 2`
+echo "releasing as $commitsh"
+
+echo 'archiving'
+git archive --format=tar --prefix=apache-cloudstack-primate-$version-src/
$branch > $outputdir/apache-cloudstack-primate-$version-src.tar
+bzip2 $outputdir/apache-cloudstack-primate-$version-src.tar
+
+cd $outputdir
+echo 'armor'
+if [ "$certid" == "X" ]; then
+ gpg -v --armor --output apache-cloudstack-primate-$version-src.tar.bz2.asc
--detach-sig apache-cloudstack-primate-$version-src.tar.bz2
+else
+ gpg -v --default-key $certid --armor --output
apache-cloudstack-primate-$version-src.tar.bz2.asc --detach-sig
apache-cloudstack-primate-$version-src.tar.bz2
+fi
+
+echo 'md5'
+gpg -v --print-md MD5 apache-cloudstack-primate-$version-src.tar.bz2 >
apache-cloudstack-primate-$version-src.tar.bz2.md5
+
+echo 'sha512'
+gpg -v --print-md SHA512 apache-cloudstack-primate-$version-src.tar.bz2 >
apache-cloudstack-primate-$version-src.tar.bz2.sha512
+
+echo 'verify'
+gpg -v --verify apache-cloudstack-primate-$version-src.tar.bz2.asc
apache-cloudstack-primate-$version-src.tar.bz2
+
+if [ "$tag" == "yes" ]; then
+ echo 'tag'
+ cd $sourcedir
+ if [ "$certid" == "X" ]; then
+ git tag -s $version -m "Tagging release $version on branch $branch."
+ else
+ git tag -u $certid -s $version -m "Tagging release $version on branch
$branch."
+ fi
+fi
+
+if [ "$committosvn" == "yes" ]; then
+ echo 'committing artifacts to svn'
+ rm -Rf /tmp/cloudstack-dev-dist
+ cd /tmp
+ svn co https://dist.apache.org/repos/dist/dev/cloudstack/ cloudstack-dev-dist
+ cd cloudstack-dev-dist
+ if [ -d "primate-$version" ]; then
+ cd primate-$version
+ svn rm *
+ else
+ mkdir primate-$version
+ svn add primate-$version
+ cd primate-$version
+ fi
+ cp $outputdir/apache-cloudstack-primate-$version-src.tar.bz2 .
+ cp $outputdir/apache-cloudstack-primate-$version-src.tar.bz2.asc .
+ cp $outputdir/apache-cloudstack-primate-$version-src.tar.bz2.md5 .
+ cp $outputdir/apache-cloudstack-primate-$version-src.tar.bz2.sha512 .
+ svn add apache-cloudstack-primate-$version-src.tar.bz2
+ svn add apache-cloudstack-primate-$version-src.tar.bz2.asc
+ svn add apache-cloudstack-primate-$version-src.tar.bz2.md5
+ svn add apache-cloudstack-primate-$version-src.tar.bz2.sha512
+ svn commit -m "Committing release candidate artifacts for $version to
dist/dev/cloudstack in preparation for release vote"
+fi
+
+echo "completed. use commit-sh of $commitsh when starting the VOTE thread"