From ab1a4c9599059e720b4a18dea154bef0dbc817f5 Mon Sep 17 00:00:00 2001 From: Gary Wu Date: Fri, 25 Aug 2017 06:46:17 -0700 Subject: Add memcached to Jenkins build environment Change-Id: Ieb29292035d599c2114f32e0d50bdb4bb463fd29 Issue-id: INT-114 Signed-off-by: Gary Wu --- packer/provision/memcached.sh | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 packer/provision/memcached.sh (limited to 'packer/provision') diff --git a/packer/provision/memcached.sh b/packer/provision/memcached.sh new file mode 100644 index 000000000..4f2923722 --- /dev/null +++ b/packer/provision/memcached.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# This particular environment was created specifically for MultiCloud + +# vim: ts=4 sw=4 sts=4 et tw=72 : + +# force any errors to cause the script and job to end in failure +set -xeu -o pipefail + +rh_systems() { + # memcached + yum install -y memcached + systemctl enable memcached +} + +ubuntu_systems() { + # memcached + apt-get install memcached +} + +all_systems() { + echo 'No common distribution configuration to perform' +} + +echo "---> Detecting OS" +ORIGIN=$(facter operatingsystem | tr '[:upper:]' '[:lower:]') + +case "${ORIGIN}" in + fedora|centos|redhat) + echo "---> RH type system detected" + rh_systems + ;; + ubuntu) + echo "---> Ubuntu system detected" + ubuntu_systems + ;; + *) + echo "---> Unknown operating system" + ;; +esac + +# execute steps for all systems +all_systems -- cgit 1.2.3-korg