Skip to content

Commit da3b2f2

Browse files
authored
chore(e2e): rhidp-6351 Update Dockerfile, workflows, and scripts for Yarn support (redhat-developer#2543)
* RHIDP-6351 Update Dockerfile, workflows, and scripts for Yarn support Signed-off-by: Gustavo Lira <[email protected]> * Update image tagging and upgrade opm version Added an additional image tag including the short SHA to improve traceability in the GitHub workflow. Upgraded the `opm` version in the Dockerfile from 1.23.0 to 1.47.0 Signed-off-by: Gustavo Lira <[email protected]> --------- Signed-off-by: Gustavo Lira <[email protected]>
1 parent d027a4d commit da3b2f2

File tree

5 files changed

+38
-7
lines changed

5 files changed

+38
-7
lines changed

.dockerignore

+3
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ plugins
1212
coverage
1313
dist-types
1414
examples
15+
.ibm/images/*
16+
!.ibm/images/Dockerfile
17+
!.yarnrc.yml

.github/workflows/push-e2e-runner.yaml

+6-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
- main
77
paths:
88
- '.ibm/images/Dockerfile'
9+
- '.yarnrc.yml'
910

1011
concurrency:
1112
group: ${{ github.workflow }}-${{ github.ref }}
@@ -51,7 +52,10 @@ jobs:
5152
- name: Build and Push Image
5253
uses: docker/build-push-action@v5
5354
with:
54-
context: .ibm/images/
55+
context: .
56+
file: .ibm/images/Dockerfile
5557
push: true
56-
tags: ${{ env.REGISTRY }}/${{ env.REGISTRY_IMAGE }}:${{ env.IMAGE_TAG }}
58+
tags: |
59+
${{ env.REGISTRY }}/${{ env.REGISTRY_IMAGE }}:${{ env.IMAGE_TAG }}
60+
${{ env.REGISTRY }}/${{ env.REGISTRY_IMAGE }}:${{ env.IMAGE_TAG }}-${{ env.SHORT_SHA }}
5761
platforms: ${{ env.PLATFORM }}

.ibm/images/Dockerfile

+9-3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ ENV CI=1 \
1616
GOPATH="/go" \
1717
PATH="$GOPATH/bin:/usr/local/go/bin:$PATH"
1818

19+
# Copy the .yarnrc.yml file to the environment
20+
COPY .yarnrc.yml /root/.yarnrc.yml
21+
22+
# Extract the correct version from the file and install
23+
RUN YARN_VERSION=$(awk '/yarnPath:/ {print $2}' /root/.yarnrc.yml | awk -F'[-.]' '{print $(NF-1)"."$NF}') && rm -f /root/.yarnrc.yml
24+
1925
# Install essential dependencies and Node.js tools
2026
RUN apt-get update && apt-get install -y --no-install-recommends \
2127
make gcc g++ python3 rsync sshpass \
@@ -24,7 +30,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
2430
apache2-utils \
2531
gettext \
2632
curl wget jq colorized-logs && \
27-
npm install -g typescript yarn@latest && \
33+
npm install -g typescript yarn@$YARN_VERSION && \
2834
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
2935
echo "Node: $(node -v)\nNPM: $(npm -v)\nYarn: $(yarn -v)\nTypeScript: $(tsc -v)"
3036

@@ -64,12 +70,12 @@ RUN apt-get update -y && \
6470
apt-get install -y skopeo
6571

6672
# Install umoci
67-
RUN curl -LO "https://github.com/opencontainers/umoci/releases/download/v0.4.7/umoci.amd64" && \
73+
RUN curl -LO "https://github.com/opencontainers/umoci/releases/download/v0.4.7/umoci.amd64" && \
6874
chmod +x umoci.amd64 && \
6975
mv umoci.amd64 /usr/local/bin/umoci
7076

7177
# Install opm
72-
RUN curl -LO "https://github.com/operator-framework/operator-registry/releases/download/v1.23.0/linux-amd64-opm" && \
78+
RUN curl -LO "https://github.com/operator-framework/operator-registry/releases/download/v1.47.0/linux-amd64-opm" && \
7379
chmod +x linux-amd64-opm && \
7480
mv linux-amd64-opm /usr/local/bin/opm
7581

.ibm/images/README

+9
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,12 @@ For branches **other than `main`**, OpenShift CI does **not** fetch from Quay:
3636
- **GitHub Actions automates the push process** only for `main` branch updates.
3737
- **OpenShift CI mirror has a delay** in updating the image after it is pushed to Quay.
3838
- **Other branches build the image directly**, so changes take effect immediately.
39+
40+
# ----------------------------------------------------------------------------
41+
# IMPORTANT: The build context must be set to the root of the project!
42+
# This is required to ensure the .yarnrc.yml file is included in the build.
43+
#
44+
# To build this image, run the following command from the project root:
45+
#
46+
# podman build -t quay.io/rhdh-community/rhdh-e2e-runner:release-1.y -f .ibm/images/Dockerfile .
47+
# ----------------------------------------------------------------------------

.ibm/pipelines/utils.sh

+11-2
Original file line numberDiff line numberDiff line change
@@ -628,12 +628,21 @@ create_app_config_map_k8s() {
628628
run_tests() {
629629
local release_name=$1
630630
local project=$2
631-
project=${project}
632631
cd "${DIR}/../../e2e-tests"
633632
local e2e_tests_dir
634633
e2e_tests_dir=$(pwd)
635634

636-
yarn install
635+
yarn install --immutable > /tmp/yarn.install.log.txt 2>&1
636+
637+
INSTALL_STATUS=$?
638+
if [ $INSTALL_STATUS -ne 0 ]; then
639+
echo "=== YARN INSTALL FAILED ==="
640+
cat /tmp/yarn.install.log.txt
641+
exit $INSTALL_STATUS
642+
else
643+
echo "Yarn install completed successfully."
644+
fi
645+
637646
yarn playwright install chromium
638647

639648
Xvfb :99 &

0 commit comments

Comments
 (0)