Skip to content

Commit d835575

Browse files
committed
clean up and consolidate run scripts
* put run.sh at root level so it's easy to find * make run.sh suitable for direct local use * remove support for dbuild versions prior to 0.9.5 * remove unnecessary complication/indirection
1 parent be8102d commit d835575

File tree

3 files changed

+50
-78
lines changed

3 files changed

+50
-78
lines changed

run.sh

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/usr/bin/env bash
2+
3+
# This script is suitable for local use.
4+
# It is also invoked by Jenkins (from scripts/jobs/integrate/community-build).
5+
6+
# usage: ./run.sh [<dbuild-options>]
7+
8+
set -e
9+
set -o pipefail
10+
11+
export LANG="en_US.UTF-8"
12+
export HOME="$(pwd)"
13+
14+
DBUILDVERSION=0.9.5
15+
echo "dbuild version: $DBUILDVERSION"
16+
17+
DBUILDCONFIG=community.dbuild
18+
echo "dbuild config file: $DBUILDCONFIG"
19+
20+
if [ ! -f "$DBUILDCONFIG" ]
21+
then
22+
echo "File not found: $DBUILDCONFIG"
23+
exit 1
24+
fi
25+
26+
if [ ! -d "dbuild-${DBUILDVERSION}" ]
27+
then
28+
wget "http://repo.typesafe.com/typesafe/ivy-releases/com.typesafe.dbuild/dbuild/${DBUILDVERSION}/tgzs/dbuild-${DBUILDVERSION}.tgz"
29+
tar xfz "dbuild-${DBUILDVERSION}.tgz"
30+
rm "dbuild-${DBUILDVERSION}.tgz"
31+
fi
32+
33+
# sigh, Ubuntu has nodejs but OS X has node
34+
if hash nodejs 2>/dev/null; then
35+
export NODE=nodejs
36+
else
37+
export NODE=node
38+
fi
39+
40+
# use -n since running locally you don't want notifications sent,
41+
# and on our Jenkins setup it doesn't actually work (for now anyway)
42+
43+
echo "dbuild-${DBUILDVERSION}/bin/dbuild" -n "${@}" "$DBUILDCONFIG"
44+
"dbuild-${DBUILDVERSION}/bin/dbuild" -n "${@}" "$DBUILDCONFIG" 2>&1 | tee "dbuild-${DBUILDVERSION}/dbuild.out"
45+
STATUS="$?"
46+
BUILD_ID="$(grep '^\[info\] uuid = ' "dbuild-${DBUILDVERSION}/dbuild.out" | sed -e 's/\[info\] uuid = //')"
47+
echo "The repeatable UUID of this build was: ${BUILD_ID}"
48+
exit "$STATUS"

scripts/dbuild-runner.sh

Lines changed: 0 additions & 76 deletions
This file was deleted.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/usr/bin/env bash
22

3-
DBUILDVERSION=0.9.5
3+
set -e
44

55
# otherwise these directories just keep growing.
66
# see scala/scala-jenkins-infra#115
77
rm -rf target-$DBUILDVERSION/project-builds
88
rm -rf target-$DBUILDVERSION/extraction
99

10-
scripts/dbuild-runner.sh "community.dbuild" "$DBUILDVERSION" "${@}"
10+
scripts/run.sh "${@}"

0 commit comments

Comments
 (0)