Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes to build_release.sh script #607

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 23 additions & 16 deletions bin/build_modules.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,25 +1,32 @@
#!/bin/bash

LEIN=`which lein2 || which lein`
set -e # die if anything bad happens

function banner {
echo ; echo "------------- $1 ---------------" ; echo
}

LEIN=`which lein2 || which lein`
export LEIN_ROOT=1


for module in $(cat MODULES)
do
echo "Building $module"
cd $module
if [ $module != "storm-console-logging" ]
then
rm ../conf/logback.xml
fi

banner "Building $module"
cd $module
if [ $module != "storm-console-logging" ]
then
rm -f ../conf/logback.xml
else
git checkout ../conf/logback.xml ; true
fi

$LEIN with-profile release clean
$LEIN with-profile release deps
$LEIN with-profile release jar
$LEIN with-profile release install
$LEIN with-profile release pom
$LEIN with-profile release clean
$LEIN with-profile release deps
$LEIN with-profile release jar
$LEIN with-profile release install
$LEIN with-profile release pom

git checkout ../conf/logback.xml
cd ..
done
git checkout ../conf/logback.xml ; true
cd ..
done
95 changes: 60 additions & 35 deletions bin/build_release.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,62 +1,87 @@
#!/bin/bash
function quit {
exit 1
exit 1
}
trap quit 1 2 3 15 # Ctrl+C exits.

function banner {
echo ; echo "=========================" ; echo "==" ; echo "== $1" ; echo "==" ; echo
}
trap quit 1 2 3 15 #Ctrl+C exits.

RELEASE=`cat VERSION`
LEIN=`which lein2 || which lein`
LEIN=`which lein2 || which lein`
export LEIN_ROOT=1

echo Making release $RELEASE
# ==========================================================================
banner "Making release $RELEASE"

DIR=`pwd`/_release/storm-$RELEASE
CODE_ROOT=`pwd`
DIR="$CODE_ROOT/_release/storm-$RELEASE"
ZIPFILE="$CODE_ROOT/storm-$RELEASE.zip"

rm -rf _release
rm -f *.zip
rm -rf "$DIR"
rm -f "$ZIPFILE"
$LEIN pom || exit 1
mkdir -p $DIR/lib
mkdir -p "$DIR/lib"

# ==========================================================================
banner "Building submodules"

/bin/bash "$CODE_ROOT/bin/build_modules.sh" || exit 1

sh bin/build_modules.sh
# ==========================================================================
banner "Gathering dependencies"

for module in $(cat MODULES)
do
cd $module
mvn dependency:copy-dependencies || exit 1
cp -f target/dependency/*.jar $DIR/lib/
cp -f target/*.jar $DIR/
cd ..
cd "$CODE_ROOT/$module"
mvn dependency:copy-dependencies || exit 1
cp -f target/dependency/*.jar "$DIR/lib/"
cp -f target/*.jar "$DIR/"
cd "$CODE_ROOT"
done

cd _release/storm-$RELEASE
for i in *.jar
# The netty libs have storm itself as a dependency; remove any jar in $DIR/lib/ that is in $DIR/
cd "$DIR"
for base_jar in *.jar
do
rm -f lib/$i
done
cd ../..
rm -f lib/$base_jar
done
cd "$CODE_ROOT"

# ==========================================================================
banner "Copying support files"

cp -v CHANGELOG.md "$DIR/"

cp CHANGELOG.md $DIR/
echo $RELEASE > "$DIR/RELEASE"

echo $RELEASE > $DIR/RELEASE
mkdir -p "$DIR/logback"
mkdir -p "$DIR/logs"
cp -vR logback/cluster.xml "$DIR/logback/cluster.xml"

mkdir -p $DIR/logback
mkdir -p $DIR/logs
cp -R logback/cluster.xml $DIR/logback/cluster.xml
mkdir "$DIR/conf"
cp -v conf/storm.yaml.example "$DIR/conf/storm.yaml"

mkdir $DIR/conf
cp conf/storm.yaml.example $DIR/conf/storm.yaml
cp -vR storm-core/src/ui/public "$DIR/"

cp -R storm-core/src/ui/public $DIR/
cp -vRp bin "$DIR/"
rm "$DIR"/bin/build_{release,modules}.sh

cp -R bin $DIR/
cp -v README.markdown "$DIR/"
cp -v LICENSE.html "$DIR/"

cp README.markdown $DIR/
cp LICENSE.html $DIR/
# ==========================================================================
banner "Building Zip File in '$ZIPFILE'"

cd _release
zip -r storm-$RELEASE.zip *
cd ..
mv _release/storm-*.zip .
rm -rf _release
cd "$CODE_ROOT/_release"
zip -r "$ZIPFILE" *
cd "$CODE_ROOT"
echo

if [ "$STORM_KEEP_RELEASE" == "true" ] ; then
echo "keeping _release dir '$DIR'"
else
echo "removing _release dir"
rm -rf "$DIR"
fi
1 change: 1 addition & 0 deletions bin/storm
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ if not os.path.exists(STORM_DIR + "/RELEASE"):
print "******************************************"
print "The storm client can only be run from within a release. You appear to be trying to run the client from a checkout of Storm's source code."
print "\nYou can download a Storm release at https://github.com/nathanmarz/storm/downloads"
print "\nor build it yourself by running ./bin/build_release.sh from a clone of the source repo."
print "******************************************"
sys.exit(1)

Expand Down
6 changes: 4 additions & 2 deletions storm-console-logging/project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
(def VERSION (-> ROOT-DIR (str "/../VERSION") slurp (.trim)))

(defproject storm/storm-console-logging VERSION
:dependencies [[org.clojure/clojure "1.4.0"]
]
:resource-paths ["logback"]

:profiles {:release {}
:profiles {
:release { :target-path "target" }
}

:aot :all)
2 changes: 1 addition & 1 deletion storm-core/project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

:profiles {:dev {:resource-paths ["src/dev"]
:dependencies [[org.mockito/mockito-all "1.9.5"]]}
:release {}
:release { :target-path "target" }
:lib {}
}

Expand Down
4 changes: 3 additions & 1 deletion storm-netty/project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
[io.netty/netty "3.6.3.Final"]]
:java-source-paths ["src/jvm"]
:test-paths ["test/clj"]
:profiles {:release {}}
:profiles {
:release { :target-path "target" }
}
:jvm-opts ["-Djava.library.path=/usr/local/lib:/opt/local/lib:/usr/lib"]
:aot :all))