[node-patches] Change in ovirt-node[master]: Adding CI automation scripts to ovirt node

tlitovsk at redhat.com tlitovsk at redhat.com
Thu Jun 18 13:07:03 UTC 2015


Anatoly Litovsky has uploaded a new change for review.

Change subject: Adding CI automation scripts to ovirt node
......................................................................

Adding CI automation scripts to ovirt node

Change-Id: I44e9bdd6d3c6361da38d181d7417c9885535ddfc
Signed-off-by: Tolik Litovsky <tlitovsk at redhat.com>
---
A automation/build-artifacts.req
A automation/check-artifacts.sh
A automation/check-patch.sh
3 files changed, 173 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/49/42549/1

diff --git a/automation/build-artifacts.req b/automation/build-artifacts.req
new file mode 100755
index 0000000..4d9a6d8
--- /dev/null
+++ b/automation/build-artifacts.req
@@ -0,0 +1,3 @@
+automake
+autoconf
+make
\ No newline at end of file
diff --git a/automation/check-artifacts.sh b/automation/check-artifacts.sh
new file mode 100755
index 0000000..80f12e3
--- /dev/null
+++ b/automation/check-artifacts.sh
@@ -0,0 +1,85 @@
+#!/bin/bash -xe
+echo "build-local-ovirt-node.sh"
+#this scripts build ovirt-node and ovirt-node-is projects
+
+do_build=true
+do_clean=true
+do_publish_rpms=true
+
+# the die on error function
+function die {
+    echo "$1"
+    exit 1
+}
+
+
+#sets the env variables required for the rest
+function set_env {
+    export CACHE="$PWD"/build
+    export OVIRT_NODE_BASE="$PWD"
+    export OVIRT_CACHE_DIR="$CACHE"
+    export OVIRT_LOCAL_REPO=file://"$OVIRT_CACHE_DIR"/ovirt
+}
+
+
+#builds the node
+function build_node {
+    pushd .
+    cd "$OVIRT_NODE_BASE"/ovirt-node
+    ./autogen.sh --with-image-minimizer
+    if ! make publish ; then
+        die "Node building failed"
+    fi
+    popd
+}
+
+
+#the prereqs
+function check_pre {{
+    if [ ! -d $OVIRT_NODE_BASE/ovirt-node ] ; then
+        die "No node base found"
+    fi
+}}
+
+
+function clean_node {{
+    pushd .
+    local clean_failed=false
+    sudo rm -rf "$CACHE"
+    cd "$OVIRT_NODE_BASE"/ovirt-node
+    # get rid of old makefiles
+    git clean -dfx
+    # generate new makefiles
+    ./autogen.sh
+    make distclean \
+        || clean_failed=true
+    popd
+    if $clean_failed; then
+        return 1
+    else
+        return 0
+    fi
+}}
+
+
+set_env
+check_pre
+
+for dir in exported-artifacts; do
+    rm -Rf "$dir"
+    mkdir -p "$dir"
+done
+
+if $do_clean; then
+    clean_node
+fi
+
+if $do_build; then
+    build_node
+fi
+
+if $do_publish_rpms; then
+    rm -rf "$OVIRT_CACHE_DIR"/ovirt/RPMS/noarch/ovirt-node-plugin-rhn*.rpm
+    cp "$OVIRT_CACHE_DIR"/ovirt/RPMS/noarch/ovirt-node*.rpm exported-artifacts/
+fi
+
diff --git a/automation/check-patch.sh b/automation/check-patch.sh
new file mode 100755
index 0000000..80f12e3
--- /dev/null
+++ b/automation/check-patch.sh
@@ -0,0 +1,85 @@
+#!/bin/bash -xe
+echo "build-local-ovirt-node.sh"
+#this scripts build ovirt-node and ovirt-node-is projects
+
+do_build=true
+do_clean=true
+do_publish_rpms=true
+
+# the die on error function
+function die {
+    echo "$1"
+    exit 1
+}
+
+
+#sets the env variables required for the rest
+function set_env {
+    export CACHE="$PWD"/build
+    export OVIRT_NODE_BASE="$PWD"
+    export OVIRT_CACHE_DIR="$CACHE"
+    export OVIRT_LOCAL_REPO=file://"$OVIRT_CACHE_DIR"/ovirt
+}
+
+
+#builds the node
+function build_node {
+    pushd .
+    cd "$OVIRT_NODE_BASE"/ovirt-node
+    ./autogen.sh --with-image-minimizer
+    if ! make publish ; then
+        die "Node building failed"
+    fi
+    popd
+}
+
+
+#the prereqs
+function check_pre {{
+    if [ ! -d $OVIRT_NODE_BASE/ovirt-node ] ; then
+        die "No node base found"
+    fi
+}}
+
+
+function clean_node {{
+    pushd .
+    local clean_failed=false
+    sudo rm -rf "$CACHE"
+    cd "$OVIRT_NODE_BASE"/ovirt-node
+    # get rid of old makefiles
+    git clean -dfx
+    # generate new makefiles
+    ./autogen.sh
+    make distclean \
+        || clean_failed=true
+    popd
+    if $clean_failed; then
+        return 1
+    else
+        return 0
+    fi
+}}
+
+
+set_env
+check_pre
+
+for dir in exported-artifacts; do
+    rm -Rf "$dir"
+    mkdir -p "$dir"
+done
+
+if $do_clean; then
+    clean_node
+fi
+
+if $do_build; then
+    build_node
+fi
+
+if $do_publish_rpms; then
+    rm -rf "$OVIRT_CACHE_DIR"/ovirt/RPMS/noarch/ovirt-node-plugin-rhn*.rpm
+    cp "$OVIRT_CACHE_DIR"/ovirt/RPMS/noarch/ovirt-node*.rpm exported-artifacts/
+fi
+


-- 
To view, visit https://gerrit.ovirt.org/42549
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I44e9bdd6d3c6361da38d181d7417c9885535ddfc
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Anatoly Litovsky <tlitovsk at redhat.com>



More information about the node-patches mailing list