X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=jjb%2Fshell%2Fkni_deploy_libvirt.sh;fp=jjb%2Fshell%2Fkni_deploy_libvirt.sh;h=22396e5b9d1a4b4cf79b2b034e6a81ab4e7b056a;hb=60233a7c226edc23588389137a4df9dbe431a1ce;hp=0000000000000000000000000000000000000000;hpb=642a1f464be38d7c4ca03c5c6239183ec9f19901;p=ci-management.git diff --git a/jjb/shell/kni_deploy_libvirt.sh b/jjb/shell/kni_deploy_libvirt.sh new file mode 100755 index 0000000..22396e5 --- /dev/null +++ b/jjb/shell/kni_deploy_libvirt.sh @@ -0,0 +1,59 @@ +#!/bin/bash +# +# Copyright (c) 2019 Red Hat +# +# 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. + +set -e -u -x -o pipefail + +export PATH=$PATH:/usr/local/go/bin:/usr/local/bin +KNI_PATH='go/src/gerrit.akraino.org/kni' + +echo '---> Starting kni installer generation' + +mkdir -p $HOME/${KNI_PATH}/installer +export GOPATH=${WORKSPACE} + +# do a host preparation and cleanup +bash utils/prep_host.sh +wget https://raw.githubusercontent.com/openshift/installer/master/scripts/maintenance/virsh-cleanup.sh +chmod a+x ./virsh-cleanup.sh +sudo bash -c "yes Y | ./virsh-cleanup.sh" + +# first build kni installer +make build 2>&1 | tee ${WORKSPACE}/build.log + +# now build the openshift-install binary and copy to gopath +make binary 2>&1 | tee ${WORKSPACE}/binary.log + +# then start aws deploy +export MASTER_MEMORY_MB=24000 +export CREDENTIALS=file://$(pwd)/akraino-secrets +export BASE_REPO="git::https://gerrit.akraino.org/r/kni/templates" +export BASE_PATH="libvirt/3-node" +export SITE_REPO="git::https://gerrit.akraino.org/r/kni/templates" +export SETTINGS_PATH="libvirt/sample_settings.yaml" +export INSTALLER_PATH="file://${HOME}/${KNI_PATH}/installer/bin/openshift-install" +make deploy 2>&1 | tee ${WORKSPACE}/libvirt_deploy.log +STATUS=$? + +# output tfstate +echo "metadata.json for removing cluster" +cat $(pwd)/build/metadata.json + +if [ $STATUS -ne 0 ]; then + echo "Error deploying in libvirt" + exit 1 +fi + +exit $STATUS