-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge commit 'cc9ecdf477fc871a898f5690a721f14884673682'
- Loading branch information
Showing
16 changed files
with
184 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,6 @@ sonobuoy* | |
|
||
# Bazel directories | ||
cluster-provision/gocli/bazel-* | ||
|
||
# Artifacts after releasing | ||
kubevirtci.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
#!/bin/bash | ||
|
||
set -euxo pipefail | ||
|
||
workdir=$(mktemp -d) | ||
ARTIFACTS=${ARTIFACTS:-/tmp} | ||
base_images=(centos8) | ||
k8s_providers=(1.17 1.18) | ||
|
||
end() { | ||
rm -rf $workdir | ||
} | ||
trap end EXIT | ||
|
||
|
||
function get_latest_digest_suffix() { | ||
local provider=$1 | ||
local latest_digest=$(docker run alexeiled/skopeo skopeo inspect docker://docker.io/kubevirtci/$provider:latest | docker run -i imega/jq -r -c .Digest) | ||
echo "@$latest_digest" | ||
} | ||
|
||
|
||
function build_and_publish_base_images() { | ||
#TODO: Discover what base images need to be build | ||
for base_image in $base_images; do | ||
pushd cluster-provision/$base_image | ||
./build.sh | ||
./publish.sh | ||
popd | ||
done | ||
} | ||
|
||
function provision_and_publish_providers() { | ||
#TODO: Discover what providers need to be build | ||
for k8s_provider in $k8s_providers; do | ||
pushd cluster-provision/k8s/$k8s_provider | ||
../provision.sh | ||
../publish.sh | ||
popd | ||
done | ||
} | ||
|
||
build_and_publish_base_images | ||
|
||
provision_and_publish_providers | ||
|
||
pushd cluster-provision/gocli | ||
make cli \ | ||
K8S118SUFFIX="$(get_latest_digest_suffix k8s-1.18)" \ | ||
K8S117SUFFIX="$(get_latest_digest_suffix k8s-1.17)" \ | ||
K8S116SUFFIX="$(get_latest_digest_suffix k8s-1.16)" \ | ||
K8S115SUFFIX="$(get_latest_digest_suffix k8s-1.15)" \ | ||
K8S114SUFFIX="$(get_latest_digest_suffix k8s-1.14)" | ||
popd | ||
|
||
# Create kubevirtci dir inside the tarball | ||
mkdir $workdir/kubevirtci | ||
|
||
# Install cluster-up | ||
cp -rf cluster-up/* $workdir/kubevirtci | ||
|
||
# Install gocli | ||
cp -f cluster-provision/gocli/build/cli $workdir/kubevirtci | ||
|
||
# Create the tarball | ||
tar -C $workdir -cvzf $ARTIFACTS/kubevirtci.tar.gz . | ||
|
||
# Install github-release tool | ||
# TODO: Vendor this | ||
export GO111MODULE=on | ||
export GOFLAGS="" | ||
go get github.com/github-release/[email protected] | ||
|
||
# Create the release | ||
tag=$(date +%s) | ||
org=kubevirt | ||
|
||
git tag $tag | ||
|
||
# To pass user/password from automations, idea is taken from [1] | ||
# [1] https://stackoverflow.com/questions/8536732/can-i-hold-git-credentials-in-environment-variables | ||
git config credential.helper '!f() { sleep 1; echo "username=${GITHUB_USER}"; echo "password=${GITHUB_TOKEN}"; }; f' | ||
|
||
|
||
git push https://github.com/$org/kubevirtci $tag | ||
github-release release \ | ||
-u $org \ | ||
-r kubevirtci \ | ||
--tag $tag \ | ||
--name $tag \ | ||
--description "Follow instructions at kubevirtci.tar.gz README" | ||
|
||
# Upload tarball | ||
github-release upload \ | ||
-u $org \ | ||
-r kubevirtci \ | ||
--name kubevirtci.tar.gz \ | ||
--tag $tag\ | ||
--file $ARTIFACTS/kubevirtci.tar.gz | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,4 @@ | ||
#!/bin/bash -e | ||
|
||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
centos_version="$(cat $DIR/version | tr -d '\n')" | ||
|
||
docker tag kubevirtci/centos:$centos_version docker.io/kubevirtci/centos:$centos_version | ||
docker push docker.io/kubevirtci/centos:$centos_version | ||
docker tag kubevirtci/centos7 docker.io/kubevirtci/centos7 | ||
docker push docker.io/kubevirtci/centos7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package images | ||
|
||
var ( | ||
K8S118SUFFIX = "" | ||
K8S117SUFFIX = "" | ||
K8S116SUFFIX = "" | ||
K8S115SUFFIX = "" | ||
K8S114SUFFIX = "" | ||
SuffixByProvider map[string]string | ||
) | ||
|
||
func init() { | ||
SuffixByProvider = map[string]string{ | ||
"k8s-1.18": K8S118SUFFIX, | ||
"k8s-1.17": K8S117SUFFIX, | ||
"k8s-1.16": K8S116SUFFIX, | ||
"k8s-1.15": K8S115SUFFIX, | ||
"k8s-1.14": K8S114SUFFIX, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
centos@sha256:4f105ae5eb0aa3bb034fa24591ea80bf67701b1bc6449d40aa1bec33bc6a4e9a | ||
centos7:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
centos@sha256:4f105ae5eb0aa3bb034fa24591ea80bf67701b1bc6449d40aa1bec33bc6a4e9a | ||
centos7:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
centos@sha256:4f105ae5eb0aa3bb034fa24591ea80bf67701b1bc6449d40aa1bec33bc6a4e9a | ||
centos7:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
centos@sha256:6822c8300b50695896333b53dd5e2aafe9f69ba51b1c89d529740a7f601f6b1b | ||
centos8:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
centos@sha256:6822c8300b50695896333b53dd5e2aafe9f69ba51b1c89d529740a7f601f6b1b | ||
centos8:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.