You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@serf.apache.org by br...@apache.org on 2015/09/02 12:20:55 UTC

svn commit: r1700757 - in /serf/tools/buildbot/macosx: ./ mkramdisk.sh rmramdisk.sh serfbuild.sh serfcheck.sh serfclean.sh setenv.sh

Author: brane
Date: Wed Sep  2 10:20:55 2015
New Revision: 1700757

URL: http://svn.apache.org/r1700757
Log:
Initial import of Mac OS buildslave scripts.

* buildbot/macosx,
  buildbot/macosx/mkramdisk.sh,
  buildbot/macosx/rmramdisk.sh,
  buildbot/macosx/serfbuild.sh,
  buildbot/macosx/serfcheck.sh,
  buildbot/macosx/serfclean.sh,
  buildbot/macosx/setenv.sh: New files.

Added:
    serf/tools/buildbot/macosx/
    serf/tools/buildbot/macosx/mkramdisk.sh   (with props)
    serf/tools/buildbot/macosx/rmramdisk.sh   (with props)
    serf/tools/buildbot/macosx/serfbuild.sh   (with props)
    serf/tools/buildbot/macosx/serfcheck.sh   (with props)
    serf/tools/buildbot/macosx/serfclean.sh   (with props)
    serf/tools/buildbot/macosx/setenv.sh   (with props)

Added: serf/tools/buildbot/macosx/mkramdisk.sh
URL: http://svn.apache.org/viewvc/serf/tools/buildbot/macosx/mkramdisk.sh?rev=1700757&view=auto
==============================================================================
--- serf/tools/buildbot/macosx/mkramdisk.sh (added)
+++ serf/tools/buildbot/macosx/mkramdisk.sh Wed Sep  2 10:20:55 2015
@@ -0,0 +1,63 @@
+#!/bin/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 -x
+
+if [ -z "$1" ]; then
+    echo "Missing parameter: volume name"
+    exit 1
+fi
+
+if [ -z "$2" ]; then
+    echo "Missing parameter: RAMdisk config file"
+    exit 1
+fi
+
+volume="/Volumes/$1"
+ramconf="$2"
+
+ramconfpath=$(dirname "${ramconf}")
+if [ ! -d "${ramconfpath}" ]; then
+    echo "Missing RAMdisk config file path: ${ramconfpath}"
+    exit 1
+fi
+if [ -f "${ramconf}" ]; then
+    echo "RAMdisk config file exists: ${ramconf}"
+    exit 1
+fi
+
+if [ -d "${volume}" ]; then
+    echo "Mount point exists: ${volume}"
+    exit 1
+fi
+
+mount | grep "^/dev/disk[0-9][0-9]* on ${volume} (hfs" >/dev/null || {
+    set -e
+    echo -n "" > "${ramconf}"
+
+    # Make sure we strip trailing spaces from the result of older
+    # versions of hduitil.
+    device=$(echo $(hdiutil attach -nomount ram://1000000))
+    newfs_hfs -M 0700 -v "$1" "${device}"
+    hdiutil mountvol "${device}"
+
+    echo -n "${device}" > "${ramconf}"
+}
+
+exit 0

Propchange: serf/tools/buildbot/macosx/mkramdisk.sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: serf/tools/buildbot/macosx/mkramdisk.sh
------------------------------------------------------------------------------
    svn:executable = *

Added: serf/tools/buildbot/macosx/rmramdisk.sh
URL: http://svn.apache.org/viewvc/serf/tools/buildbot/macosx/rmramdisk.sh?rev=1700757&view=auto
==============================================================================
--- serf/tools/buildbot/macosx/rmramdisk.sh (added)
+++ serf/tools/buildbot/macosx/rmramdisk.sh Wed Sep  2 10:20:55 2015
@@ -0,0 +1,62 @@
+#!/bin/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 -x
+
+if [ -z "$1" ]; then
+    echo "Missing parameter: volume name"
+    exit 1
+fi
+
+if [ -z "$2" ]; then
+    echo "Missing parameter: RAMdisk config file"
+    exit 1
+fi
+
+volume="/Volumes/$1"
+ramconf="$2"
+
+if [ ! -f "${ramconf}" ]; then
+    mount | grep "^/dev/disk[0-9][0-9]* on ${volume} (hfs" || {
+        echo "Not mounted: ${volume}"
+        exit 0
+    }
+    echo "Missing RAMdisk config file: ${ramconf}"
+    exit 1
+fi
+
+if [ ! -d "${volume}" ]; then
+    echo "Mount point missing: ${volume}"
+    exit 1
+fi
+
+device=$(cat "${ramconf}")
+devfmt=$(echo "${device}" | grep "^/dev/disk[0-9][0-9]*$")
+if [ "${device}" != "${devfmt}" ]; then
+    echo "Invalid device name: ${device}"
+    exit 1
+fi
+
+mount | grep "^${device} on ${volume} (hfs" >/dev/null && {
+    set -e
+    rm "${ramconf}"
+    hdiutil detach "${device}" -force
+}
+
+exit 0

Propchange: serf/tools/buildbot/macosx/rmramdisk.sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: serf/tools/buildbot/macosx/rmramdisk.sh
------------------------------------------------------------------------------
    svn:executable = *

Added: serf/tools/buildbot/macosx/serfbuild.sh
URL: http://svn.apache.org/viewvc/serf/tools/buildbot/macosx/serfbuild.sh?rev=1700757&view=auto
==============================================================================
--- serf/tools/buildbot/macosx/serfbuild.sh (added)
+++ serf/tools/buildbot/macosx/serfbuild.sh Wed Sep  2 10:20:55 2015
@@ -0,0 +1,55 @@
+#!/bin/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
+set -x
+
+scripts=$(cd $(dirname "$0") && pwd)
+
+. ${scripts}/setenv.sh
+
+${scripts}/mkramdisk.sh ${volume_name} ${ramconf}
+
+# An optional parameter tells build scripts which version of APR to use
+if [ ! -z "$1" ]; then
+    aprdir=$(eval 'echo $SERFBB_'"$1")
+fi
+if [ ! -z "${aprdir}" -a  -d "${aprdir}" ]; then
+    aprconfig="APR=${aprdir}"
+    apuconfig="APU=${aprdir}"
+fi
+
+# Another optional parameter tells build scripts to use a different OpenSSL
+if [ ! -z "$2" ]; then
+    openssldir=$(eval 'echo $SERFBB_'"$2")
+fi
+if [ ! -z "${openssldir}" ]; then
+    opensslconfig="OPENSSL=${openssldir}"
+else
+    opemsslconfig="OPENSSL=${SERFBB_OPENSSL}"
+fi
+
+# Build
+cd "${absbld}"
+"${SERFBB_SCONS}" -Y "${abssrc}" \
+                  "CC=clang" \
+                  "PREFIX=${absbld}/.install-prefix" \
+                  "${opensslconfig}" \
+                  "${aprconfig}" \
+                  "${apuconfig}"

Propchange: serf/tools/buildbot/macosx/serfbuild.sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: serf/tools/buildbot/macosx/serfbuild.sh
------------------------------------------------------------------------------
    svn:executable = *

Added: serf/tools/buildbot/macosx/serfcheck.sh
URL: http://svn.apache.org/viewvc/serf/tools/buildbot/macosx/serfcheck.sh?rev=1700757&view=auto
==============================================================================
--- serf/tools/buildbot/macosx/serfcheck.sh (added)
+++ serf/tools/buildbot/macosx/serfcheck.sh Wed Sep  2 10:20:55 2015
@@ -0,0 +1,28 @@
+#!/bin/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 -x
+
+scripts=$(cd $(dirname "$0") && pwd)
+
+. ${scripts}/setenv.sh
+
+# Run tests
+cd "${absbld}"
+"${SERFBB_SCONS}" -Y "${abssrc}" check

Propchange: serf/tools/buildbot/macosx/serfcheck.sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: serf/tools/buildbot/macosx/serfcheck.sh
------------------------------------------------------------------------------
    svn:executable = *

Added: serf/tools/buildbot/macosx/serfclean.sh
URL: http://svn.apache.org/viewvc/serf/tools/buildbot/macosx/serfclean.sh?rev=1700757&view=auto
==============================================================================
--- serf/tools/buildbot/macosx/serfclean.sh (added)
+++ serf/tools/buildbot/macosx/serfclean.sh Wed Sep  2 10:20:55 2015
@@ -0,0 +1,27 @@
+#!/bin/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
+set -x
+
+scripts=$(cd $(dirname "$0") && pwd)
+
+. ${scripts}/setenv.sh
+
+${scripts}/rmramdisk.sh ${volume_name} ${ramconf}

Propchange: serf/tools/buildbot/macosx/serfclean.sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: serf/tools/buildbot/macosx/serfclean.sh
------------------------------------------------------------------------------
    svn:executable = *

Added: serf/tools/buildbot/macosx/setenv.sh
URL: http://svn.apache.org/viewvc/serf/tools/buildbot/macosx/setenv.sh?rev=1700757&view=auto
==============================================================================
--- serf/tools/buildbot/macosx/setenv.sh (added)
+++ serf/tools/buildbot/macosx/setenv.sh Wed Sep  2 10:20:55 2015
@@ -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
+#  under the License.
+
+## This script calls a helper that provides the folloing environemnt
+## variables:
+##
+##     PATH                     The search path
+##     SERFBB_SCONS             Path to the scons binary
+##     SERFBB_APR_15            Path of APR-1.5
+##     SERFBB_APR_20_DEV        Path of APR-2.0
+##     SERFBB_OPENSSL           OpenSSL installation prefix
+##     SERFBB_SYSTEM_OPENSSL    System default OpenSSL prefix
+##
+## The invoking script will set local variable named ${scripts} that
+## is the absolute path the parent of this file.
+
+# Modify this to suit your deployment
+environment=$(cd "${scripts}/../.." && pwd)/environment.sh
+
+eval $(${environment})
+
+export PATH
+export SERFBB_SCONS
+export SERFBB_APR_15
+export SERFBB_APR_20_DEV
+export SERFBB_OPENSSL
+export SERFBB_SYSTEM_OPENSSL
+
+
+# Set the absolute source path
+abssrc=$(pwd)
+
+# Set the path to the RAMdisk device name file
+ramconf=$(dirname "${abssrc}")/ramdisk.conf
+
+# The RAMdisk volume name is the same as the name of the builder
+volume_name=$(basename $(dirname "${abssrc}"))
+if [ -z "${volume_name}" ]; then
+    echo "Missing config parameter: RAMdisk volume name"
+    exit 1
+fi
+
+# Set the absolute build path
+absbld="/Volumes/${volume_name}"

Propchange: serf/tools/buildbot/macosx/setenv.sh
------------------------------------------------------------------------------
    svn:eol-style = native