Skip to content

Commit

Permalink
[build tools] Release script update
Browse files Browse the repository at this point in the history
Default hadoop version is now hadoop2
Generate specific pom avoids version collisions with dependencies
Updated poms for new release scripts

Conflicts:
	flink-addons/flink-avro/pom.xml
	flink-addons/flink-hadoop-compatibility/pom.xml
	flink-addons/flink-hbase/pom.xml
	flink-addons/flink-jdbc/pom.xml
	flink-addons/flink-spargel/pom.xml
	flink-addons/flink-tachyon/pom.xml
	flink-quickstart/flink-quickstart-java/pom.xml
	flink-quickstart/flink-quickstart-scala/pom.xml
  • Loading branch information
mbalassi authored and StephanEwen committed Jan 18, 2015
1 parent 3836c96 commit d14f383
Show file tree
Hide file tree
Showing 10 changed files with 59 additions and 49 deletions.
2 changes: 1 addition & 1 deletion flink-addons/flink-avro/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ under the License.
<modelVersion>4.0.0</modelVersion>

<parent>
<artifactId>flink-addons</artifactId>
<groupId>org.apache.flink</groupId>
<artifactId>flink-addons</artifactId>
<version>0.9-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion flink-addons/flink-hadoop-compatibility/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ under the License.
<modelVersion>4.0.0</modelVersion>

<parent>
<artifactId>flink-addons</artifactId>
<groupId>org.apache.flink</groupId>
<artifactId>flink-addons</artifactId>
<version>0.9-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion flink-addons/flink-hbase/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ under the License.
<modelVersion>4.0.0</modelVersion>

<parent>
<artifactId>flink-addons</artifactId>
<groupId>org.apache.flink</groupId>
<artifactId>flink-addons</artifactId>
<version>0.9-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion flink-addons/flink-jdbc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ under the License.
<modelVersion>4.0.0</modelVersion>

<parent>
<artifactId>flink-addons</artifactId>
<groupId>org.apache.flink</groupId>
<artifactId>flink-addons</artifactId>
<version>0.9-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion flink-addons/flink-spargel/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ under the License.
<modelVersion>4.0.0</modelVersion>

<parent>
<artifactId>flink-addons</artifactId>
<groupId>org.apache.flink</groupId>
<artifactId>flink-addons</artifactId>
<version>0.9-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion flink-addons/flink-tachyon/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ under the License.
<modelVersion>4.0.0</modelVersion>

<parent>
<artifactId>flink-addons</artifactId>
<groupId>org.apache.flink</groupId>
<artifactId>flink-addons</artifactId>
<version>0.9-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
Expand Down
28 changes: 14 additions & 14 deletions flink-quickstart/flink-quickstart-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@ specific language governing permissions and limitations
under the License.
-->
<project xmlns="http:https://maven.apache.org/POM/4.0.0" xmlns:xsi="http:https://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http:https://maven.apache.org/POM/4.0.0 http:https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
xsi:schemaLocation="http:https://maven.apache.org/POM/4.0.0 http:https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<parent>
<groupId>org.apache.flink</groupId>
<artifactId>flink-quickstart</artifactId>
<version>0.9-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<parent>
<groupId>org.apache.flink</groupId>
<artifactId>flink-quickstart</artifactId>
<version>0.9-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

<artifactId>flink-quickstart-java</artifactId>
<packaging>maven-archetype</packaging>
<artifactId>flink-quickstart-java</artifactId>
<packaging>maven-archetype</packaging>

</project>
</project>
26 changes: 13 additions & 13 deletions flink-quickstart/flink-quickstart-scala/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@ specific language governing permissions and limitations
under the License.
-->
<project xmlns="http:https://maven.apache.org/POM/4.0.0" xmlns:xsi="http:https://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http:https://maven.apache.org/POM/4.0.0 http:https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
xsi:schemaLocation="http:https://maven.apache.org/POM/4.0.0 http:https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<parent>
<groupId>org.apache.flink</groupId>
<artifactId>flink-quickstart</artifactId>
<version>0.9-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<parent>
<groupId>org.apache.flink</groupId>
<artifactId>flink-quickstart</artifactId>
<version>0.9-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

