mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
3e3549e45c
* Update docs to include s390x arch Signed-off-by: Venkata Krishna Rohit Sakala <rohitsakala@gmail.com> * Add s390x drone pipeline Signed-off-by: Venkata Krishna Rohit Sakala <rohitsakala@gmail.com> * Install trivy linux arch only for amd64 This is done so that trivy is not installed for s390x arch Signed-off-by: Venkata Krishna Rohit Sakala <rohitsakala@gmail.com> * Add s390x arch if condition for Dockerfile.test Signed-off-by: Venkata Krishna Rohit Sakala <rohitsakala@gmail.com> * Add s390x arch in install script Signed-off-by: Venkata Krishna Rohit Sakala <rohitsakala@gmail.com> * Add s390x GOARCH in build script Signed-off-by: Venkata Krishna Rohit Sakala <rohitsakala@gmail.com> * Add SUFFIX s390x in scripts Signed-off-by: Venkata Krishna Rohit Sakala <rohitsakala@gmail.com> * Skip image scan for s390x arch Signed-off-by: Venkata Krishna Rohit Sakala <rohitsakala@gmail.com> * Update klipper-lb to version v0.3.5 Signed-off-by: Venkata Krishna Rohit Sakala <rohitsakala@gmail.com> * Update traefik version to v2.6.2 Signed-off-by: Venkata Krishna Rohit Sakala <rohitsakala@gmail.com> * Update registry to v2.8.1 in tests which supports s390x Signed-off-by: Venkata Krishna Rohit Sakala <rohitsakala@gmail.com> * Skip compact tests for s390x arch This is done because compact test require a previous k3s version which supports s390x and it is not available Signed-off-by: Venkata Krishna Rohit Sakala <rohitsakala@gmail.com>
43 lines
1.2 KiB
Bash
Executable File
43 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
if [ -z "${DRONE_TAG}" ]; then
|
|
echo "DRONE_TAG not defined" >&2
|
|
exit 1
|
|
fi
|
|
|
|
set -e -x
|
|
|
|
REPO="rancher/k3s"
|
|
|
|
# docker can not contain '+' in the tag, so transform '+' to '-'
|
|
DOCKER_TAG=$(echo "${DRONE_TAG}" | sed -e 's/+/-/g')
|
|
|
|
# export variables for drone-manifest
|
|
export PLUGIN_TEMPLATE="${REPO}:${DOCKER_TAG}-ARCH"
|
|
export PLUGIN_PLATFORMS="linux/amd64,linux/arm64,linux/arm,linux/s390x"
|
|
|
|
# push current version manifest tag to docker hub
|
|
PLUGIN_TARGET="${REPO}:${DOCKER_TAG}" drone-manifest
|
|
|
|
# do not tag in docker as latest if the github tag contains a '-'
|
|
if echo "${DRONE_TAG}" | grep -q '-'; then
|
|
exit 0
|
|
fi
|
|
|
|
# get latest released version from github
|
|
GITHUB_URL=https://github.com/k3s-io/k3s/releases
|
|
VERSION_K3S=$(curl -w '%{url_effective}' -I -L -s -S ${GITHUB_URL}/latest -o /dev/null | sed -e 's|.*/||')
|
|
|
|
# function for comparing versions
|
|
version_ge() {
|
|
[ "$1" = "$2" ] || [ "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1" ]
|
|
}
|
|
|
|
# do not tag in docker as latest if we are not greater than or equal to the latest github tag
|
|
if ! version_ge "${DRONE_TAG}" "${VERSION_K3S}"; then
|
|
exit 0
|
|
fi
|
|
|
|
# push latest manifest tag to docker hub
|
|
PLUGIN_TARGET="${REPO}:latest" drone-manifest
|