Skip to content
Permalink
Browse files
Initial commit (donation from https://github.com/anton-vinogradov/apa…
…che-ignite-release)

Signed-off-by: Anton Vinogradov <av@apache.org>
  • Loading branch information
anton-vinogradov committed Feb 15, 2018
0 parents commit 903eb904c82030c34752374a13439da9bae9f9e1
Showing 11 changed files with 373 additions and 0 deletions.
@@ -0,0 +1,2 @@
*.log
.idea/
@@ -0,0 +1 @@
# apache-ignite-release
@@ -0,0 +1,75 @@
0) In case you're on Windows, please install WSL
See https://msdn.microsoft.com/en-us/commandline/wsl/install_guide for details
Perform all operations in bash console! (type "bash" at windows console)

1) Software required to perform release:
- Maven 3.x
- Java 7.x or 8.x
- Svn command line client
- Git command line client
Don't forget to configure username and email
git config --global user.name "John Doe"
git config --global user.email johndoe@apache.org
- GPG (already installed at most of *Nix)

In case you're on Windows, please make sure all listed software installed under WSL.
Type "bash" in Windows console and check each one. Use following commands to check:
java -version
git --version
svn --version
mvn -version
gpg --version
and use 'apt install ...' to install anything missing

2) Configuration required to perform release:
- Create/Import your pgp secret key.
In case you have no pgp key, please follow instructions from https://www.apache.org/dev/openpgp.html#generate-key

Don't forget to add your public pgp key here to https://dist.apache.org/repos/dist/release/ignite/KEYS.txt
https://dist.apache.org is a svn repository and can be updated using your apache credentials.

Append you key using commands:

gpg --list-sigs <keyname> >> KEYS.txt
gpg --armor --export <keyname> >> KEYS.txt

- Configure maven settings.xml (usually in /usr/share/maven/conf/ on Ubuntu):

Add following and fill <username>, <password> and <gpg.*>

<servers>
<server>
<id>apache.releases.https</id>
<username>*</username> <!-- your apache username -->
<password>*</password> <!-- your apache password -->
</server>
</servers>

<profiles>
<profile>
<id>gpg</id>
<properties>
<gpg.keyname>*</gpg.keyname> <!-- pgp keyname, eg. E38286D5 -->
<gpg.passphrase>*</gpg.passphrase> <!-- pgp passphrase -->
<gpg.useagent>false</gpg.useagent>
</properties>
</profile>
</profiles>

3) Perform Vote steps and start Vote.
Run all vote*.sh scripts
Scripts are independent of each other and can be run in parallel, except *X_step_Y*.sh

NOTE: some scripts may require sudo permissions, so you will be asked for sudo password

3.1) Perform Release Verification and send Release For Vote
See https://cwiki.apache.org/confluence/display/IGNITE/Release+Process for details

4) Once Vote accepted, perform Release steps.
Run all release*.sh scripts
Scripts are independent of each other and can be run in parallel, except *X_step_Y*.sh

4.1) Close Vote
See https://cwiki.apache.org/confluence/display/IGNITE/Release+Process for details
Don't forget about Post-release steps

@@ -0,0 +1,19 @@
#!/usr/bin/env bash

chmod +x release.properties
. ./release.properties

echo "Releasing ${ignite_version}${rc_name}"

#uncomment subsequent line in case you want to remove incorrectly released vote
#svn rm -m "Removing redundant Release" https://dist.apache.org/repos/dist/release/ignite/$ignite_version || true
svn mv https://dist.apache.org/repos/dist/dev/ignite/${ignite_version}${rc_name} https://dist.apache.org/repos/dist/release/ignite/${ignite_version} -m "Release ${ignite_version}: Binaries"
svn mv https://dist.apache.org/repos/dist/dev/ignite/rpm_${ignite_version}${rc_name} https://dist.apache.org/repos/dist/release/ignite/rpm -m "Release ${ignite_version}: RPMs"

echo "Please check results..."

echo " "
echo "======================================================"
echo "Artifacts should be moved to release repository"
echo "Please check results at"
echo "https://dist.apache.org/repos/dist/release/ignite/"
@@ -0,0 +1,24 @@
#!/usr/bin/env bash

chmod +x release.properties
. ./release.properties

echo "Releasing ${ignite_version}${rc_name}"

rm -r fabric

unzip svn/vote/apache-ignite-fabric-*-bin.zip -d fabric

echo "Uploading to svn ..."