<artifactId>flink-quickstart-scala</artifactId>
<packaging>maven-archetype</packaging>
<artifactId>flink-quickstart-scala</artifactId>
<packaging>maven-archetype</packaging>

</project>
22 changes: 11 additions & 11 deletions tools/create_release_files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,22 @@ GIT_BRANCH=${GIT_BRANCH:-branch-1.0}
OLD_VERSION=${OLD_VERSION:-0.6-incubating-SNAPSHOT}
RELEASE_VERSION=${NEW_VERSION}
RELEASE_CANDIDATE=${RELEASE_CANDIDATE:-rc1}
NEW_VERSION_HADOOP2=${NEW_VERSION_HADOOP2:-"$RELEASE_VERSION-hadoop2"} # this is wrong, i.e. we need 0.7-hadoop2-incubating
NEW_VERSION_HADOOP1=${NEW_VERSION_HADOOP1:-"$RELEASE_VERSION-hadoop1"}
USER_NAME=${USER_NAME:-pwendell}
MVN=${MVN:-mvn}
GPG=${GPG:-gpg}
SHASUM=${SHASUM:-sha512sum}
MD5SUM=${MD5SUM:-md5sum}
sonatype_user=${sonatype_user:-rmetzger}
sonatype_user=${sonatype_user:-rmetzger} #legacy variable name referring to maven
sonatype_pw=${sonatype_pw:-XXX}

#echo $NEW_VERSION_HADOOP2
#echo $NEW_VERSION_HADOOP1
#sleep 5
#set -e

# create source package

git clone https://github.com/apache/incubator-flink.git flink
git clone https://github.com/apache/flink.git flink
cd flink
git checkout -b "$RELEASE_BRANCH-$RELEASE_CANDIDATE" origin/$RELEASE_BRANCH
rm .gitignore
Expand All @@ -70,7 +70,7 @@ find . -name 'pom.xml' -type f -exec sed -i 's#<version>'$OLD_VERSION'</version>

git commit --author="Robert Metzger <[email protected]>" -am "Commit for release $RELEASE_VERSION"
# sry for hardcoding my name, but this makes releasing even faster
git remote add asf_push https://rmetzger@git-wip-us.apache.org/repos/asf/incubator-flink.git
git remote add asf_push https://$USER_NAME@git-wip-us.apache.org/repos/asf/flink.git
RELEASE_HASH=`git rev-parse HEAD`
echo "Echo created release hash $RELEASE_HASH"

Expand Down Expand Up @@ -123,26 +123,26 @@ make_binary_release() {
fi
}

make_binary_release "hadoop1" ""
make_binary_release "hadoop200alpha" "-P!include-yarn -Dhadoop.profile=2 -Dhadoop.version=2.0.0-alpha"
make_binary_release "hadoop2" "-Dhadoop.profile=2"
make_binary_release "hadoop1" "-Dhadoop.profile=1"
make_binary_release "hadoop200alpha" "-P!include-yarn -Dhadoop.version=2.0.0-alpha"
make_binary_release "hadoop2" ""
# make_binary_release "mapr4" "-Dhadoop.profile=2 -Pvendor-repos -Dhadoop.version=2.3.0-mapr-4.0.0-FCS"


# Copy data
echo "Copying release tarballs"
folder=flink-$RELEASE_VERSION-$RELEASE_CANDIDATE
ssh $USER_NAME@people.apache.org mkdir /home/$USER_NAME/public_html/$folder
ssh $USER_NAME@people.apache.org mkdir -p /home/$USER_NAME/public_html/$folder
scp flink-* $USER_NAME@people.apache.org:/home/$USER_NAME/public_html/$folder/
echo "copy done"

