From cf5833add0163612cefd37530fc020b67d74fbb3 Mon Sep 17 00:00:00 2001 From: Jared Watts Date: Fri, 10 Feb 2017 17:24:24 -0800 Subject: [PATCH] build and publish rook-operator container also --- build/release/common.sh | 9 ++++++-- build/release/containers.sh | 41 ++++++++++++++++++++++++++++++------ cmd/rook-operator/Dockerfile | 5 ----- 3 files changed, 41 insertions(+), 14 deletions(-) delete mode 100644 cmd/rook-operator/Dockerfile diff --git a/build/release/common.sh b/build/release/common.sh index 42c9e1366..502d935f3 100644 --- a/build/release/common.sh +++ b/build/release/common.sh @@ -12,13 +12,18 @@ layout_root() { local os=$1 local arch=$2 local dir=$3 + + shift 3 + local bins="$@" + local bindir=$(get_bindir ${os} ${arch}) mkdir -p $dir/root/usr/bin mkdir -p $dir/root/etc/ssl/certs - cp $bindir/rookd $dir/root/usr/bin - cp $bindir/rook $dir/root/usr/bin + for b in $bins; do + cp $bindir/$b $dir/root/usr/bin + done cp /etc/ssl/certs/ca-certificates.crt $dir/root/etc/ssl/certs } diff --git a/build/release/containers.sh b/build/release/containers.sh index ffaf9147e..9f200b590 100755 --- a/build/release/containers.sh +++ b/build/release/containers.sh @@ -4,28 +4,46 @@ scriptdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source ${scriptdir}/common.sh registry=quay.io/ -repo=rook/rookd build() { local type=$1 local os=$2 local arch=$3 - local version=${RELEASE_VERSION} [[ ${type} == "both" ]] || return 0 tmpdir=$(mktemp -d) trap "rm -fr $tmpdir" EXIT - - layout_root $os $arch $tmpdir - mkdir $tmpdir/root/tmp - cat < $tmpdir/Dockerfile FROM alpine:3.4 RUN apk add --no-cache gptfdisk util-linux coreutils COPY root / ENTRYPOINT ["/usr/bin/rookd"] EOF + build_artifact $os $arch $tmpdir rook/rookd rookd rook + + tmpdir=$(mktemp -d) + trap "rm -fr $tmpdir" EXIT + cat < $tmpdir/Dockerfile +FROM alpine:3.4 +COPY root / +ENTRYPOINT ["/usr/bin/rook-operator"] +EOF + build_artifact $os $arch $tmpdir rook/rook-operator rook-operator +} + +build_artifact() { + local os=$1 + local arch=$2 + local tmpdir=$3 + local repo=$4 + local version=${RELEASE_VERSION} + + shift 4 + local bins="$@" + + layout_root $os $arch $tmpdir $bins + mkdir $tmpdir/root/tmp tag=${repo}-${arch}:${version} if [[ ${arch} == "amd64" ]]; then @@ -52,10 +70,19 @@ publish() { local type=$1 local os=$2 local arch=$3 - local version=${RELEASE_VERSION} [[ ${type} == "both" ]] || return 0 + publish_artifact $os $arch rook/rookd + publish_artifact $os $arch rook/rook-operator +} + +publish_artifact() { + local os=$1 + local arch=$2 + local repo=$3 + local version=${RELEASE_VERSION} + tag=${repo}-${arch}:${version} if [[ ${arch} == "amd64" ]]; then tag=${repo}:${version} diff --git a/cmd/rook-operator/Dockerfile b/cmd/rook-operator/Dockerfile deleted file mode 100644 index 1b0000e97..000000000 --- a/cmd/rook-operator/Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -FROM alpine:3.4 - -COPY rook-operator /usr/bin/ - -ENTRYPOINT ["/usr/bin/rook-operator"]