Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for building, testing C10S in container-common-scripts #378

Merged
merged 1 commit into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions .github/workflows/container-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
fail-fast: false
matrix:
container-to-test: ["postgresql-container", "nginx-container", "s2i-perl-container", "s2i-python-container", "s2i-base-container" ]
os: ["fedora", "c9s", "rhel7", "rhel8", "rhel9"]
os: ["fedora", "c9s", "rhel7", "rhel8", "rhel9", "c10s"]

if: |
github.event.issue.pull_request
Expand All @@ -32,7 +32,7 @@ jobs:
branch="master"
tf_scope="private"
tmt_repo="https://gitlab.cee.redhat.com/platform-eng-core-services/sclorg-tmt-plans"
if [ "${{ matrix.os }}" == "fedora" ] || [ "${{ matrix.os }}" == "c9s" ]; then
if [ "${{ matrix.os }}" == "fedora" ] || [ "${{ matrix.os }}" == "c9s" ] || [ "${{ matrix.os }}" == "c10s" ]; then
api_key=${{ secrets.TF_PUBLIC_API_KEY }}
branch="main"
tf_scope="public"
Expand All @@ -42,9 +42,15 @@ jobs:
context="Fedora"
tmt_plan="fedora"
else
compose="CentOS-Stream-9"
context="CentOS Stream 9"
tmt_plan="c9s"
if [ "${{ matrix.os }}" == "c9s" ]; then
compose="CentOS-Stream-9"
context="CentOS Stream 9"
tmt_plan="c9s"
else
compose="CentOS-Stream-10"
context="CentOS Stream 10"
tmt_plan="c10s"
fi
fi
else
if [ "${{ matrix.os }}" == "rhel7" ]; then
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Dockerfile for the scripts to know which versions to build.

`OS`
OS version you want to build the images for. Currently the scripts are able to build for
centos (default), centos6, c9s, rhel7, rhel8, rhel9, and fedora.
centos (default), c9s, c10s, rhel7, rhel8, rhel9, and fedora.

`SKIP_SQUASH`
When set to 1 the build script will skip the squash phase of the build.
Expand Down Expand Up @@ -122,7 +122,7 @@ how scripts in this repo work:

`.exclude-<OS>`
If this file exists, the tooling will not run the build and tests for the specific Dockerfile.
For example, if `.exclude-rhel7` file exists, the `Dockerfile.rhel7` will not be expected
For example, if `.exclude-rhel8` file exists, the `Dockerfile.rhel8` will not be expected
in the same directory, build and tests will be skipped.
Content of the file is not important at this point.

Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# This script is used to build the OpenShift Docker images.
#
# OS - Specifies distribution - "rhel7", "rhel8", "rhel9", "centos7", "c9s" or "fedora"
# OS - Specifies distribution - "rhel7", "rhel8", "rhel9", "centos7", "c9s", "c10s" or "fedora"
# VERSION - Specifies the image version - (must match with subdirectory in repo)
# SINGLE_VERSION - Specifies the image version - (must match with subdirectory in repo)
# VERSIONS - Must be set to a list with possible versions (subdirectories)
Expand Down
4 changes: 4 additions & 0 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ else ifeq ($(TARGET),c9s)
OS := c9s
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would remove obsolete conditions to make it more readable

DOCKERFILE ?= Dockerfile.c9s
REGISTRY := quay.io/
else ifeq ($(TARGET),c10s)
OS := c10s
DOCKERFILE ?= Dockerfile.c10s
REGISTRY := quay.io/
else
OS := centos7
DOCKERFILE ?= Dockerfile
Expand Down
2 changes: 2 additions & 0 deletions test-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,8 @@ ct_get_public_image_name() {
public_image_name=$registry/centos7/$base_image_name-${version//./}-centos7:centos7
phracek marked this conversation as resolved.
Show resolved Hide resolved
elif [ "$os" == "c9s" ]; then
public_image_name=$registry/sclorg/$base_image_name-${version//./}-c9s
elif [ "$os" == "c10s" ]; then
public_image_name=$registry/sclorg/$base_image_name-${version//./}-c10s
fi

echo "$public_image_name"
Expand Down
2 changes: 1 addition & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ for dir in ${VERSIONS}; do
# Kept also IMAGE_NAME as some tests might still use that.
IMAGE_NAME="$(docker inspect -f "{{.Config.Labels.name}}" "$IMAGE_ID"):$IMAGE_VERSION"
# shellcheck disable=SC2268
if [ "${OS}" == "centos7" ] || [ "${OS}" == "c9s" ] || [ "${OS}" == "fedora" ]; then
if [ "${OS}" == "centos7" ] || [ "${OS}" == "c9s" ] || [ "${OS}" == "c10s" ] || [ "${OS}" == "fedora" ]; then
phracek marked this conversation as resolved.
Show resolved Hide resolved
export IMAGE_NAME="$REGISTRY$IMAGE_NAME"
else
export IMAGE_NAME
Expand Down
2 changes: 2 additions & 0 deletions tests/failures/check/v0/Dockerfile.c10s
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM quay.io/sclorg/s2i-core-c10s
LABEL name=test-image
Loading