Repository: bigtop Updated Branches: refs/heads/master db1fb87e3 -> 5ea264bee
BIGTOP-2679: Streamline CI Jobs Signed-off-by: Evans Ye <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/bigtop/repo Commit: http://git-wip-us.apache.org/repos/asf/bigtop/commit/5ea264be Tree: http://git-wip-us.apache.org/repos/asf/bigtop/tree/5ea264be Diff: http://git-wip-us.apache.org/repos/asf/bigtop/diff/5ea264be Branch: refs/heads/master Commit: 5ea264beee555c55816dc775981900e747025cca Parents: db1fb87 Author: Olaf Flebbe <[email protected]> Authored: Sun Jan 29 15:51:01 2017 +0100 Committer: Evans Ye <[email protected]> Committed: Wed Jun 28 22:42:55 2017 +0800 ---------------------------------------------------------------------- .dockerignore | 1 - bigtop-ci/build.sh | 54 ++++++++++++++++++++++++++++++++++++++++++++ bigtop-ci/entrypoint.sh | 4 ++++ 3 files changed, 58 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/bigtop/blob/5ea264be/.dockerignore ---------------------------------------------------------------------- diff --git a/.dockerignore b/.dockerignore index a7b219a..150d143 100644 --- a/.dockerignore +++ b/.dockerignore @@ -15,5 +15,4 @@ build output -bigtop-packages dl http://git-wip-us.apache.org/repos/asf/bigtop/blob/5ea264be/bigtop-ci/build.sh ---------------------------------------------------------------------- diff --git a/bigtop-ci/build.sh b/bigtop-ci/build.sh new file mode 100755 index 0000000..fc1f52f --- /dev/null +++ b/bigtop-ci/build.sh @@ -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-$$ http://git-wip-us.apache.org/repos/asf/bigtop/blob/5ea264be/bigtop-ci/entrypoint.sh ---------------------------------------------------------------------- diff --git a/bigtop-ci/entrypoint.sh b/bigtop-ci/entrypoint.sh new file mode 100755 index 0000000..bc580e1 --- /dev/null +++ b/bigtop-ci/entrypoint.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +. /etc/profile.d/bigtop.sh +exec ./gradlew "$@"