echo "Deploying to repository.apache.org"

cd flink
cp ../../deploysettings.xml .
echo "For your reference, the command:\n\t $MVN clean deploy -Prelease --settings deploysettings.xml -DskipTests -Dgpg.keyname=$GPG_KEY -Dgpg.passphrase=$GPG_PASSPHRASE ./tools/generate_specific_pom.sh $NEW_VERSION $NEW_VERSION_HADOOP2 pom.xml"
echo "For your reference, the command:\n\t $MVN clean deploy -Prelease --settings deploysettings.xml -DskipTests -Dgpg.keyname=$GPG_KEY -Dgpg.passphrase=$GPG_PASSPHRASE ./tools/generate_specific_pom.sh $NEW_VERSION $NEW_VERSION_HADOOP1 pom.xml"
$MVN clean deploy -Prelease,docs-and-source --settings deploysettings.xml -DskipTests -Dgpg.executable=$GPG -Dgpg.keyname=$GPG_KEY -Dgpg.passphrase=$GPG_PASSPHRASE -DretryFailedDeploymentCount=10
./tools/generate_specific_pom.sh $NEW_VERSION $NEW_VERSION_HADOOP2 pom.xml
./tools/generate_specific_pom.sh $NEW_VERSION $NEW_VERSION_HADOOP1 pom.xml
sleep 4
$MVN clean deploy -Dgpg.executable=$GPG -Prelease,docs-and-source --settings deploysettings.xml -DskipTests -Dgpg.keyname=$GPG_KEY -Dgpg.passphrase=$GPG_PASSPHRASE -DretryFailedDeploymentCount=10

Expand Down
20 changes: 15 additions & 5 deletions tools/generate_specific_pom.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ echo "Using $nupom as name for the generated pom file."
poms=`find $flink_home -name pom.xml`
for p in $poms; do
# write into tmp file because in-place replacement is not possible (if nupom="pom.xml")
tmp_nuname="`dirname $p`/__generate_specific_pom_tmp"
tmp_nuname1="`dirname $p`/__generate_specific_pom_tmp1"
tmp_nuname2="`dirname $p`/__generate_specific_pom_tmp2"
nuname="`dirname $p`/${nupom}"
# Now we do search and replace of explicit strings. The best way of
# seeing what the below does is by doing a diff between the original
Expand All @@ -92,12 +93,21 @@ for p in $poms; do
# enable/disable hadoop 1 and hadoop 2 profiles as appropriate
# removing a comment string too. We output the new pom beside the
# original.
sed -e "s/${old_version}/${new_version}/" \
-e "s/\(<module>[^<]*\)/\1\/${nupom}/" \

# To avoid accidentally replace version numbers in our dependencies
# sharing the version number with the current release use the following.

perl -0777 -pe "s:<groupId>org.apache.flink</groupId>\n(\t*<artifactId>([a-z]+-)+[a-z]+</artifactId>\n\t*)<version>${old_version}</version>:<groupId>org.apache.flink</groupId>\n\1<version>${new_version}</version>:" $p > "$tmp_nuname1"

# Alternatively when no version collisions are present this is enough:
# sed -e "s/${old_version}/${new_version}/" $p > "$tmp_nuname1"

sed -e "s/\(<module>[^<]*\)/\1\/${nupom}/" \
-e "s/\(relativePath>\.\.\)/\1\/${nupom}/" \
-e "s/<!--hadoop1-->.*name>.*/${hadoop1}/" \
-e "s/<!--hadoop2-->.*name>.*/${hadoop2}/" \
$p > "$tmp_nuname"
mv $tmp_nuname $nuname
$tmp_nuname1 > "$tmp_nuname2"
rm $tmp_nuname1
mv $tmp_nuname2 $nuname
done

0 comments on commit d14f383

Please sign in to comment.