summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVanessa Rene Valderrama <vvalderrama@linuxfoundation.org>2017-05-17 07:05:45 -0500
committerVanessa Rene Valderrama <vvalderrama@linuxfoundation.org>2017-08-10 15:12:38 -0500
commit253cb0b321dcf44ee0d2291427ef001d031532bf (patch)
tree2bef507360847af770a51a2f732637a89318e45b
parent0f7d85ebf0eba038a0a3c4676e4eb164b683ed2d (diff)
Add openSuSE image
Configure baseline and basebuild scripts to build openSuSE packer images Configure Jenkins keys for openSuSE Add openSuSE as a Jenkins system type Change-Id: I69bdd265773fa9c50753179b0b3f0d214490b28e Signed-off-by: Vanessa Rene Valderrama <vvalderrama@linuxfoundation.org>
-rwxr-xr-xjenkins-scripts/create_jenkins_user.sh11
-rwxr-xr-xjenkins-scripts/system_type.sh3
-rw-r--r--packer/provision/basebuild.sh63
-rw-r--r--packer/provision/baseline.sh34
-rw-r--r--packer/vars/opensuse.json7
5 files changed, 114 insertions, 4 deletions
diff --git a/jenkins-scripts/create_jenkins_user.sh b/jenkins-scripts/create_jenkins_user.sh
index 779d1f7c1..2a8655b61 100755
--- a/jenkins-scripts/create_jenkins_user.sh
+++ b/jenkins-scripts/create_jenkins_user.sh
@@ -15,6 +15,7 @@
OS=$(facter operatingsystem | tr '[:upper:]' '[:lower:]')
+groupadd jenkins
useradd -m -s /bin/bash jenkins
# Check if docker group exists
@@ -35,7 +36,15 @@ fi
mkdir /home/jenkins/.ssh
mkdir /w
-cp -r /home/${OS}/.ssh/authorized_keys /home/jenkins/.ssh/authorized_keys
+
+if [ "$OS" = "opensuse" ];
+then
+ OS_USER="root"
+else
+ OS_USER="$OS"
+fi
+#Generate ssh key for use by Robot jobs
+cp -r /${OS_USER}/.ssh/authorized_keys /home/jenkins/.ssh/authorized_keys
# Generate ssh key for use by Robot jobs
echo -e 'y\n' | ssh-keygen -N "" -f /home/jenkins/.ssh/id_rsa -t rsa
chown -R jenkins:jenkins /home/jenkins/.ssh /w
diff --git a/jenkins-scripts/system_type.sh b/jenkins-scripts/system_type.sh
index 88210a4ce..c3083ae28 100755
--- a/jenkins-scripts/system_type.sh
+++ b/jenkins-scripts/system_type.sh
@@ -17,7 +17,8 @@ IFS=','
for i in "basebuild,basebuild" \
"centos,centos" \
"ubuntu1404,ubuntu1404" \
- "ubuntu1604,ubuntu1604"
+ "ubuntu1604,ubuntu1604" \
+ "opensuse,opensuse"
do set -- $i
if [[ $HOST == *"$1"* ]]; then
SYSTEM_TYPE="$2"
diff --git a/packer/provision/basebuild.sh b/packer/provision/basebuild.sh
index 88d208d34..fa1f44468 100644
--- a/packer/provision/basebuild.sh
+++ b/packer/provision/basebuild.sh
@@ -182,6 +182,65 @@ ubuntu_systems() {
echo "<--- Forcing CA certificate update $(date +'%Y%m%dT%H%M%S')"
}
+opensuse_systems() {
+
+ # openSuSE Install build tools
+ echo "---> Installing openSuSE build tools $(date +'%Y%m%dT%H%M%S')"
+ OPENSUSE_TOOLS_PKGS="glibc-devel-static java-1_8_0-openjdk-devel yum-utils \
+ openssl indent pkg-config emacs"
+ zypper install -y "${OPENSUSE_TOOLS_PKGS}"
+
+ # Memory leakage checks
+ zypper install -y valgrind
+
+ # openSuSE Install Python dependencies
+ echo "---> Installing openSuSE Python dependencies $(date +'%Y%m%dT%H%M%S')"
+ OPENSUSE_PYTHON_PKGS="python-devel python-virtualenv python-setuptools \
+ python-pip python-wheel libmysqlclient-dev kernel-devel"
+ zypper install -y "${OPENSUSE_PYTHON_PKGS}"
+
+ # openSuSE Install Documentation packages
+ echo "---> Installing openSuSE documentation packages $(date +'%Y%m%dT%H%M%S')"
+ OPENSUSE_DOC_PKGS="doxygen graphviz python-jinja2 asciidoc dblatex \
+ source-highlight python-sphinx libxml2 libffi-devel python-cffi \
+ python-pyparsing libstdc++6 python-sphinx_rtd_theme"
+ zypper install -y "${OPENSUSE_DOC_PKGS}"
+
+ # openSuSE Install GCC packages
+ echo "---> Installing openSuSE GCC packages $(date +'%Y%m%dT%H%M%S')"
+ OPENSUSE_GCC_PKGS="cpp gcc gcc-c++ cmake make lcov"
+ zypper install -y "${OPENSUSE_GCC_PKGS}"
+
+ # openSuSE Install components to build Ganglia modules
+ # ganglia-devel not available for 42.3
+ echo "---> Installing openSuSE components $(date +'%Y%m%dT%H%M%S')"
+ OPENSUSE_GANGLIA_MODS="libconfuse-devel python-mock rrdtool rrdtool-devel \
+ libapr1 libapr1-devel libexpat-devel pcre-devel"
+ zypper install -y "${OPENSUSE_GANGLIA_MODS}"
+
+ # openSuSE Install VPP packages to shorten build times
+ echo "---> Installing VPP dependencies $(date +'%Y%m%dT%H%M%S')"
+ OPENSUSE_VPP_PKGS="curl autoconf automake bison ccache git libtool \
+ git-review ctags cscope libxml2-tools unzip lsb-release devscripts"
+ zypper install -y "${OPENSUSE_VPP_PKGS}"
+
+ # openSuSE Install TLDK dependencies
+ OPENSUSE_TLKD_PKGS="libpcap-devel libcap-devel"
+ yum install -y "${OPENSUSE_TLKD_PKGS}"
+ zypper -n install -t pattern devel_basis
+
+ # openSuSE Manipulation tools, edits debugger, and LSB
+ echo "---> Installing tools packages $(date +'%Y%m%dT%H%M%S')"
+ TOOL_PKGS="iproute2 ethtool vlan bridge-utils vim gdb gdbserver"
+ zypper install -y "${TOOL_PKGS}"
+
+
+ # openSuSE Install Puppet packages
+ PUPPET_PKGS="libxml2-devel libxslt-devel ruby-devel zlib-devel"
+ zypper install -y "${PUPPET_PKGS}"
+
+}
+
all_systems() {
echo 'Configure keep alive to prevent timeout during testing'
@@ -215,6 +274,10 @@ case "${ORIGIN}" in
echo "---> Ubuntu system detected"
ubuntu_systems
;;
+ opensuse)
+ echo "---> openSuSE system detected"
+ opensuse_systems
+ ;;
*)
echo "---> Unknown operating system"
;;
diff --git a/packer/provision/baseline.sh b/packer/provision/baseline.sh
index a0ef68061..7d18d5aba 100644
--- a/packer/provision/baseline.sh
+++ b/packer/provision/baseline.sh
@@ -208,6 +208,27 @@ EOF
}
+opensuse_systems() {
+ # SELinux?
+
+ echo "---> Updating operating system"
+ zypper -n clean
+ zypper -n update
+
+ # add in components we need or want on systems
+ echo "---> Installing base packages"
+ zypper install -y unzip xz puppet git git-review perl-XML-XPath wget make
+
+ # All of our systems require Java (because of Jenkins)
+ echo "---> Configuring OpenJDK"
+ zypper install -y 'java-*-openjdk-devel'
+
+ # Needed to parse OpenStack commands used by infra stack commands
+ # to initialize Heat template based systems.
+ zypper install -y jq
+
+}
+
all_systems() {
# Allow jenkins access to update-alternatives command to switch java version
cat <<EOF >/etc/sudoers.d/89-jenkins-user-defaults
@@ -238,10 +259,15 @@ echo "---> Attempting to detect OS"
ORIGIN=$(if [ -e /etc/redhat-release ]
then
echo redhat
- else
+ else [ -e /etc/os-release ]
+ DIST="$(grep "\<ID\>" /etc/os-release)"
+ if [ $DIST = "ID=ubuntu" ]
+ then
echo ubuntu
+ else
+ echo opensuse
+ fi
fi)
-#ORIGIN=$(logname)
case "${ORIGIN}" in
fedora|centos|redhat)
@@ -252,6 +278,10 @@ case "${ORIGIN}" in
echo "---> Ubuntu system detected"
ubuntu_systems
;;
+ opensuse)
+ echo "---> openSuSE system detected"
+ opensuse_systems
+ ;;
*)
echo "---> Unknown operating system"
;;
diff --git a/packer/vars/opensuse.json b/packer/vars/opensuse.json
new file mode 100644
index 000000000..d8ba547fc
--- /dev/null
+++ b/packer/vars/opensuse.json
@@ -0,0 +1,7 @@
+{
+ "base_image": "openSuSE LEAP 42.3 (2017-05-17) - LF upload",
+ "cloud_user": "root",
+
+ "distro": "openSuSE LEAP 42.3",
+ "cloud_user_data": "provision/null_data.sh"
+}