Skip to content
Closed
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
28 changes: 14 additions & 14 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ fail:
tags:
- terraform

.terraform/openstack:
.terraform/gcp:
extends: .base
tags:
- terraform/openstack
- terraform/gcp

stream9-qcow2-x86_64:
stage: test
extends: .terraform/openstack
extends: .terraform/gcp
variables:
RUNNER: rhos-01/fedora-43-x86_64
RUNNER: gcp/fedora-43-x86_64
rules:
- changes:
- Schutzfile
Expand Down Expand Up @@ -81,9 +81,9 @@ stream9-qcow2-aarch64:

stream10-qcow2-x86_64:
stage: test
extends: .terraform/openstack
extends: .terraform/gcp
variables:
RUNNER: rhos-01/fedora-43-x86_64
RUNNER: gcp/fedora-43-x86_64
rules:
- changes:
- Schutzfile
Expand Down Expand Up @@ -113,9 +113,9 @@ stream10-qcow2-aarch64:

stream10-installer-x86_64:
stage: test
extends: .terraform/openstack
extends: .terraform/gcp
variables:
RUNNER: rhos-01/fedora-43-x86_64-large
RUNNER: gcp/fedora-43-x86_64
rules:
- changes:
- Schutzfile
Expand Down Expand Up @@ -207,9 +207,9 @@ rhel-10-gcp-x86_64:

rhel-10-installer-x86_64:
stage: test
extends: .terraform/openstack
extends: .terraform/gcp
variables:
RUNNER: rhos-01/fedora-43-x86_64-large
RUNNER: gcp/fedora-43-x86_64
SUBSCRIPTION_NEEDED: true
RH_REGISTRY_LOGIN_NEEDED: true
rules:
Expand All @@ -230,9 +230,9 @@ rhel-10-installer-x86_64:

rhel-10-qcow2-x86_64:
stage: test
extends: .terraform/openstack
extends: .terraform/gcp
variables:
RUNNER: rhos-01/fedora-43-x86_64
RUNNER: gcp/fedora-43-x86_64
SUBSCRIPTION_NEEDED: true
RH_REGISTRY_LOGIN_NEEDED: true
rules:
Expand Down Expand Up @@ -268,9 +268,9 @@ rhel-10-qcow2-aarch64:

