From 74681c94cc3dd703a5050906f524a04513e6d5af Mon Sep 17 00:00:00 2001 From: svor Date: Mon, 6 Dec 2021 15:07:44 +0200 Subject: [PATCH 1/2] chore: update tags in devworkspace templates during the release Signed-off-by: svor --- build/dockerfiles/Dockerfile | 5 ++++- build/scripts/generate_devworkspace_templates.sh | 14 ++++++++++++++ make-release.sh | 1 + 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/build/dockerfiles/Dockerfile b/build/dockerfiles/Dockerfile index bd223078d..c32a1c2a2 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 FROM docker.io/httpd:2.4.43-alpine AS registry diff --git a/build/scripts/generate_devworkspace_templates.sh b/build/scripts/generate_devworkspace_templates.sh index b2dd53448..37da2d1f9 100755 --- a/build/scripts/generate_devworkspace_templates.sh +++ b/build/scripts/generate_devworkspace_templates.sh @@ -8,6 +8,8 @@ # SPDX-License-Identifier: EPL-2.0 # +VERSION="${1%/}" + npm install -g @eclipse-che/che-theia-devworkspace-handler@0.0.1-1638274327 mkdir /build/out/ for dir in /build/devfiles/*/ @@ -18,5 +20,17 @@ do npx @eclipse-che/che-theia-devworkspace-handler --devfile-url:"${devfile}" --output-file:"${dir}"/devworkspace-che-theia-next.yaml npx @eclipse-che/che-theia-devworkspace-handler --devfile-url:"${devfile}" --editor:eclipse/che-theia/latest \ --output-file:"${dir}"/devworkspace-che-theia-latest.yaml + # 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 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}" \ From fa6bf6b2e17e27fa8bda904d04b4dbd9f71f5d7f Mon Sep 17 00:00:00 2001 From: svor Date: Thu, 9 Dec 2021 15:40:35 +0200 Subject: [PATCH 2/2] chore: install git into rhel image Signed-off-by: svor --- build/dockerfiles/rhel.install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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