Repository: couchdb-ci Updated Branches: refs/heads/master 0e191f37f -> e9c8fb0a3
add script to run container based build on Jenkins Project: http://git-wip-us.apache.org/repos/asf/couchdb-ci/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-ci/commit/e9c8fb0a Tree: http://git-wip-us.apache.org/repos/asf/couchdb-ci/tree/e9c8fb0a Diff: http://git-wip-us.apache.org/repos/asf/couchdb-ci/diff/e9c8fb0a Branch: refs/heads/master Commit: e9c8fb0a3d4ba7f922cb94b6718613df6392d829 Parents: 0e191f3 Author: Bastian Krol <[email protected]> Authored: Thu Jan 21 23:50:54 2016 +0100 Committer: Bastian Krol <[email protected]> Committed: Thu Jan 21 23:50:54 2016 +0100 ---------------------------------------------------------------------- jenkins/build.sh | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/e9c8fb0a/jenkins/build.sh ---------------------------------------------------------------------- diff --git a/jenkins/build.sh b/jenkins/build.sh new file mode 100755 index 0000000..90c49b4 --- /dev/null +++ b/jenkins/build.sh @@ -0,0 +1,70 @@ +#!/usr/bin/env bash + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# This is the script used by ASF Jenkins +# (https://builds.apache.org/job/CouchDB) to build and check CouchDB for +# a given OS and Erlang combination. + +# Parts of this have been yoinked from +# https://github.com/jimenez/mesos/blob/master/support/jenkins_build.sh + +set -xe + +# Require the following environment variables to be set. +: ${OS:?"Environment variable 'OS' must be set"} +: ${ERLANG:?"Environment variable 'ERLANG' must be set"} + +# Change to the couchdb-ci checkout for docker build context. +COUCHDB_CI_DIRECTORY=$( cd "$( dirname "$0" )/.." && pwd ) +cd "$COUCHDB_CI_DIRECTORY" + +rm -f $DOCKERFILE # Just in case a stale one exists. + +DOCKER_IMAGE="basti1302/couchdb-build-" + +case $OS in + ubuntu-14.04*) + echo "Using Ubuntu 14.04" + DOCKER_IMAGE=$DOCKER_IMAGE"ubuntu-14.04-" + ;; + *) + echo "Unknown OS $OS" + exit 1 + ;; +esac + +case $ERLANG in + 18.2*) + echo "Using Erlang 18.2" + DOCKER_IMAGE=$DOCKER_IMAGE"erlang-18.2" + ;; + *) + echo "Unknown Erlang version $ERLANG" + exit 1 + ;; +esac + +docker pull $DOCKER_IMAGE + +# Set a trap to delete the image on exit. +# trap "docker rmi $TAG" EXIT + +#--privileged ? +#--rm ? +docker run $DOCKER_IMAGE
