From: Jeremy Mordkoff Date: Thu, 4 Aug 2016 23:46:55 +0000 (-0400) Subject: riftware - switched to getting tools for installing pre-requisites from an RPM X-Git-Tag: v1.0.0~36 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F65%2F265%2F1;p=osm%2Fdevops.git riftware - switched to getting tools for installing pre-requisites from an RPM common - fixed some bugs that were letting error messages from check functions leak out on the console SO & UI -- created directories for these MDGs Signed-off-by: Jeremy Mordkoff --- diff --git a/jenkins/SO/SETTINGS b/jenkins/SO/SETTINGS new file mode 100644 index 00000000..786feb68 --- /dev/null +++ b/jenkins/SO/SETTINGS @@ -0,0 +1,37 @@ +# Copyright 2016 RIFT.IO Inc +# +# Licensed 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. +# +# sample SETTINGS file +# +# 24 June 2016 -- Jeremy Mordkoff -- Genesis +# +# this variable holds the name of the container image needed to build or run this product +export OSM_BASE_IMAGE=ubuntu:16.04 +# +# this variable holds the name of the container to be used to build a package +# if this container already exists, the build process can skip the container build +export OSM_BUILD_CONTAINER=SO-build +# +# this variable must be set to allow creating the build container in privileged mode +# this variable should be removed in the future when no privileged mode is required +#export OSM_BUILD_CONTAINER_PRIVILEGED=yes +# +# this variable holds the name of the container to be used to run a package +# if this container already exists, the run processes can skip the container build +export OSM_RUNTIME_CONTAINER=SO-runtime +# +# this variable must be set to allow creating the runtime container in privileged mode +# this variable should be removed in the future when no privileged mode is required +#export OSM_RUNTIME_CONTAINER_PRIVILEGED=yes + diff --git a/jenkins/SO/start_build b/jenkins/SO/start_build new file mode 100755 index 00000000..27ca6e52 --- /dev/null +++ b/jenkins/SO/start_build @@ -0,0 +1,51 @@ +#!/bin/bash +# Copyright 2016 RIFT.IO Inc +# +# Licensed 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. +# +# TEMPLATE script to start a build. This is run inside a container +# +# 6 July 2016 -- Jeremy.Mordkoff@riftio.com -- adapted from the riftware version +# + +HERE=$(realpath $(dirname $0)) +OSM_JENKINS=$(dirname $HERE) +. $OSM_JENKINS/common/all_funcs + +# SET YOU MDG repository name here +export OSM_MDG=SO +OSM_load_config + + +# Here is an example for how to handle an incremental build +if [ -d $OSM_MDG ]; then + INFO "reusing existing workspace" + cd $OSM_MDG + git pull +else + INFO "cloning MDG $OSM_MDG from $OSM_GIT_URL/$OSM_MDG" + git clone $OSM_GIT_URL/$OSM_MDG + cd $OSM_MDG +fi +INFO "starting build" + +### for start_build +### put your commands here to +### build, test and produce coverage reports + +RC=0 + +INFO "done, RC=$RC" +exit $RC + + diff --git a/jenkins/UI/SETTINGS b/jenkins/UI/SETTINGS new file mode 100644 index 00000000..c79217f5 --- /dev/null +++ b/jenkins/UI/SETTINGS @@ -0,0 +1,37 @@ +# Copyright 2016 RIFT.IO Inc +# +# Licensed 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. +# +# sample SETTINGS file +# +# 24 June 2016 -- Jeremy Mordkoff -- Genesis +# +# this variable holds the name of the container image needed to build or run this product +export OSM_BASE_IMAGE=ubuntu:16.04 +# +# this variable holds the name of the container to be used to build a package +# if this container already exists, the build process can skip the container build +export OSM_BUILD_CONTAINER=UI-build +# +# this variable must be set to allow creating the build container in privileged mode +# this variable should be removed in the future when no privileged mode is required +#export OSM_BUILD_CONTAINER_PRIVILEGED=yes +# +# this variable holds the name of the container to be used to run a package +# if this container already exists, the run processes can skip the container build +export OSM_RUNTIME_CONTAINER=UI-runtime +# +# this variable must be set to allow creating the runtime container in privileged mode +# this variable should be removed in the future when no privileged mode is required +#export OSM_RUNTIME_CONTAINER_PRIVILEGED=yes + diff --git a/jenkins/UI/start_build b/jenkins/UI/start_build new file mode 100755 index 00000000..5a54d2da --- /dev/null +++ b/jenkins/UI/start_build @@ -0,0 +1,51 @@ +#!/bin/bash +# Copyright 2016 RIFT.IO Inc +# +# Licensed 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. +# +# TEMPLATE script to start a build. This is run inside a container +# +# 6 July 2016 -- Jeremy.Mordkoff@riftio.com -- adapted from the riftware version +# + +HERE=$(realpath $(dirname $0)) +OSM_JENKINS=$(dirname $HERE) +. $OSM_JENKINS/common/all_funcs + +# SET YOU MDG repository name here +export OSM_MDG=UI +OSM_load_config + + +# Here is an example for how to handle an incremental build +if [ -d $OSM_MDG ]; then + INFO "reusing existing workspace" + cd $OSM_MDG + git pull +else + INFO "cloning MDG $OSM_MDG from $OSM_GIT_URL/$OSM_MDG" + git clone $OSM_GIT_URL/$OSM_MDG + cd $OSM_MDG +fi +INFO "starting build" + +### for start_build +### put your commands here to +### build, test and produce coverage reports + +RC=0 + +INFO "done, RC=$RC" +exit $RC + + diff --git a/jenkins/common/container b/jenkins/common/container index 5c0ef959..400e38aa 100644 --- a/jenkins/common/container +++ b/jenkins/common/container @@ -21,7 +21,7 @@ container_exists() { if [ $# -ne 1 ]; then FATAL "arg is container name" fi - lxc config show $1 2>&1 >/dev/null + lxc config show $1 >/dev/null 2>&1 if [ $? -eq 0 ]; then DEBUG "container $1 exists" return 0 @@ -55,6 +55,12 @@ container_exec() { DEBUG "exec in $container \"$*\"" lxc exec "$container" -- $* } +container_exec_stderr() { + container="$1" + shift + DEBUG "exec in $container \"$*\"" + lxc exec "$container" -- $* 2>&1 +} wait_container_up() { [ $# -eq 1 ] || FATAL "arg is container name got $# args - $*" @@ -62,7 +68,7 @@ wait_container_up() { RE="1 received" while [ $ct -lt 60 ]; do let ct=ct+1 - output=$(container_exec "$1" ping -c 1 google.com) + output=$(container_exec_stderr "$1" ping -c 1 google.com) if [[ $output =~ $RE ]]; then DEBUG "$1 is up" return diff --git a/jenkins/riftware/start_build b/jenkins/riftware/start_build index 0f314778..0e3101f5 100755 --- a/jenkins/riftware/start_build +++ b/jenkins/riftware/start_build @@ -29,15 +29,27 @@ if [ -d riftware ]; then cd riftware git pull else + INFO "install pre-requisites" + yum install -y yum-utils curl + curl -o /etc/yum.repos.d/release.repo http://buildtracker.riftio.com/repo_file/fc20/OSM/ + yum install -y --nogpgcheck rw.tools-container-tools rw.tools-scripts + /usr/rift/container_tools/mkcontainer --modes build --internet --latest --repofile /usr/rift/container_tools/riftware.repo + + INFO "cloning MDG riftware from $OSM_GIT_URL/riftware" + # these were missing once, so just to be safe, install them again here + yum -y install cmake wget lcov git clone $OSM_GIT_URL/riftware cd riftware - INFO "install pre-requisites" - bash ./scripts/vm_image/mkcontainer --modes build fi -INFO "no build script yet" -RC=1 +./rift-shell -r -- make rw.ext +RC=$? + +if [ $RC == 0 ]; then + ./rift-shell -r -- make -j16 + RC=$? +fi INFO "done RC = $RC" exit $RC