upload container to quay.io

upload our containers to quay.io where they are automatically
converted to ACIs for use by rkt. Partially addresses #50

remove github-release as it was being flaky.
This commit is contained in:
Bassam Tabbara committed 2016-10-12 21:17:20 -07:00
1 parent 020cb15005
commit c89025c913
8 files changed
+37 -17

No files matched your search

+1 -1
View File
@@ -1,4 +1,4 @@
.glide/
.glide
.work/
.vscode/
+1 -5
View File
@@ -23,6 +23,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends \
curl \
docker.io \
git \
jq \
libxml2-dev \
llvm-dev \
mingw-w64 \
@@ -53,11 +54,6 @@ RUN ACBUILD_VERSION=0.4.0 && \
curl -fsSLO https://github.com/containers/build/releases/download/v${ACBUILD_VERSION}/acbuild-v${ACBUILD_VERSION}.tar.gz && \
tar -C /usr/local/bin --strip-components=1 -xzf acbuild-v${ACBUILD_VERSION}.tar.gz
#install github-release
RUN GITHUB_RELEASE_VERSION=0.6.2 && \
curl -fsSLO https://github.com/aktau/github-release/releases/download/v${GITHUB_RELEASE_VERSION}/linux-amd64-github-release.tar.bz2 && \
tar -C /usr/local/bin --strip-components=3 -xjf linux-amd64-github-release.tar.bz2
#
# install multi-arch packages needed to build ceph
#
+1 -1
View File
@@ -1 +1 @@
0.1.2
0.1.3
+1 -1
View File
@@ -28,7 +28,7 @@ RELEASE_CLIENT_ONLY_PLATFORMS ?=
RELEASE_HOST_PLATFORM ?= $(shell go env GOHOSTOS)_$(shell go env GOHOSTARCH)
# Optional. the flavors to release
RELEASE_FLAVORS := binaries docker aci
RELEASE_FLAVORS := binaries docker
# Optional. Github token repo and user
GITHUB_TOKEN ?=
+20 -7
View File
@@ -1,7 +1,5 @@
#!/bin/bash -e
ghargs="-u ${GITHUB_USER} -r ${GITHUB_REPO} -t ${RELEASE_VERSION}"
get_bindir() {
local os=$1
local arch=$2
@@ -29,15 +27,30 @@ layout_root() {
cp /etc/ssl/certs/ca-certificates.crt $dir/root/etc/ssl/certs
}
github_get_release_id() {
curl -4 -s -H "Authorization: token ${GITHUB_TOKEN}" \
"https://api.github.com/repos/${GITHUB_USER}/${GITHUB_REPO}/releases/tags/${RELEASE_VERSION}" | jq -r '.id'
}
github_check_release() {
if ! github-release info ${ghargs} > /dev/null 2>&1; then
echo "ERROR: github release tag ${version} was not found. Did you create the release?" 1>&2
id=$(github_get_release_id)
if [[ ${id} == "null" ]]; then
echo "ERROR: github release tag ${RELEASE_VERSION} was not found. Did you create the release?" 1>&2
return 1;
fi
}
github_upload() {
local file=$1
github-release upload ${ghargs} -n $(basename $file) -f $file
}
local filepath=$1
local mediatype=$2
local filename=$(basename $filepath)
id=$(github_get_release_id)
curl -4 -s -H "Authorization: token ${GITHUB_TOKEN}" \
-H "Accept: application/vnd.github.manifold-preview" \
-H "Content-Type: application/${mediatype}" \
--data-binary @${filepath} \
"https://uploads.github.com/repos/${GITHUB_USER}/${GITHUB_REPO}/releases/${id}/assets?name=${filename}"
}
+5 -2
View File
@@ -3,7 +3,7 @@
scriptdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source ${scriptdir}/common.sh
container=quantum/castle
container=quantum/castled
build() {
local type=$1
@@ -30,7 +30,7 @@ EOF
fi
echo building docker container ${tag}
docker build -t ${tag} $tmpdir
docker build -t ${tag} -t quay.io/${tag} $tmpdir
rm -fr $tmpdir
}
@@ -50,6 +50,9 @@ publish() {
echo pushing docker container ${tag}
docker push ${tag}
echo pushing docker container quay.io/${tag}
docker push quay.io/${tag}
}
action=$1
+7
View File
@@ -44,12 +44,18 @@ fi
tty -s && TTY_ARGS=-ti || TTY_ARGS=
if [ -z "${DISABLE_HOST_NETWORK}" ]; then
NET_ARGS="--net=host"
fi
if [ -z "${DISABLE_NESTED_DOCKER}" ]; then
DOCKER_NESTED_ARGS="\
-v ${HOME}/.docker/config.json:${BUILDER_HOME}/.docker/config.json \
-v /var/run/docker.sock:/var/run/docker.sock"
fi
# NOTE: docker seems more reliable when running with net=host.
docker run \
--rm \
--name "${friendly_name}" \
@@ -64,6 +70,7 @@ docker run \
${NETRC_ARGS} \
${USER_ARGS} \
${DOCKER_NESTED_ARGS} \
${NET_ARGS} \
-v ${scriptdir}/../bin:${BUILDER_HOME}/go/bin \
-v ${scriptdir}/../.work/cross/pkg:${BUILDER_HOME}/go/pkg \
-v ${scriptdir}/..:${BUILDER_HOME}/go/src/github.com/quantum/castle \
+1
View File
@@ -5,6 +5,7 @@ machine:
NPROCS: $(( ($(grep -c ^processor /proc/cpuinfo) + 1) / 2 ))
CCACHE_DIR: ${HOME}/.ccache
DISABLE_NESTED_DOCKER: 1
DISABLE_HOST_NETWORK: 1
checkout:
pre: