publishers:
- lf-infra-publish
+- job-template:
+ id: kni-installer-publish-openshift-install-libvirt-binary
+ name: '{project-name}-publish-openshift-install-libvirt-binary'
+
+ ######################
+ # Default parameters #
+ ######################
+
+ build-days-to-keep: 200
+ build-timeout: 60
+ build-node: centos7-builder-8c-8g
+ submodule-recursive: true
+
+ #####################
+ # Job Configuration #
+ #####################
+
+ project-type: freestyle
+ node: '{build-node}'
+
+ properties:
+ - lf-infra-properties:
+ build-days-to-keep: '{build-days-to-keep}'
+
+ parameters:
+ - lf-infra-parameters:
+ project: '{project}'
+ branch: '{branch}'
+ stream: '{stream}'
+ lftools-version: '{lftools-version}'
+
+ wrappers:
+ - lf-infra-wrappers:
+ build-timeout: '{build-timeout}'
+ jenkins-ssh-credential: '{jenkins-ssh-credential}'
+
+ gerrit_verify_triggers:
+ - patchset-created-event:
+ exclude-drafts: false
+ exclude-trivial-rebase: false
+ exclude-no-code-change: false
+ - draft-published-event
+ - comment-added-contains-event:
+ comment-contains-value: '^build-binary'
+
+ scm:
+ - lf-infra-gerrit-scm:
+ jenkins-ssh-credential: '{jenkins-ssh-credential}'
+ git-url: '{git-url}/{project}.git'
+ refspec: '$GERRIT_REFSPEC'
+ branch: '$GERRIT_BRANCH'
+ submodule-recursive: '{submodule-recursive}'
+ submodule-timeout: '{submodule-timeout}'
+ choosing-strategy: default
+
+ triggers:
+ - gerrit:
+ server-name: '{gerrit-server-name}'
+ trigger-on: '{obj:gerrit_verify_triggers}'
+ projects:
+ - project-compare-type: ANT
+ project-pattern: '{project}'
+ branches:
+ - branch-compare-type: ANT
+ branch-pattern: '**/{branch}'
+
+ builders:
+ - lf-infra-pre-build
+ - shell: !include-raw-escape:
+ - ../shell/install_go.sh
+ - shell: !include-raw-escape:
+ - ../shell/build_openshift_install_libvirt_binary.sh
+
+ publishers:
+ - lf-infra-publish
jobs:
- kni-installer-verify-installer
- kni-installer-verify-binary
+ - kni-installer-publish-openshift-install-libvirt-binary
- kni-installer-merge-deploy-aws
- kni-installer-merge-deploy-libvirt
- project:
--- /dev/null
+#!/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='src/gerrit.akraino.org/kni/installer'
+
+echo '---> Building Openshift Installer binary with libvirt support'
+
+
+# move to right directory in GOPATH
+mkdir -p ${WORKSPACE}/${KNI_PATH}
+export GOPATH=${WORKSPACE}
+mv cmd pkg vendor ${WORKSPACE}/${KNI_PATH}/
+
+# 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
+
+# publish openshift-install binary in a versioned way
+source /tmp/ocp_installer_version
+export NEXUS_URL=https://nexus.akraino.org
+export GROUP_ID=org.akraino.kni
+export NEXUS_REPO_ID=snapshots
+export ARTIFACT_ID=openshift-install
+export VERSION=$(echo $INSTALLER_GIT_TAG | sed 's/^v//')
+export PACKAGING=bin
+export FILE=bin/openshift-install
+lftools deploy file $NEXUS_URL $NEXUS_REPO_ID $GROUP_ID $ARTIFACT_ID $VERSION $PACKAGING $FILE