-
Notifications
You must be signed in to change notification settings - Fork 502
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Evans Ye <evansye@apache.org>
- Loading branch information
Showing
3 changed files
with
58 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,5 +15,4 @@ | |
|
||
build | ||
output | ||
bigtop-packages | ||
dl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/bin/bash | ||
|
||
while [[ $# -gt 1 ]] | ||
do | ||
key="$1" | ||
case $key in | ||
-t|--target) | ||
TARGET="$2" | ||
shift | ||
;; | ||
-o|--os) | ||
OS="$2" | ||
shift | ||
;; | ||
-n|--nexus) | ||
NEXUS="--net=container:nexus" | ||
CONFIGURE_NEXUS="configure-nexus" | ||
shift | ||
;; | ||
*) | ||
echo "usage build.sh --os debian-8|centos-7|... --target hadoop|tez|..." | ||
exit 1 # unknown option | ||
;; | ||
esac | ||
shift | ||
done | ||
|
||
# prepare source image | ||
cat >Dockerfile <<EOF | ||
FROM bigtop/slaves:$OS | ||
# copy source to container | ||
COPY . /var/lib/jenkins/bigtop | ||
# make it belong to compile account | ||
RUN chown -R jenkins /var/lib/jenkins/bigtop | ||
# define default user jenkins | ||
USER jenkins | ||
WORKDIR /var/lib/jenkins/bigtop | ||
ENTRYPOINT [ "bigtop-ci/entrypoint.sh" ] | ||
# initialize gradle | ||
RUN bigtop-ci/entrypoint.sh | ||
# make it a volume, performancewise | ||
VOLUME /var/lib/jenkins | ||
EOF | ||
|
||
# build source image | ||
docker build -t image-$OS . | ||
|
||
# run build | ||
docker run --name container-$OS-$TARGET-$$ $NEXUS image-$OS $CONFIGURE_NEXUS $TARGET | ||
|
||
# save result | ||
mkdir -p output | ||
docker cp container-$OS-$TARGET-$$:/var/lib/jenkins/bigtop/output . | ||
docker rm -v container-$OS-$TARGET-$$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
|
||
. /etc/profile.d/bigtop.sh | ||
exec ./gradlew "$@" |