http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/debian-8-erlang-default/run-build-in-container.sh ---------------------------------------------------------------------- diff --git a/bin/debian-8-erlang-default/run-build-in-container.sh b/bin/debian-8-erlang-default/run-build-in-container.sh deleted file mode 100755 index 9d54270..0000000 --- a/bin/debian-8-erlang-default/run-build-in-container.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/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. - -set -e -pushd $( dirname "$0" )/../.. -pwd -OS=debian-8 ERLANG=default jenkins/build.sh -popd
http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/debian-9-base/create-container.sh ---------------------------------------------------------------------- diff --git a/bin/debian-9-base/create-container.sh b/bin/debian-9-base/create-container.sh deleted file mode 100755 index 67a4ab8..0000000 --- a/bin/debian-9-base/create-container.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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. - -set -e - -# The Docker containers need the root directory of this repository as their -# build context (because they need the Ansible files). -pushd `dirname $0`/../.. > /dev/null - -docker build -f dockerfiles/debian-9-base -t couchdbdev/debian-9-base . - -popd > /dev/null http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/debian-9-base/enter-container.sh ---------------------------------------------------------------------- diff --git a/bin/debian-9-base/enter-container.sh b/bin/debian-9-base/enter-container.sh deleted file mode 100755 index 9c34c80..0000000 --- a/bin/debian-9-base/enter-container.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/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. - -docker run -it couchdbdev/debian-9-base bash http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/debian-9-base/publish-container.sh ---------------------------------------------------------------------- diff --git a/bin/debian-9-base/publish-container.sh b/bin/debian-9-base/publish-container.sh deleted file mode 100755 index b0a8d43..0000000 --- a/bin/debian-9-base/publish-container.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/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. - -docker push couchdbdev/debian-9-base http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/debian-9-erlang-18.3/create-container.sh ---------------------------------------------------------------------- diff --git a/bin/debian-9-erlang-18.3/create-container.sh b/bin/debian-9-erlang-18.3/create-container.sh deleted file mode 100755 index a83d85c..0000000 --- a/bin/debian-9-erlang-18.3/create-container.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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. - -set -e - -# The Docker containers need the root directory of this repository as their -# build context (because they need the Ansible files). -pushd `dirname $0`/../.. > /dev/null - -docker build -f dockerfiles/debian-9-erlang-18.3 -t couchdbdev/debian-9-erlang-18.3 . - -popd > /dev/null http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/debian-9-erlang-18.3/enter-container.sh ---------------------------------------------------------------------- diff --git a/bin/debian-9-erlang-18.3/enter-container.sh b/bin/debian-9-erlang-18.3/enter-container.sh deleted file mode 100755 index 37471b9..0000000 --- a/bin/debian-9-erlang-18.3/enter-container.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/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. - -docker run -it couchdbdev/debian-9-erlang-18.3 bash http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/debian-9-erlang-18.3/publish-container.sh ---------------------------------------------------------------------- diff --git a/bin/debian-9-erlang-18.3/publish-container.sh b/bin/debian-9-erlang-18.3/publish-container.sh deleted file mode 100755 index 9e87bb1..0000000 --- a/bin/debian-9-erlang-18.3/publish-container.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/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. - -docker push couchdbdev/debian-9-erlang-18.3 http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/debian-9-erlang-18.3/run-build-in-container.sh ---------------------------------------------------------------------- diff --git a/bin/debian-9-erlang-18.3/run-build-in-container.sh b/bin/debian-9-erlang-18.3/run-build-in-container.sh deleted file mode 100755 index e6081a3..0000000 --- a/bin/debian-9-erlang-18.3/run-build-in-container.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/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. - -set -e -pushd $( dirname "$0" )/../.. -pwd -OS=debian-9 ERLANG=18.3 jenkins/build.sh -popd http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/debian-9-erlang-default/create-container.sh ---------------------------------------------------------------------- diff --git a/bin/debian-9-erlang-default/create-container.sh b/bin/debian-9-erlang-default/create-container.sh deleted file mode 100755 index 0fc40e0..0000000 --- a/bin/debian-9-erlang-default/create-container.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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. - -set -e - -# The Docker containers need the root directory of this repository as their -# build context (because they need the Ansible files). -pushd `dirname $0`/../.. > /dev/null - -docker build -f dockerfiles/debian-9-erlang-default -t couchdbdev/debian-9-erlang-default . - -popd > /dev/null http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/debian-9-erlang-default/enter-container.sh ---------------------------------------------------------------------- diff --git a/bin/debian-9-erlang-default/enter-container.sh b/bin/debian-9-erlang-default/enter-container.sh deleted file mode 100755 index eb9b1a4..0000000 --- a/bin/debian-9-erlang-default/enter-container.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/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. - -docker run -it couchdbdev/debian-9-erlang-default bash http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/debian-9-erlang-default/publish-container.sh ---------------------------------------------------------------------- diff --git a/bin/debian-9-erlang-default/publish-container.sh b/bin/debian-9-erlang-default/publish-container.sh deleted file mode 100755 index 8b2f34c..0000000 --- a/bin/debian-9-erlang-default/publish-container.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/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. - -docker push couchdbdev/debian-9-erlang-default http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/debian-9-erlang-default/run-build-in-container.sh ---------------------------------------------------------------------- diff --git a/bin/debian-9-erlang-default/run-build-in-container.sh b/bin/debian-9-erlang-default/run-build-in-container.sh deleted file mode 100755 index 88a762c..0000000 --- a/bin/debian-9-erlang-default/run-build-in-container.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/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. - -set -e -pushd $( dirname "$0" )/../.. -pwd -OS=debian-9 ERLANG=default jenkins/build.sh -popd http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/detect-os.sh ---------------------------------------------------------------------- diff --git a/bin/detect-os.sh b/bin/detect-os.sh new file mode 100755 index 0000000..610e959 --- /dev/null +++ b/bin/detect-os.sh @@ -0,0 +1,132 @@ +#!/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 shell script detects the OS we're on, and sets a number +# of environment variables the calling script can use. + +# It uses the systemd standard of variables, and attempts to +# populate some of the variables manually if systemd is not +# present on the underlying OS. + +# Example systemd /etc/os-release file: +# NAME="Ubuntu" +# VERSION="16.04.4 LTS (Xenial Xerus)" +# ID=ubuntu +# ID_LIKE=debian +# PRETTY_NAME="Ubuntu 16.04.4 LTS" +# VERSION_ID="16.04" +# HOME_URL="http://www.ubuntu.com/" +# SUPPORT_URL="http://help.ubuntu.com/" +# BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/" +# VERSION_CODENAME=xenial +# UBUNTU_CODENAME=xenial + +# While these scripts are primarily written to support building CI +# Docker images, they can be used on any workstation to install a +# suitable build environment. + +# stop on error +set -e + +case "${OSTYPE}" in + linux*) + echo "Detected OS: Linux" + # Try the new, systemd-based way first + . /etc/os-release 2>/dev/null || true + # then try lsb_release, which might be installed + # os-release doesn't actually give us everything we want... + lsb_plat=$(lsb_release -d 2>/dev/null | awk -F"\t" '{print $2}' 2>/dev/null) + if [[ ${lsb_plat} ]]; then + if [[ ${lsb_plat} =~ "^Debian" ]]; then + ID=${ID:-debian} + VERSION_ID=${VERSION_ID:-$(echo ${lsb_plat} | awk '{print $3}' | awk -F'.' '{print $1}')} + VERSION_CODENAME=${VERSION_CODENAME:-$(echo ${lsb_plat} | awk '{print $4}' | sed 's/[\(\)]//g')} + DISTRIB_CODENAME=${DISTRIB_CODENAME:-${VERSION_CODENAME}} + elif [[ ${lsb_plat} =~ "^Ubuntu" ]]; then + ID=${ID:-ubuntu} + VERSION_ID=${VERSION_ID:-$(echo ${lsb_plat} | awk '{print $2}' | awk -F'.' '{print $1}')} + VERSION_CODENAME=${VERSION_CODENAME:-$(lsb_release -cs)} + DISTRIB_CODENAME=${DISTRIB_CODENAME:-${VERSION_CODENAME}} + fi + fi + # and finally some rough heuristics + if [[ -f /etc/redhat-release ]]; then + # /etc/redhat-release is so inconsistent, we use rpm instead + rhelish=$(rpm -qa '(redhat|sl|slf|centos|oraclelinux)-release(|-server|-workstation|-client|-computenode)' 2>/dev/null | head -1) + if [[ $rhelish ]]; then + ID=${ID:-$(echo ${rhelish} | awk -F'-' '{print tolower($1)}')} + VERSION_ID=${VERSION_ID:-$(echo ${rhelish} | sed -E 's/([^[:digit:]]+)([[:digit:]]+)(.*)/\2/' )} + VERSION_CODENAME=${VERSION_CODENAME:-${VERSION_ID}} + DISTRIB_CODENAME=${VERSION_CODENAME:-${VERSION_ID}} + fi + elif [[ -f /etc/debian_version ]]; then + # Ubuntu keeps changing the format of /etc/os-release's VERSION, and + # it's numeric, not the codename. Boo. + # Also, Debian doesn't supply VERSION_CODENAME. Double Boo. + if [[ ${PRETTY_NAME} =~ "Ubuntu" ]]; then + # Ubuntu keeps changing the format of /etc/os-release's VERSION, and + # the codename is buried. Boo. Let's use a fancy regex. + VERSION_CODENAME=${VERSION_CODENAME:-$(echo ${VERSION} | sed -E 's/([0-9.]+)\W+([A-Za-z\,]+)\W+\(?(\w+)(.*)/\L\3/')} + DISTRIB_CODENAME=${DISTRIB_CODENAME:-${VERSION_CODENAME}} + elif [[ ${PRETTY_NAME} =~ "Debian" ]]; then + VERSION_CODENAME=${VERSION_CODENAME:-$(echo ${VERSION} | sed -E 's/(.*)\(([^\]+)\)/\2/')} + DISTRIB_CODENAME=${DISTRIB_CODENAME:-${VERSION_CODENAME}} + else + echo "Unknown Debian-like OS ${PRETTY_NAME}, aborting..." + exit 1 + fi + fi + if [[ ${ID} && ${VERSION_ID} && ${VERSION_CODENAME} ]]; then + echo "Detected distribution: ${ID}, version ${VERSION_ID} (${VERSION_CODENAME})" + else + echo "Unable to determine Linux distribution! Aborting." + exit 1 + fi + ;; + + *bsd*) + # TODO: detect netbsd vs. freebsd vs. openbsd? + echo "Detected OS: BSD - UNSUPPORTED" + exit 1 + ;; + darwin*) + # TODO + echo "Detected OS: macOS (OSX) - UNSUPPORTED" + exit 1 + ;; + solaris*) + # TODO + echo "Detected OS: Solaris-like" + exit 1 + ;; + msys*) + # TODO + echo "Detected OS: Windows (msys)" + exit 1 + ;; + cygwin*) + # TODO + echo "Detected OS: Windows (cygwin)" + exit 1 + ;; + *) + echo "Unknown OS detected: ${OSTYPE}" + exit 1 + ;; +esac http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/install-dependencies.sh ---------------------------------------------------------------------- diff --git a/bin/install-dependencies.sh b/bin/install-dependencies.sh new file mode 100755 index 0000000..2431dbf --- /dev/null +++ b/bin/install-dependencies.sh @@ -0,0 +1,118 @@ +#!/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 shell script installs all build-time dependencies for Apache +# CouchDB 2.x. It attempts to identify the OS on which it is running, +# and invokes the relevant sub-scripts. +# +# While these scripts are primarily written to support building CI +# Docker images, they can be used on any workstation to install a +# suitable build environment. + +# stop on error +set -e + +# Node 8 as of 2018-05-08 +NODEVERSION=${NODEVERSION:-8} +# Erlang 19.3.6 as of 2018-05-08 +ERLANGVERSION=${ERLANGVERSION:-19.3.6} + +# This works if we're not called through a symlink +# otherwise, see https://stackoverflow.com/questions/59895/ +SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +# install JS by default, unless told otherwise (make-js images) +if [[ $1 == "nojs" ]]; then + JSINSTALL="nojs" +else + JSINSTALL="" +fi + +if [[ $2 == "noerlang" ]]; then + SKIPERLANG=1 +fi + +# Check if running as root +if [[ ${EUID} -ne 0 ]]; then + echo "Sorry, this script must be run as root." + echo "Try: sudo $0 $*" + exit 1 +fi + +# TODO: help info on -h + +. ${SCRIPTPATH}/detect-os.sh + +case "${OSTYPE}" in + linux*) + redhats='(rhel|centos|fedora)' + debians='(debian|ubuntu)' + + if [[ ${ID} =~ ${redhats} ]]; then + NODEVERSION=${NODEVERSION} \ + ${SCRIPTPATH}/yum-dependencies.sh ${JSINSTALL} + if [[ ! ${SKIPERLANG} ]]; then + ERLANGVERSION=${ERLANGVERSION} ${SCRIPTPATH}/yum-erlang.sh + fi + elif [[ ${ID} =~ ${debians} ]]; then + NODEVERSION=${NODEVERSION} ERLANGVERSION=${ERLANGVERSION} \ + ${SCRIPTPATH}/apt-dependencies.sh ${JSINSTALL} + if [[ ! ${SKIPERLANG} ]]; then + ERLANGVERSION=${ERLANGVERSION} ${SCRIPTPATH}/apt-erlang.sh + fi + else + echo "Sorry, we don't support this Linux (${ID}) yet." + exit 1 + fi + ;; + +# useful for other platforms below: +# https://github.com/kerl/kerl/issues/240 + bsd*) + # TODO: detect netbsd vs. freebsd vs. openbsd? + echo "Detected OS: BSD - UNSUPPORTED" + exit 1 + ;; + darwin*) + # TODO + echo "Detected OS: macOS (OSX) - UNSUPPORTED" + exit 1 + ;; + solaris*) + # TODO + echo "Detected OS: Solaris-like" + exit 1 + ;; + msys*) + # TODO + echo "Detected OS: Windows (msys)" + exit 1 + ;; + cygwin*) + # TODO + echo "Detected OS: Windows (cygwin)" + exit 1 + ;; + *) + echo "Unknown OS detected: ${OSTYPE}" + exit 1 + ;; +esac + +# user creation is done in the Dockerfiles, as non-Docker users don't need it http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/publish-all.sh ---------------------------------------------------------------------- diff --git a/bin/publish-all.sh b/bin/publish-all.sh deleted file mode 100755 index da768fa..0000000 --- a/bin/publish-all.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/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. - -SCRIPT=$(readlink -f "$0") -SCRIPTPATH=$(dirname "$SCRIPT") - -find $SCRIPTPATH/*-base -type d -exec {}/publish-container.sh \; -find $SCRIPTPATH/*erlang* -type d -exec {}/publish-container.sh \; http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/pull-all.sh ---------------------------------------------------------------------- diff --git a/bin/pull-all.sh b/bin/pull-all.sh deleted file mode 100755 index 46d90ff..0000000 --- a/bin/pull-all.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/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. - -SCRIPT=$(readlink -f "$0") -SCRIPTPATH=$(dirname "$SCRIPT") - -( find $SCRIPTPATH/*-base -type d -printf "couchdbdev/%f\n" | xargs -n 1 docker pull) -( find $SCRIPTPATH/*erlang* -type d -printf "couchdbdev/%f\n" | xargs -n 1 docker pull) - http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/rebuild-all.sh ---------------------------------------------------------------------- diff --git a/bin/rebuild-all.sh b/bin/rebuild-all.sh deleted file mode 100755 index f0b4bb0..0000000 --- a/bin/rebuild-all.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/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. - -SCRIPT=$(readlink -f "$0") -SCRIPTPATH=$(dirname "$SCRIPT") - -( find $SCRIPTPATH/*-base -type d -printf "couchdbdev/%f\n" | xargs docker rmi) >/dev/null 2>&1 -( find $SCRIPTPATH/*erlang* -type d -printf "couchdbdev/%f\n" | xargs docker rmi) >/dev/null 2>&1 - -find $SCRIPTPATH/*-base -type d -exec {}/create-container.sh \; -find $SCRIPTPATH/*erlang* -type d -exec {}/create-container.sh \; -exec $SCRIPTPATH/cleanup-docker.sh - http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/ubuntu-12.04-base/create-container.sh ---------------------------------------------------------------------- diff --git a/bin/ubuntu-12.04-base/create-container.sh b/bin/ubuntu-12.04-base/create-container.sh deleted file mode 100755 index 27dbf63..0000000 --- a/bin/ubuntu-12.04-base/create-container.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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. - -set -e - -# The Docker containers need the root directory of this repository as their -# build context (because they need the Ansible files). -pushd `dirname $0`/../.. > /dev/null - -docker build -f dockerfiles/ubuntu-12.04-base -t couchdbdev/ubuntu-12.04-base . - -popd > /dev/null http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/ubuntu-12.04-base/enter-container.sh ---------------------------------------------------------------------- diff --git a/bin/ubuntu-12.04-base/enter-container.sh b/bin/ubuntu-12.04-base/enter-container.sh deleted file mode 100755 index 18273fa..0000000 --- a/bin/ubuntu-12.04-base/enter-container.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/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. - -docker run -it couchdbdev/ubuntu-12.04-base bash http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/ubuntu-12.04-base/publish-container.sh ---------------------------------------------------------------------- diff --git a/bin/ubuntu-12.04-base/publish-container.sh b/bin/ubuntu-12.04-base/publish-container.sh deleted file mode 100755 index e023793..0000000 --- a/bin/ubuntu-12.04-base/publish-container.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/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. - -docker push couchdbdev/ubuntu-12.04-base http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/ubuntu-12.04-erlang-18.3/create-container.sh ---------------------------------------------------------------------- diff --git a/bin/ubuntu-12.04-erlang-18.3/create-container.sh b/bin/ubuntu-12.04-erlang-18.3/create-container.sh deleted file mode 100755 index 87fdb61..0000000 --- a/bin/ubuntu-12.04-erlang-18.3/create-container.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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. - -set -e - -# The Docker containers need the root directory of this repository as their -# build context (because they need the Ansible files). -pushd `dirname $0`/../.. > /dev/null - -docker build -f dockerfiles/ubuntu-12.04-erlang-18.3 -t couchdbdev/ubuntu-12.04-erlang-18.3 . - -popd > /dev/null http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/ubuntu-12.04-erlang-18.3/enter-container.sh ---------------------------------------------------------------------- diff --git a/bin/ubuntu-12.04-erlang-18.3/enter-container.sh b/bin/ubuntu-12.04-erlang-18.3/enter-container.sh deleted file mode 100755 index 0bc6c48..0000000 --- a/bin/ubuntu-12.04-erlang-18.3/enter-container.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/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. - -docker run -it couchdbdev/ubuntu-12.04-erlang-18.3 bash http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/ubuntu-12.04-erlang-18.3/publish-container.sh ---------------------------------------------------------------------- diff --git a/bin/ubuntu-12.04-erlang-18.3/publish-container.sh b/bin/ubuntu-12.04-erlang-18.3/publish-container.sh deleted file mode 100755 index 81251e4..0000000 --- a/bin/ubuntu-12.04-erlang-18.3/publish-container.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/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. - -docker push couchdbdev/ubuntu-12.04-erlang-18.3 http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/ubuntu-12.04-erlang-18.3/run-build-in-container.sh ---------------------------------------------------------------------- diff --git a/bin/ubuntu-12.04-erlang-18.3/run-build-in-container.sh b/bin/ubuntu-12.04-erlang-18.3/run-build-in-container.sh deleted file mode 100755 index b8dfa29..0000000 --- a/bin/ubuntu-12.04-erlang-18.3/run-build-in-container.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/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. - -set -e -pushd $( dirname "$0" )/../.. -pwd -OS=ubuntu-12.04 ERLANG=18.3 jenkins/build.sh -popd http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/ubuntu-14.04-base/create-container.sh ---------------------------------------------------------------------- diff --git a/bin/ubuntu-14.04-base/create-container.sh b/bin/ubuntu-14.04-base/create-container.sh deleted file mode 100755 index b40b3c2..0000000 --- a/bin/ubuntu-14.04-base/create-container.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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. - -set -e - -# The Docker containers need the root directory of this repository as their -# build context (because they need the Ansible files). -pushd `dirname $0`/../.. > /dev/null - -docker build -f dockerfiles/ubuntu-14.04-base -t couchdbdev/ubuntu-14.04-base . - -popd > /dev/null http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/ubuntu-14.04-base/enter-container.sh ---------------------------------------------------------------------- diff --git a/bin/ubuntu-14.04-base/enter-container.sh b/bin/ubuntu-14.04-base/enter-container.sh deleted file mode 100755 index 74b2388..0000000 --- a/bin/ubuntu-14.04-base/enter-container.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/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. - -docker run -it couchdbdev/ubuntu-14.04-base bash http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/ubuntu-14.04-base/publish-container.sh ---------------------------------------------------------------------- diff --git a/bin/ubuntu-14.04-base/publish-container.sh b/bin/ubuntu-14.04-base/publish-container.sh deleted file mode 100755 index ab65b15..0000000 --- a/bin/ubuntu-14.04-base/publish-container.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/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. - -docker push couchdbdev/ubuntu-14.04-base http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/ubuntu-14.04-erlang-18.3/create-container.sh ---------------------------------------------------------------------- diff --git a/bin/ubuntu-14.04-erlang-18.3/create-container.sh b/bin/ubuntu-14.04-erlang-18.3/create-container.sh deleted file mode 100755 index 6054b42..0000000 --- a/bin/ubuntu-14.04-erlang-18.3/create-container.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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. - -set -e - -# The Docker containers need the root directory of this repository as their -# build context (because they need the Ansible files). -pushd `dirname $0`/../.. > /dev/null - -docker build -f dockerfiles/ubuntu-14.04-erlang-18.3 -t couchdbdev/ubuntu-14.04-erlang-18.3 . - -popd > /dev/null http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/ubuntu-14.04-erlang-18.3/enter-container.sh ---------------------------------------------------------------------- diff --git a/bin/ubuntu-14.04-erlang-18.3/enter-container.sh b/bin/ubuntu-14.04-erlang-18.3/enter-container.sh deleted file mode 100755 index 985051c..0000000 --- a/bin/ubuntu-14.04-erlang-18.3/enter-container.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/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. - -docker run -it couchdbdev/ubuntu-14.04-erlang-18.3 bash http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/ubuntu-14.04-erlang-18.3/publish-container.sh ---------------------------------------------------------------------- diff --git a/bin/ubuntu-14.04-erlang-18.3/publish-container.sh b/bin/ubuntu-14.04-erlang-18.3/publish-container.sh deleted file mode 100755 index 93fd590..0000000 --- a/bin/ubuntu-14.04-erlang-18.3/publish-container.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/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. - -docker push couchdbdev/ubuntu-14.04-erlang-18.3 http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/ubuntu-14.04-erlang-18.3/run-build-in-container.sh ---------------------------------------------------------------------- diff --git a/bin/ubuntu-14.04-erlang-18.3/run-build-in-container.sh b/bin/ubuntu-14.04-erlang-18.3/run-build-in-container.sh deleted file mode 100755 index 603d6fa..0000000 --- a/bin/ubuntu-14.04-erlang-18.3/run-build-in-container.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/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. - -set -e -pushd $( dirname "$0" )/../.. -pwd -OS=ubuntu-14.04 ERLANG=18.3 jenkins/build.sh -popd http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/ubuntu-14.04-erlang-default/create-container.sh ---------------------------------------------------------------------- diff --git a/bin/ubuntu-14.04-erlang-default/create-container.sh b/bin/ubuntu-14.04-erlang-default/create-container.sh deleted file mode 100755 index ea30c6c..0000000 --- a/bin/ubuntu-14.04-erlang-default/create-container.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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. - -set -e - -# The Docker containers need the root directory of this repository as their -# build context (because they need the Ansible files). -pushd `dirname $0`/../.. > /dev/null - -docker build -f dockerfiles/ubuntu-14.04-erlang-default -t couchdbdev/ubuntu-14.04-erlang-default . - -popd > /dev/null http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/ubuntu-14.04-erlang-default/enter-container.sh ---------------------------------------------------------------------- diff --git a/bin/ubuntu-14.04-erlang-default/enter-container.sh b/bin/ubuntu-14.04-erlang-default/enter-container.sh deleted file mode 100755 index 2bf1dec..0000000 --- a/bin/ubuntu-14.04-erlang-default/enter-container.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/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. - -docker run -it couchdbdev/ubuntu-14.04-erlang-default bash http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/ubuntu-14.04-erlang-default/publish-container.sh ---------------------------------------------------------------------- diff --git a/bin/ubuntu-14.04-erlang-default/publish-container.sh b/bin/ubuntu-14.04-erlang-default/publish-container.sh deleted file mode 100755 index 39b117a..0000000 --- a/bin/ubuntu-14.04-erlang-default/publish-container.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/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. - -docker push couchdbdev/ubuntu-14.04-erlang-default http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/ubuntu-14.04-erlang-default/run-build-in-container.sh ---------------------------------------------------------------------- diff --git a/bin/ubuntu-14.04-erlang-default/run-build-in-container.sh b/bin/ubuntu-14.04-erlang-default/run-build-in-container.sh deleted file mode 100755 index bd5c49b..0000000 --- a/bin/ubuntu-14.04-erlang-default/run-build-in-container.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/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. - -set -e -pushd $( dirname "$0" )/../.. -pwd -OS=ubuntu-14.04 ERLANG=default jenkins/build.sh -popd http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/ubuntu-16.04-base/create-container.sh ---------------------------------------------------------------------- diff --git a/bin/ubuntu-16.04-base/create-container.sh b/bin/ubuntu-16.04-base/create-container.sh deleted file mode 100755 index d9ad5cc..0000000 --- a/bin/ubuntu-16.04-base/create-container.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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. - -set -e - -# The Docker containers need the root directory of this repository as their -# build context (because they need the Ansible files). -pushd `dirname $0`/../.. > /dev/null - -docker build -f dockerfiles/ubuntu-16.04-base -t couchdbdev/ubuntu-16.04-base . - -popd > /dev/null http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/ubuntu-16.04-base/enter-container.sh ---------------------------------------------------------------------- diff --git a/bin/ubuntu-16.04-base/enter-container.sh b/bin/ubuntu-16.04-base/enter-container.sh deleted file mode 100755 index 368982d..0000000 --- a/bin/ubuntu-16.04-base/enter-container.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/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. - -docker run -it couchdbdev/ubuntu-16.04-base bash http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/ubuntu-16.04-base/publish-container.sh ---------------------------------------------------------------------- diff --git a/bin/ubuntu-16.04-base/publish-container.sh b/bin/ubuntu-16.04-base/publish-container.sh deleted file mode 100755 index e0c3be5..0000000 --- a/bin/ubuntu-16.04-base/publish-container.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/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. - -docker push couchdbdev/ubuntu-16.04-base http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/ubuntu-16.04-erlang-18.3/create-container.sh ---------------------------------------------------------------------- diff --git a/bin/ubuntu-16.04-erlang-18.3/create-container.sh b/bin/ubuntu-16.04-erlang-18.3/create-container.sh deleted file mode 100755 index 99dcc78..0000000 --- a/bin/ubuntu-16.04-erlang-18.3/create-container.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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. - -set -e - -# The Docker containers need the root directory of this repository as their -# build context (because they need the Ansible files). -pushd `dirname $0`/../.. > /dev/null - -docker build -f dockerfiles/ubuntu-16.04-erlang-18.3 -t couchdbdev/ubuntu-16.04-erlang-18.3 . - -popd > /dev/null http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/ubuntu-16.04-erlang-18.3/enter-container.sh ---------------------------------------------------------------------- diff --git a/bin/ubuntu-16.04-erlang-18.3/enter-container.sh b/bin/ubuntu-16.04-erlang-18.3/enter-container.sh deleted file mode 100755 index eb5e9a3..0000000 --- a/bin/ubuntu-16.04-erlang-18.3/enter-container.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/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. - -docker run -it couchdbdev/ubuntu-16.04-erlang-18.3 bash http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/ubuntu-16.04-erlang-18.3/publish-container.sh ---------------------------------------------------------------------- diff --git a/bin/ubuntu-16.04-erlang-18.3/publish-container.sh b/bin/ubuntu-16.04-erlang-18.3/publish-container.sh deleted file mode 100755 index 1bec512..0000000 --- a/bin/ubuntu-16.04-erlang-18.3/publish-container.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/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. - -docker push couchdbdev/ubuntu-16.04-erlang-18.3 http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/ubuntu-16.04-erlang-18.3/run-build-in-container.sh ---------------------------------------------------------------------- diff --git a/bin/ubuntu-16.04-erlang-18.3/run-build-in-container.sh b/bin/ubuntu-16.04-erlang-18.3/run-build-in-container.sh deleted file mode 100755 index aa833df..0000000 --- a/bin/ubuntu-16.04-erlang-18.3/run-build-in-container.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/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. - -set -e -pushd $( dirname "$0" )/../.. -pwd -OS=ubuntu-16.04 ERLANG=18.3 jenkins/build.sh -popd http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/ubuntu-16.04-erlang-default/create-container.sh ---------------------------------------------------------------------- diff --git a/bin/ubuntu-16.04-erlang-default/create-container.sh b/bin/ubuntu-16.04-erlang-default/create-container.sh deleted file mode 100755 index 5c59864..0000000 --- a/bin/ubuntu-16.04-erlang-default/create-container.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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. - -set -e - -# The Docker containers need the root directory of this repository as their -# build context (because they need the Ansible files). -pushd `dirname $0`/../.. > /dev/null - -docker build -f dockerfiles/ubuntu-16.04-erlang-default -t couchdbdev/ubuntu-16.04-erlang-default . - -popd > /dev/null http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/ubuntu-16.04-erlang-default/enter-container.sh ---------------------------------------------------------------------- diff --git a/bin/ubuntu-16.04-erlang-default/enter-container.sh b/bin/ubuntu-16.04-erlang-default/enter-container.sh deleted file mode 100755 index e1fac08..0000000 --- a/bin/ubuntu-16.04-erlang-default/enter-container.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/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. - -docker run -it couchdbdev/ubuntu-16.04-erlang-default bash http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/ubuntu-16.04-erlang-default/publish-container.sh ---------------------------------------------------------------------- diff --git a/bin/ubuntu-16.04-erlang-default/publish-container.sh b/bin/ubuntu-16.04-erlang-default/publish-container.sh deleted file mode 100755 index af36843..0000000 --- a/bin/ubuntu-16.04-erlang-default/publish-container.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/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. - -docker push couchdbdev/ubuntu-16.04-erlang-default http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/ubuntu-16.04-erlang-default/run-build-in-container.sh ---------------------------------------------------------------------- diff --git a/bin/ubuntu-16.04-erlang-default/run-build-in-container.sh b/bin/ubuntu-16.04-erlang-default/run-build-in-container.sh deleted file mode 100755 index 15089c6..0000000 --- a/bin/ubuntu-16.04-erlang-default/run-build-in-container.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/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. - -set -e -pushd $( dirname "$0" )/../.. -pwd -OS=ubuntu-16.04 ERLANG=default jenkins/build.sh -popd http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/yum-dependencies.sh ---------------------------------------------------------------------- diff --git a/bin/yum-dependencies.sh b/bin/yum-dependencies.sh new file mode 100755 index 0000000..ce3f7ca --- /dev/null +++ b/bin/yum-dependencies.sh @@ -0,0 +1,120 @@ +#!/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 shell script installs all OS package dependencies for Apache +# CouchDB 2.x for yum-based systems. +# +# While these scripts are primarily written to support building CI +# Docker images, they can be used on any workstation to install a +# suitable build environment. + +# stop on error +set -e + +# Check if running as root +if [[ ${EUID} -ne 0 ]]; then + echo "Sorry, this script must be run as root." + echo "Try: sudo $0 $*" + exit 1 +fi + +SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +. ${SCRIPTPATH}/detect-os.sh >/dev/null +ARCH=$(arch) +echo "Detected RedHat/Centos/Fedora version: ${VERSION_ID} arch: ${ARCH}" + +# TODO: Do the Right Things(tm) for Fedora + +# Enable EPEL +yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-${VERSION_ID}.noarch.rpm || true +if [[ ${VERSION_ID} -ne 6 ]]; then + # more for RHEL than CentOS... + yum install subscription-manager -y + subscription-manager repos \ + --enable "rhel-*-optional-rpms" \ + --enable "rhel-*-extras-rpms" \ + >/dev/null 2>&1 || true +fi + +# Upgrade all packages +yum upgrade -y + +# Install auxiliary packages +yum groupinstall -y 'Development Tools' +yum install -y git sudo wget which + +# Dependencies for make couch, except erlang +yum install -y autoconf autoconf213 automake curl-devel libicu-devel libtool \ + ncurses-devel nspr-devel zip readline-devel + +# autoconf-archive +if [[ ${VERSION_ID} -eq 6 ]]; then + yum install -y "http://springdale.math.ias.edu/data/puias/computational/6/x86_64/autoconf-archive-2015.02.24-1.sdl6.noarch.rpm" +else + yum install -y autoconf-archive +fi + +# Node.js +pushd /tmp +wget https://rpm.nodesource.com/setup_${NODEVERSION}.x +/bin/bash setup_${NODEVERSION}.x +rm setup_${NODEVERSION}.x +popd +yum install -y nodejs + +# documentation packages +yum install -y help2man + +# python for testing and documentaiton +if [[ ${VERSION_ID} -eq 6 ]]; then + yum install -y python34 + ln -s /usr/bin/python3.4 /usr/local/bin/python + wget https://bootstrap.pypa.io/get-pip.py -O /tmp/get-pip.py + /usr/bin/python3.4 /tmp/get-pip.py +else + yum install -y python-pip +fi +pip install docutils==0.13.1 sphinx==1.5.3 sphinx_rtd_theme \ + nose requests hypothesis + +# package-building stuff +yum install -y createrepo xfsprogs-devel rpmdevtools + +# js packages, as long as we're not told to skip them +if [[ $1 != "nojs" ]]; then + # config the CouchDB repo & install the JS packages + cat << EOF > /etc/yum.repos.d/binary-apache-couchdb.repo +[bintray--apache-couchdb-rpm] +name=bintray--apache-couchdb-rpm +baseurl=http://apache.bintray.com/couchdb-rpm/el${VERSION_ID}/${ARCH}/ +gpgcheck=0 +repo_gpgcheck=0 +enabled=1 +EOF + # install the JS packages + yum install -y couch-js-devel +else + # install js build-time dependencies only + # we can't add the CouchDB repo here because the plat may not exist yet + yum install -y libffi-devel +fi + +# clean up +yum clean all -y http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/bin/yum-erlang.sh ---------------------------------------------------------------------- diff --git a/bin/yum-erlang.sh b/bin/yum-erlang.sh new file mode 100755 index 0000000..1f4ae76 --- /dev/null +++ b/bin/yum-erlang.sh @@ -0,0 +1,47 @@ +#!/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 shell script installs Erlang dependencies for Apache +# CouchDB 2.x for yum-based systems. +# +# While these scripts are primarily written to support building CI +# Docker images, they can be used on any workstation to install a +# suitable build environment. + +# stop on error +set -e + +# Check if running as root +if [[ ${EUID} -ne 0 ]]; then + echo "Sorry, this script must be run as root." + echo "Try: sudo $0 $*" + exit 1 +fi + +# TODO: Do the Right Things(tm) for Fedora +if [[ ${ERLANGVERSION} == "default" ]]; then + yum install -y erlang +else + wget https://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm + rpm -Uvh erlang-solutions-1.0-1.noarch.rpm + yum install -y esl-erlang-${ERLANGVERSION} +fi + +# clean up +yum clean all -y http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/build.sh ---------------------------------------------------------------------- diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..c8d3f7d --- /dev/null +++ b/build.sh @@ -0,0 +1,300 @@ +#!/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 master shell script to build Docker containers +# for CouchDB 2.x. + +# stop on error +set -e + +# This works if we're not called through a symlink +# otherwise, see https://stackoverflow.com/questions/59895/ +SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +# TODO: support overriding these as env vars +# Node 8 as of 2018-05-08 +NODEVERSION=${NODEVERSION:-8} +# Erlang 19.3.6 as of 2018-05-08 +ERLANGVERSION=${ERLANGVERSION:-19.3.6} + +DEBIANS="debian-jessie debian-stretch" +UBUNTUS="ubuntu-trusty ubuntu-xenial ubuntu-bionic" +debs="(debian-jessie|debian-stretch|ubuntu-trusty|ubuntu-xenial|ubuntu-bionic)" + +CENTOSES="centos-6 centos-7" +rpms="(centos-6|centos-7)" + +BINTRAY_API="https://api.bintray.com" + + +build-base-platform() { + # invoke as build-base <plat> + # base images never get JavaScript, nor Erlang + docker build -f dockerfiles/$1 \ + --build-arg js=nojs \ + --build-arg erlang=noerlang \ + --build-arg nodeversion=${NODEVERSION} \ + --build-arg erlangversion=${ERLANGVERSION} \ + --tag couchdbdev/$1-base \ + ${SCRIPTPATH} +} + +build-js() { + # TODO: check if image is built first, if not, complain + # invoke as build-js <plat> + rm -rf ${SCRIPTPATH}/js/$1 + mkdir -p ${SCRIPTPATH}/js/$1 + docker run \ + --mount type=bind,src=${SCRIPTPATH}/js/$1,dst=/root/output \ + --mount type=bind,src=${SCRIPTPATH},dst=/root/couchdb-ci \ + couchdbdev/$1-base \ + sudo /root/couchdb-ci/bin/build-js.sh +} + +build-all-js() { + for plat in $DEBIANS $UBUNTUS $CENTOSES; do + if [[ $1 != "no-rebuild" ]]; then + build-base-platform $plat + fi + build-js $plat + done +} + +build-platform() { + docker build -f dockerfiles/$1 \ + --build-arg nodeversion=${NODEVERSION} \ + --build-arg erlangversion=${ERLANGVERSION} \ + --tag couchdbdev/$1-erlang-${ERLANGVERSION} \ + ${SCRIPTPATH} +} + +clean() { + docker rmi couchdbdev/$1 -f || true +} + +clean-all() { + for plat in $DEBIANS $UBUNTUS $CENTOSES; do + clean $plat-erlang-${ERLANGVERSION} + clean ubuntu-trusty-erlang-default + clean $plat-base + done +} + +bintray-check-credentials() { + if [[ ! ${BINTRAY_USER} || ! ${BINTRAY_API_KEY} ]]; then + echo "Please set your Bintray credentials before using this command:" + echo " export BINTRAY_USER=<username>" + echo " export BINTRAY_API_KEY=<key>" + exit 1 + fi +} + +upload-js() { + # invoke with $1 as plat, expect to find the binaries under js/$plat/* + bintray-check-credentials + for pkg in $(find js/$1 -type f); do + if [[ $1 =~ ${debs} ]]; then + # TODO: pull this stuff from buildinfo / changes files, perhaps? Not sure it matters. + if [[ $pkg =~ (changes|buildinfo)$ ]]; then + continue + fi + repo="couchdb-deb" + dist=$(echo $1 | cut -d- -f 2) + arch=$(echo $pkg | cut -d_ -f 3 | cut -d. -f 1) + relpath="pool/s/spidermonkey/${pkg##*/}" + HEADERS=("--header" "X-Bintray-Debian-Distribution: ${dist}") + HEADERS+=("--header" "X-Bintray-Debian-Component: main") + HEADERS+=("--header" "X-Bintray-Debian-Architecture: ${arch}") + elif [[ $1 =~ ${rpms} ]]; then + repo="couchdb-rpm" + # better not put any extra . in the filename... + dist=$(echo $pkg | cut -d. -f 4) + arch=$(echo $pkg | cut -d. -f 5) + relpath="${dist}/${arch}/${pkg##*/}" + HEADERS=() + else + echo "Unknown repo type $1, aborting" + exit 1 + fi + local ret="$(curl \ + --request PUT \ + --upload-file $pkg \ + --user ${BINTRAY_USER}:${BINTRAY_API_KEY} \ + --header "X-Bintray-Package: spidermonkey" \ + --header "X-Bintray-Version: 1.8.5" \ + --header "X-Bintray-Publish: 1" \ + --header "X-Bintray-Override: 1" \ + --header "X-Bintray-Explode: 0" \ + "${HEADERS[@]}" \ + "${BINTRAY_API}/content/apache/${repo}/${relpath}")" + if [[ ${ret} == '{"message":"success"}' ]]; then + echo "Uploaded ${pkg} successfully." + else + echo "Failed to upload $pkg, ${ret}" + exit 1 + fi + done +} + +upload-platform() { + if [[ ! ${DOCKER_ID_USER} ]]; then + echo "Please set your Docker credentials before using this command:" + echo " export DOCKER_ID_USER=<username>" + echo " docker login" + exit 1 + fi + docker push couchdbdev/$1-erlang-${ERLANGVERSION} +} + +build-test-couch() { + docker run \ + --mount type=bind,src=${SCRIPTPATH},dst=/home/jenkins/couchdb-ci \ + couchdbdev/$1-erlang-${ERLANGVERSION} \ + /home/jenkins/couchdb-ci/bin/build-test-couchdb.sh +} + +# TODO help +case "$1" in + clean) + # removes image for a given target platform + shift + clean $1 + ;; + clean-all) + # removes all known target platform images + clean-all + ;; + base) + # Build base image for requested target platform + shift + build-base-platform $1 + ;; + base-all) + # build all base images + shift + for plat in $DEBIANS $UBUNTUS $CENTOSES; do + build-base-platform $plat $* + done + ;; + js) + # Build js packages for a given platform + shift + build-base-platform $1 + build-js $1 + ;; + js-no-rebuild) + # Build js packages for a given platform but do NOT rebuild base img + shift + build-js $1 + ;; + js-all) + # build all supported JS packages + shift + build-all-js + ;; + js-all-no-rebuild) + # build all supported JS packages with no rebuild + shift + build-all-js no-rebuild + ;; + js-upload) + shift + upload-js $1 + ;; + js-upload-all) + shift + for dir in $(ls js); do + upload-js $dir + done + ;; + platform) + # build platform with JS and Erlang support + shift + build-platform $1 + ;; + platform-all) + # build all platforms with JS and Erlang support + shift + for plat in $DEBIANS $UBUNTUS $CENTOSES; do + build-platform $plat $* + done + ;; + platform-upload) + shift + upload-platform $plat $* + ;; + platform-upload-all) + shift + for plat in $DEBIANS $UBUNTUS $CENTOSES; do + upload-platform $plat $* + done + ;; + couch) + # build and test CouchDB on <plat> + # TODO: check if img exists/pull first + shift + build-test-couch $* + ;; + couch-all) + # build and test CouchDB on all platforms + shift + for plat in $DEBIANS $UBUNTUS $CENTOSES; do + build-test-couch $plat $* + done + ;; + *) + if [[ $1 ]]; then + echo "Unknown target $1." + echo + fi + cat << EOF +$0 <command> [OPTIONS] + +Recognized commands: + clean <plat> Removes all images for <plat>. + clean-all Cleans all images for all platforms. + + base <plat> Builds the base (no JS/Erlang) image for <plat>. + base-all Builds all base (no JS/Erlang) images. + + js Builds the JS packages for <plat>. + js-all Builds the JS packages for all platforms. + js-no-rebuild Builds the JS packages for <plat> without rebuilding + the base image first. + js-all-no-rebuild Same as above, with the same condition. + js-upload <plat> Uploads the JS packages for <plat> to bintray. + Requires BINTRAY_USER and BINTRAY_API_KEY env vars. + + platform <plat> Builds the image for <plat> with Erlang & JS support. + platform-all Builds all images with Erlang and JS support. + + platform-upload Uploads the couchdbdev/* images to Docker Hub. + Requires appropriate credentials. + platform-upload-all Uploads all the couchdbdev/* images to Docker Hub. + + couch <plat> Builds and tests CouchDB for <plat>. + couch-all Builds and tests CouchDB on all platforms. +EOF + if [[ $1 ]]; then + exit 1 + fi + ;; +esac + +exit 0 http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/dockerfiles/centos-6 ---------------------------------------------------------------------- diff --git a/dockerfiles/centos-6 b/dockerfiles/centos-6 new file mode 100644 index 0000000..ff81d11 --- /dev/null +++ b/dockerfiles/centos-6 @@ -0,0 +1,58 @@ +# 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 + +# NOTE: These are intended to be built using the arguments as +# described in ../build.sh. See that script for more details. + +FROM centos:6 + +# Choose whether to install SpiderMonkey 1.8.5, default yes +ARG js=js +# Choose whether to install Erlang, default yes +ARG erlang=erlang +# Select version of Node and Erlang to install +ARG erlangversion=19.3.6 +ARG nodeversion=8 + +# Create Jenkins user and group +RUN groupadd --gid 12036 jenkins; \ + useradd --uid 10025 --gid jenkins --create-home jenkins + +# Copy couchdb-ci repo into root's home directory +ADD --chown=root:root bin /root/couchdb-ci/bin/ +ADD --chown=root:root files /root/couchdb-ci/files/ + +# Jenkins builds in /usr/src/couchdb. +RUN mkdir -p /usr/src/couchdb; \ + chown -R jenkins:jenkins /usr/src/couchdb + +# Add /usr/local/lib to global LD_LIBRARY_PATH for CentOS +RUN echo "/usr/local/lib" > /etc/ld.so.conf.d/local.conf + +# Install all dependencies, and optionally SM 1.8.5 +# This allows us to use the same Dockerfile for building SM +RUN ERLANGVERSION=$erlangversion \ + NODEVERSION=$nodeversion \ + /root/couchdb-ci/bin/install-dependencies.sh $js $erlang + +# Allow Jenkins to sudo +RUN echo "jenkins ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/jenkins + +USER jenkins + +# overwrite this with 'CMD []' in a dependent Dockerfile +CMD ["/bin/bash"] + http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/dockerfiles/centos-6-base ---------------------------------------------------------------------- diff --git a/dockerfiles/centos-6-base b/dockerfiles/centos-6-base deleted file mode 100644 index 4f2b4c0..0000000 --- a/dockerfiles/centos-6-base +++ /dev/null @@ -1,33 +0,0 @@ -# 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 - -# NOTE: All docker files need to be run from ../../, that is -# docker build -f /docker/<container>/Dockerfile - -# Base Image: Plain Vanilla CentOS with Ansible installed -FROM williamyeh/ansible:centos6-onbuild - -# Add ansible directory and cd to it -ADD ./ansible /ansible -WORKDIR /ansible - -# Install Ansible roles -RUN ansible-galaxy install geerlingguy.repo-epel - -# Run Ansible to provision CentOS base container -RUN ansible-playbook centos-6-base.yml \ - --connection=local \ - --inventory-file=./inventory/couchdb-ci-worker
