From 85571a06439a410f4a4cb8a32c94c8dd2805159d Mon Sep 17 00:00:00 2001 From: Valeriy Svydenko Date: Fri, 10 Dec 2021 12:52:47 +0200 Subject: [PATCH] [chore] Update devworkspace-che-theia-latest.yaml files in release process (#545) * chore: update tags in devworkspace templates during the release Signed-off-by: svor * chore: install git into rhel image Signed-off-by: svor --- build/dockerfiles/Dockerfile | 5 ++++- build/dockerfiles/rhel.install.sh | 2 +- build/scripts/generate_devworkspace_templates.sh | 15 +++++++++++++++ make-release.sh | 1 + 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/build/dockerfiles/Dockerfile b/build/dockerfiles/Dockerfile index 01d9496bd..490bcdea0 100644 --- a/build/dockerfiles/Dockerfile +++ b/build/dockerfiles/Dockerfile @@ -7,6 +7,9 @@ # SPDX-License-Identifier: EPL-2.0 # FROM docker.io/node:16.13.0-alpine3.14 AS builder + +ARG VERSION + RUN apk add --no-cache py-pip jq bash wget git skopeo && pip install yq COPY ./build/scripts /build/ @@ -17,7 +20,7 @@ RUN ./check_mandatory_fields.sh devfiles RUN ./index.sh > /build/devfiles/index.json RUN ./list_referenced_images.sh devfiles > /build/devfiles/external_images.txt -RUN ./generate_devworkspace_templates.sh +RUN ./generate_devworkspace_templates.sh $VERSION RUN chmod -R g+rwX /build/devfiles RUN chmod -R g+rwX /build/resources diff --git a/build/dockerfiles/rhel.install.sh b/build/dockerfiles/rhel.install.sh index ea75176e1..8b036e06d 100755 --- a/build/dockerfiles/rhel.install.sh +++ b/build/dockerfiles/rhel.install.sh @@ -9,7 +9,7 @@ # set -x -microdnf --disablerepo=fedora30-updates --disablerepo=fedora30-secondary-updates install -y findutils bash wget yum gzip tar python3-six python3-pip && microdnf -y clean all +microdnf --disablerepo=fedora30-updates --disablerepo=fedora30-secondary-updates install -y findutils bash wget yum gzip git tar python3-six python3-pip && microdnf -y clean all microdnf --enablerepo=fedora30-updates --enablerepo=fedora30-secondary-updates install -y skopeo jq && microdnf update -y skopeo containers-common jq oniguruma && microdnf -y clean all # install yq (depends on jq and pyyaml - if jq and pyyaml not already installed, this will try to compile it) if [[ -f /tmp/root-local.tgz ]] || [[ ${BOOTSTRAP} == "true" ]]; then diff --git a/build/scripts/generate_devworkspace_templates.sh b/build/scripts/generate_devworkspace_templates.sh index 316ff41de..7d4915c02 100755 --- a/build/scripts/generate_devworkspace_templates.sh +++ b/build/scripts/generate_devworkspace_templates.sh @@ -10,6 +10,8 @@ set -e +VERSION="${1%/}" + # shellcheck disable=SC1091 source ./clone_and_zip.sh @@ -33,6 +35,19 @@ do --output-file:"${dir}"/devworkspace-che-theia-latest.yaml \ --project."${name}={{ INTERNAL_URL }}/resources/v2/${name}.zip" + # When release is happend, we need to replace tags of images in che-theia editor + if [ -n "$VERSION" ]; then + cheTheia="quay.io/eclipse/che-theia" + cheTheiaEndpointRuntimeBinary="${cheTheia}-endpoint-runtime-binary" + cheMachineExec="quay.io/eclipse/che-machine-exec" + sed -i "${dir}/devworkspace-che-theia-latest.yaml" \ + -e "s#${cheTheia}@sha256:\([a-z0-9\_]\([\-\.\_a-z0-9]\)*\)#${cheTheia}:${VERSION}#" + sed -i "${dir}/devworkspace-che-theia-latest.yaml" \ + -e "s#${cheTheiaEndpointRuntimeBinary}@sha256:\([a-z0-9\_]\([\-\.\_a-z0-9]\)*\)#${cheTheiaEndpointRuntimeBinary}:${VERSION}#" + sed -i "${dir}/devworkspace-che-theia-latest.yaml" \ + -e "s#${cheMachineExec}@sha256:\([a-z0-9\_]\([\-\.\_a-z0-9]\)*\)#${cheMachineExec}:${VERSION}#" + fi + clone_and_zip "${devfile_repo}" "${devfile_url##*/}" "/build/resources/v2/$name.zip" fi done diff --git a/make-release.sh b/make-release.sh index aaab66885..f50611388 100755 --- a/make-release.sh +++ b/make-release.sh @@ -147,6 +147,7 @@ performRelease() SHORT_SHA1=$(git rev-parse --short HEAD) DOCKERFILE_PATH=./build/dockerfiles/Dockerfile docker buildx build \ + --build-arg VERSION="${VERSION}" \ --push \ --platform "${PLATFORMS}" \ --tag "${REGISTRY}/${ORGANIZATION}/${IMAGE}:${VERSION}" \