integ/kubernetes/plugins/sriov-network-device-plugin/centos/build-sriov-network-device-plugin-image.sh
Steven Webster e2dc5c2dd0 Fix sriov device plugin image build
Previous commit d204f10ab5 introduced a build script to assist
in building the SR-IOV device plugin.

The script utilizes a Makefile to do build the plugin binary,
then the image.

Building the binary depends on go being present on the host. If it
is not, the build will fail.

Building the binary is actually not required, as it will be also
done in a container as part of the 'make image', rather than copying
the binary from the host.

Closes-Bug: #1878224
Change-Id: I4499ea2bbef4b3da8a154c69a07b415574517500
Signed-off-by: Steven Webster <steven.webster@windriver.com>
2020-05-12 10:49:06 -04:00

33 lines
735 B
Bash

#!/bin/bash
################################################################################
# Copyright (c) 2020 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
################################################################################
PROJECT=$1
IMAGE_TAG=$2
if [ -z "${IMAGE_TAG}" ]; then
echo "image tag must be specified. build ${PROJECT} Aborting..." >&2
exit 1
fi
make image
if [ $? -ne 0 ]; then
echo "Failed to make ${PROJECT} image. Aborting..." >&2
exit 1
fi
RETVAL=0
docker tag nfvpe/${PROJECT}:latest "${IMAGE_TAG}"
if [ $? -ne 0 ]; then
echo "Failed to tag ${PROJECT} with ${IMAGE_TAG}. Aborting..." >&2
RETVAL=1
fi
docker rmi nfvpe/${PROJECT}:latest
exit ${RETVAL}