hummingbird-qcow2-x86_64:
stage: test
extends: .terraform/openstack
extends: .terraform/gcp
variables:
RUNNER: rhos-01/fedora-43-x86_64
RUNNER: gcp/fedora-43-x86_64
rules:
- changes:
- Schutzfile
Expand Down
2 changes: 1 addition & 1 deletion schutzbot/terraform
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3545c5e293c8677f8f48b9a1e4cf6131bf288c24
a11e597746a09993a0cb93151ab610535f772435
12 changes: 6 additions & 6 deletions test/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ images:
runner: aws/fedora-43
containerfiles:
- containerfile: stream9-qcow2
runner: rhos-01/fedora-43
runner: gcp/fedora-43
image-type: qcow2
arches: [x86_64]
- containerfile: stream9-qcow2
Expand All @@ -14,14 +14,14 @@ images:
runner: aws/fedora-43
containerfiles:
- containerfile: stream10-qcow2
runner: rhos-01/fedora-43
runner: gcp/fedora-43
image-type: qcow2
arches: [x86_64]
- containerfile: stream10-qcow2
image-type: qcow2
arches: [aarch64]
- containerfile: stream10-installer
runner: rhos-01/fedora-43-{arch}-large
runner: gcp/fedora-43
image-type: bootc-generic-iso
payload-containerfile: stream10-qcow2
arches: [x86_64]
Expand All @@ -43,12 +43,12 @@ images:
image-type: gce
arches: [x86_64]
- containerfile: rhel-10-installer
runner: rhos-01/fedora-43-{arch}-large
runner: gcp/fedora-43
image-type: bootc-generic-iso
payload-containerfile: rhel-10-qcow2
arches: [x86_64]
- containerfile: rhel-10-qcow2
runner: rhos-01/fedora-43
runner: gcp/fedora-43
image-type: qcow2
arches: [x86_64]
- containerfile: rhel-10-qcow2
Expand All @@ -59,7 +59,7 @@ images:
runner: aws/fedora-43
containerfiles:
- containerfile: hummingbird-qcow2
runner: rhos-01/fedora-43
runner: gcp/fedora-43
image-type: qcow2
arches: [x86_64]
- containerfile: hummingbird-qcow2
Expand Down
8 changes: 4 additions & 4 deletions test/generate_ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ def build_job(cntfile_name, image_type, arch, runner_name, distro_id, change_rul
script.append("test/boot.sh")

extends = ".terraform"
if runner_name.startswith("rhos-01/"):
extends = ".terraform/openstack"
if runner_name.startswith("gcp/"):
extends = ".terraform/gcp"

variables = {
"RUNNER": runner,
Expand Down Expand Up @@ -164,9 +164,9 @@ def generate_ci_config(config, cntfile_cache, repo_root):
"extends": ".base",
"tags": ["terraform"],
},
".terraform/openstack": {
".terraform/gcp": {
"extends": ".base",
"tags": ["terraform/openstack"],
"tags": ["terraform/gcp"],
},
}

Expand Down
56 changes: 13 additions & 43 deletions test/test_generate_ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,60 +369,30 @@ def test_build_change_rules(tmp_path, case):
),
pytest.param(
dict(
cf_name="rhel-10-qcow2",
cf_name="stream10-qcow2",
image_type="qcow2",
arch="x86_64",
runner="rhos-01/rhel-10.1-ga",
distro_id="rhel-10",
change_rules=["rhel-10-qcow2", "qcow2-amd64/**/*", "test/**/*", "Schutzfile"],
runner="gcp/fedora-43",
distro_id="centos-10",
change_rules=["stream10-qcow2", "qcow2-amd64/**/*", "test/**/*", "Schutzfile"],
payload_name=None,
subscription_needed=False,
rh_registry_login_needed=False,
expected={
"stage": "test",
"extends": ".terraform/openstack",
"extends": ".terraform/gcp",
"variables": {
"RUNNER": "rhos-01/rhel-10.1-ga-x86_64",
"RUNNER": "gcp/fedora-43-x86_64",
},
"rules": [{"changes": ["rhel-10-qcow2", "qcow2-amd64/**/*", "test/**/*", "Schutzfile"]}],
"rules": [{"changes": ["stream10-qcow2", "qcow2-amd64/**/*", "test/**/*", "Schutzfile"]}],
"script": [
"CONTAINER_REF=$(test/get-container.sh rhel-10-qcow2)",
'test/build.sh "$CONTAINER_REF" qcow2 x86_64 rhel-10',
"CONTAINER_REF=$(test/get-container.sh stream10-qcow2)",
'test/build.sh "$CONTAINER_REF" qcow2 x86_64 centos-10',
"test/boot.sh",
],
},
),
id="simple-qcow2",
),
pytest.param(
dict(
cf_name="rhel-10-installer",
image_type="bootc-generic-iso",
arch="x86_64",
runner="rhos-01/rhel-10.1-ga-{arch}-large",
distro_id="rhel-10",
change_rules=["rhel-10-installer", "rhel-10-qcow2", "qcow2-amd64/**/*", "test/**/*", "Schutzfile"],
payload_name="rhel-10-qcow2",
subscription_needed=True,
rh_registry_login_needed=True,
expected={
"stage": "test",
"extends": ".terraform/openstack",
"variables": {
"RUNNER": "rhos-01/rhel-10.1-ga-x86_64-large",
"SUBSCRIPTION_NEEDED": True,
"RH_REGISTRY_LOGIN_NEEDED": True,
},
"rules": [{"changes": ["rhel-10-installer", "rhel-10-qcow2", "qcow2-amd64/**/*", "test/**/*", "Schutzfile"]}],
"script": [
"CONTAINER_REF=$(test/get-container.sh rhel-10-installer)",
"PAYLOAD_REF=$(test/get-container.sh rhel-10-qcow2)",
'test/build.sh "$CONTAINER_REF" bootc-generic-iso x86_64 rhel-10 "$PAYLOAD_REF"',
"test/boot.sh",
],
},
),
id="installer-with-payload",
id="simple-gcp",
),
],
)
Expand Down Expand Up @@ -482,9 +452,9 @@ def test_generate_ci_config_top_level_keys(tmp_path):
assert ".terraform" in ci
assert ci[".terraform"]["extends"] == ".base"
assert ci[".terraform"]["tags"] == ["terraform"]
assert ".terraform/openstack" in ci
assert ci[".terraform/openstack"]["extends"] == ".base"
assert ci[".terraform/openstack"]["tags"] == ["terraform/openstack"]
assert ".terraform/gcp" in ci
assert ci[".terraform/gcp"]["extends"] == ".base"
assert ci[".terraform/gcp"]["tags"] == ["terraform/gcp"]


def test_generate_ci_config_generates_job_per_arch(tmp_path):
Expand Down
Loading