build and publish rook-operator container also

This commit is contained in:
Jared Watts committed 2017-02-13 12:46:38 -08:00
1 parent ed200b726f
commit cf5833add0
3 files changed
+41 -14

No files matched your search

+7 -2
View File
@@ -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
}
+34 -7
View File
@@ -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 <<EOF > $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 <<EOF > $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}
-5
View File
@@ -1,5 +0,0 @@
FROM alpine:3.4
COPY rook-operator /usr/bin/
ENTRYPOINT ["/usr/bin/rook-operator"]