Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

Commit

Permalink
[chore] Update devworkspace-che-theia-latest.yaml files in release pr…
Browse files Browse the repository at this point in the history
…ocess (#545)

* chore: update tags in devworkspace templates during the release

Signed-off-by: svor <[email protected]>

* chore: install git into rhel image

Signed-off-by: svor <[email protected]>
  • Loading branch information
svor authored Dec 10, 2021
1 parent 50d28f6 commit 85571a0
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
5 changes: 4 additions & 1 deletion build/dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion build/dockerfiles/rhel.install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions build/scripts/generate_devworkspace_templates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

set -e

VERSION="${1%/}"

# shellcheck disable=SC1091
source ./clone_and_zip.sh

Expand All @@ -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
1 change: 1 addition & 0 deletions make-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}" \
Expand Down

0 comments on commit 85571a0

Please sign in to comment.