#uncomment subsequent line in case you want to remove incorrectly released vote
#svn rm -m "Removing redundant Release" https://svn.apache.org/repos/asf/ignite/site/trunk/releases/$ignite_version || true
svn import fabric/apache-ignite-fabric-$ignite_version-bin/docs https://svn.apache.org/repos/asf/ignite/site/trunk/releases/$ignite_version -m "new Release ($ignite_version)"
svn import fabric/apache-ignite-fabric-$ignite_version-bin/platforms/cpp/docs https://svn.apache.org/repos/asf/ignite/site/trunk/releases/$ignite_version/cppdoc -m "new Release (${ignite_version})"
svn import fabric/apache-ignite-fabric-$ignite_version-bin/platforms/dotnet/docs https://svn.apache.org/repos/asf/ignite/site/trunk/releases/$ignite_version/dotnetdoc -m "new Release (${ignite_version})"

echo " "
echo "======================================================"
echo "Documentation should be uploaded to site repository"
echo "Please check results at"
echo "https://svn.apache.org/repos/asf/ignite/site/trunk/releases"
@@ -0,0 +1,18 @@
#!/usr/bin/env bash

chmod +x release.properties
. ./release.properties

echo "Releasing ${ignite_version}${rc_name}"

cd git

echo "Creating new tag..."
git tag -a $ignite_version -m "${ignite_version}"
git push origin $ignite_version

echo " "
echo "======================================================"
echo "Release tag should be created."
echo "Please check results at "
echo "https://git-wip-us.apache.org/repos/asf?p=ignite.git;a=tags"
@@ -0,0 +1,28 @@
#!/usr/bin/env bash

chmod +x release.properties
. ./release.properties

echo "Preparing vote ${ignite_version}${rc_name}"

cd git

echo "Removing obsolete tag..."
echo $ignite_version
echo $rc_name

git fetch --tags
git tag -d $ignite_version$rc_name
git push origin :refs/tags/$ignite_version$rc_name

git status

echo "Creating new tag..."
git tag -a $ignite_version$rc_name -m "${ignite_version}${rc_name}"
git push origin $ignite_version$rc_name

echo " "
echo "======================================================"
echo "RC tag should be created."
echo "Please check results at "
echo "https://git-wip-us.apache.org/repos/asf?p=ignite.git;a=tags"
@@ -0,0 +1,97 @@
#!/usr/bin/env bash

chmod +x release.properties
. ./release.properties

echo "Preparing vote ${ignite_version}${rc_name}"

server_url="https://repository.apache.org/service/local/staging/deploy/maven2"
server_id="apache.releases.https"

now=$(date +'%H%M%S')

logname="../vote_2_${now}.log"

cd maven

list=$(find ./org -type d -name "ignite-*")

total_cnt=$(find ./org -type d -name "ignite-*" | wc -l)

cnt=0

for dir in $list
do
main_file=$(find $dir -name "*${ignite_version}.jar")

pom=$(find $dir -name "*.pom")

javadoc=$(find $dir -name "*javadoc.jar")

sources=$(find $dir -name "*sources.jar")

tests=$(find $dir -name "*tests.jar")

features=$(find $dir -name "*features.xml")

adds=""

cnt=$((cnt+1))

echo "Uploading ${dir} (${cnt} of ${total_cnt})."

if [[ $javadoc == *javadoc* ]]
then
adds="${adds} -Djavadoc=${javadoc}"
fi

if [[ $sources == *sources* ]]
then
adds="${adds} -Dsources=${sources}"
fi

if [[ $tests == *tests* ]]
then
adds="${adds} -Dfiles=${tests} -Dtypes=jar -Dclassifiers=tests"
fi

if [[ $features == *features* ]]
then
main_file=$pom adds="${adds} -Dpackaging=pom -Dfiles=${features} -Dtypes=xml -Dclassifiers=features"
fi

if [[ ! -n $main_file && ! -n $features ]]
then
main_file=$pom
adds="-Dpackaging=pom"
fi

echo "Directory:" >> ./$logname
echo $dir >> ./$logname
echo "File:" >> ./$logname
echo $main_file >> ./$logname
echo "Adds:" >> ./$logname
echo $adds >> ./$logname
echo "Features:" >> ./$logname
echo $features >> ./$logname

mvn gpg:sign-and-deploy-file -Pgpg -Dfile=$main_file -Durl=$server_url -DrepositoryId=$server_id -DretryFailedDeploymentCount=10 -DpomFile=$pom ${adds} >> ./$logname
done

result="Uploaded"

while IFS='' read -r line || [[ -n "$line" ]]; do
if [[ $line == *ERROR* ]]
then
result="Uploading failed. Please check log file: ${logname}."
fi
done < ./$logname

echo $result

echo " "
echo "======================================================"
echo "Maven staging should be created"
echo "Please check results at"
echo "https://repository.apache.org/#stagingRepositories"
echo "Don't forget to close staging with proper comment"
@@ -0,0 +1,56 @@
#!/usr/bin/env bash

chmod +x release.properties
. ./release.properties

REPO_ROOT="rpm/$(echo ${ignite_version} | cut -f1 -d.).x"

#
# Install required packages if necessary
#
if [ ! -f /usr/bin/rpm -o \
! -f /usr/bin/rpmsign -o \
! -f /usr/bin/createrepo -o \
! -f /usr/bin/gpg-connect-agent ]
then
echo "# Installing requred packages #"
sudo apt-get update
sudo apt-get install rpm createrepo gnupg-agent --no-install-recommends -y
fi
echo

#
# Build package
#
echo "# Building RPM package #"
if [ ! -f rpmbuild ]; then rm -rf rpmbuild; fi
mkdir -pv rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
cp -rfv git/packaging/rpm/* rpmbuild
cp -rfv svn/vote/apache-ignite-fabric-${ignite_version}-bin.zip rpmbuild/SOURCES/apache-ignite.zip
rpmbuild -bb --define "_topdir $(pwd)/rpmbuild" rpmbuild/SPECS/apache-ignite.spec
echo

#
# Prepare repository root
#
echo "# Preparing repository root #"
if [ ! -f rpm ]; then rm -rf rpm; fi
mkdir -pv ${REPO_ROOT}
mv -v rpmbuild/RPMS/noarch/*.rpm ${REPO_ROOT}
echo

#
# Sign RPM
#
echo "# Signing RPM #"
rpm --define "_gpg_name $(gpg --list-keys | grep uid | sed -r 's|uid\ +(.*)|\1|')" --addsign ${REPO_ROOT}/*.rpm
echo

#
# Create repository layout
#
echo "# Creating repository layout #"
CREATEREPO=createrepo
grep -q "Microsoft" /proc/version && CREATEREPO="sudo ${CREATEREPO}" # Detect Windows 10 WSL
${CREATEREPO} -v -p -s sha512 --update ${REPO_ROOT}

@@ -0,0 +1,34 @@
#!/usr/bin/env bash

now=$(date +'%H%M%S')
logname="vote_3_${now}.log"

echo "# Starting GPG Agent #"
gpg-connect-agent /bye

list=$({ find ./svn/vote -type f -name "*.zip"; find ./rpm -type f -name "*"; })

for file in $list
do
echo "Signing ${file}"
echo ${file} >> ./${logname}
GPG_AGENT_INFO=~/.gnupg/S.gpg-agent:0:1 gpg -ab ${file} >> ./${logname}
done

result="Signed OK."

while IFS='' read -r line || [[ -n "${line}" ]]; do
if [[ $line == *ERROR* ]]
then
result="Signing failed. Please check log file: ${logname}."
fi
done < ./${logname}

echo ${result}

echo " "
echo "=============================================="
echo "Artifacts should be signed"
echo "Please check results at ./svn/vote and ./rpm"
echo "Each file should have corresponding *.asc file"

@@ -0,0 +1,19 @@
#!/usr/bin/env bash

chmod +x release.properties
. ./release.properties

echo "RC ${ignite_version}${rc_name}"

#uncomment subsequent line in case you want to remove incorrectly prepared RC
#svn rm -m "Removing redundant Release" https://dist.apache.org/repos/dist/dev/ignite/$ignite_version$rc_name || true
svn import svn/vote https://dist.apache.org/repos/dist/dev/ignite/$ignite_version$rc_name -m "New RC ${ignite_version}${rc_name}: Binaries"
svn import rpm https://dist.apache.org/repos/dist/dev/ignite/rpm_$ignite_version$rc_name -m "New RC ${ignite_version}${rc_name}: RPMs"

echo "Please check results..."

echo " "
echo "======================================================"
echo "Artifacts should be moved to RC repository"
echo "Please check results at"
echo "https://dist.apache.org/repos/dist/dev/ignite/"

0 comments on commit 903eb90

Please sign in to comment.