Skip to content

Commit b143caa

Browse files
committed
config.yaml: allow stream-level source config URL overrides
For openshift/os#1775, we want the new el-only streams to build from coreos/rhel-coreos-config. But for the older OCP releases, we want to continue building from openshift/os to minimize disruption. Make the source config URL configurable at the stream level to allow this. This matches the source config ref.
1 parent 3324dfe commit b143caa

14 files changed

+40
-32
lines changed

docs/config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ streams:
5353
# OPTIONAL: set a stream as the default one
5454
# This will be the default stream for jobs that take a 'STREAMS' parameter
5555
default: true
56+
# OPTIONAL: override source config URL to use for this stream
57+
source_config_url: https://github.com/jlebon/fedora-coreos-config
5658
# OPTIONAL: override source config ref to use for this stream
5759
source_config_ref: main
5860
# OPTIONAL: override OS variant to use for this stream

jobs/build-arch.Jenkinsfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,19 +153,19 @@ lock(resource: "build-${params.STREAM}-${basearch}") {
153153
// add any additional root CA cert before we do anything that fetches
154154
pipeutils.addOptionalRootCA()
155155

156-
def ref = pipeutils.get_source_config_ref_for_stream(pipecfg, params.STREAM)
156+
def (url, ref) = pipeutils.get_source_config_for_stream(pipecfg, params.STREAM)
157157
def src_config_commit
158158
if (params.SRC_CONFIG_COMMIT) {
159159
src_config_commit = params.SRC_CONFIG_COMMIT
160160
} else {
161-
src_config_commit = shwrapCapture("git ls-remote ${pipecfg.source_config.url} refs/heads/${ref} | cut -d \$'\t' -f 1")
161+
src_config_commit = shwrapCapture("git ls-remote ${url} refs/heads/${ref} | cut -d \$'\t' -f 1")
162162
}
163163

164164
stage('Init') {
165165
def yumrepos = pipecfg.source_config.yumrepos ? "--yumrepos ${pipecfg.source_config.yumrepos}" : ""
166166
def variant = stream_info.variant ? "--variant ${stream_info.variant}" : ""
167167
shwrap("""
168-
cosa init --force --branch ${ref} --commit=${src_config_commit} ${yumrepos} ${variant} ${pipecfg.source_config.url}
168+
cosa init --force --branch ${ref} --commit=${src_config_commit} ${yumrepos} ${variant} ${url}
169169
""")
170170
}
171171

jobs/build.Jenkinsfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,15 +173,15 @@ lock(resource: "build-${params.STREAM}") {
173173
// add any additional root CA cert before we do anything that fetches
174174
pipeutils.addOptionalRootCA()
175175

176-
def ref = pipeutils.get_source_config_ref_for_stream(pipecfg, params.STREAM)
177-
def src_config_commit = shwrapCapture("git ls-remote ${pipecfg.source_config.url} refs/heads/${ref} | cut -d \$'\t' -f 1")
176+
def (url, ref) = pipeutils.get_source_config_for_stream(pipecfg, params.STREAM)
177+
def src_config_commit = shwrapCapture("git ls-remote ${url} refs/heads/${ref} | cut -d \$'\t' -f 1")
178178

179179
stage('Init') {
180180
def yumrepos = pipecfg.source_config.yumrepos ? "--yumrepos ${pipecfg.source_config.yumrepos}" : ""
181181
def yumrepos_ref = pipecfg.source_config.yumrepos_ref ? "--yumrepos-branch ${pipecfg.source_config.yumrepos_ref}" : ""
182182
def variant = stream_info.variant ? "--variant ${stream_info.variant}" : ""
183183
shwrap("""
184-
cosa init --force --branch ${ref} --commit=${src_config_commit} ${yumrepos} ${yumrepos_ref} ${variant} ${pipecfg.source_config.url}
184+
cosa init --force --branch ${ref} --commit=${src_config_commit} ${yumrepos} ${yumrepos_ref} ${variant} ${url}
185185
""")
186186

187187
// for now, just use the PVC to keep cache.qcow2 in a stream-specific dir

jobs/cloud-replicate.Jenkinsfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ lock(resource: "cloud-replicate-${params.VERSION}") {
9090

9191
// Fetch metadata files for the build we are interested in
9292
stage('Fetch Metadata') {
93-
def ref = pipeutils.get_source_config_ref_for_stream(pipecfg, params.STREAM)
93+
def (url, ref) = pipeutils.get_source_config_for_stream(pipecfg, params.STREAM)
9494
def variant = stream_info.variant ? "--variant ${stream_info.variant}" : ""
9595
pipeutils.shwrapWithAWSBuildUploadCredentials("""
96-
cosa init --branch ${ref} ${variant} ${pipecfg.source_config.url}
96+
cosa init --branch ${ref} ${variant} ${url}
9797
cosa buildfetch --build=${params.VERSION} \
9898
--arch=all --url=s3://${s3_stream_dir}/builds \
9999
--aws-config-file \${AWS_BUILD_UPLOAD_CONFIG}

jobs/debug-pod.Jenkinsfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,19 +87,19 @@ cosaPod(cpu: "${ncpus}",
8787
// add any additional root CA cert before we do anything that fetches
8888
pipeutils.addOptionalRootCA()
8989

90-
def ref = pipeutils.get_source_config_ref_for_stream(pipecfg, params.STREAM)
90+
def (url, ref) = pipeutils.get_source_config_for_stream(pipecfg, params.STREAM)
9191
def src_config_commit
9292
if (params.SRC_CONFIG_COMMIT) {
9393
src_config_commit = params.SRC_CONFIG_COMMIT
9494
} else {
95-
src_config_commit = shwrapCapture("git ls-remote ${pipecfg.source_config.url} refs/heads/${ref} | cut -d \$'\t' -f 1")
95+
src_config_commit = shwrapCapture("git ls-remote ${url} refs/heads/${ref} | cut -d \$'\t' -f 1")
9696
}
9797

9898
stage('Init') {
9999
def yumrepos = pipecfg.source_config.yumrepos ? "--yumrepos ${pipecfg.source_config.yumrepos}" : ""
100100
def variant = stream_info.variant ? "--variant ${stream_info.variant}" : ""
101101
shwrap("""
102-
cosa init --force --branch ${ref} --commit=${src_config_commit} ${yumrepos} ${variant} ${pipecfg.source_config.url}
102+
cosa init --force --branch ${ref} --commit=${src_config_commit} ${yumrepos} ${variant} ${url}
103103
""")
104104
}
105105

jobs/fix-build.Jenkinsfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ lock(resource: "sign-${params.VERSION}") {
9494

9595
// Fetch metadata files for the build we are interested in
9696
stage('Fetch Metadata') {
97-
def ref = pipeutils.get_source_config_ref_for_stream(pipecfg, params.STREAM)
97+
def (url, ref) = pipeutils.get_source_config_for_stream(pipecfg, params.STREAM)
9898
def variant = stream_info.variant ? "--variant ${stream_info.variant}" : ""
9999
def arch_args = basearches.collect{"--arch=$it"}
100100
pipeutils.shwrapWithAWSBuildUploadCredentials("""
101-
cosa init --branch ${ref} ${variant} ${pipecfg.source_config.url}
101+
cosa init --branch ${ref} ${variant} ${url}
102102
cosa buildfetch --build=${params.VERSION} \
103103
${arch_args.join(' ')} --artifact=all --url=s3://${s3_stream_dir}/builds \
104104
--aws-config-file \${AWS_BUILD_UPLOAD_CONFIG}

jobs/kola-aws.Jenkinsfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ cosaPod(memory: "512Mi", kvm: false,
5959
}
6060
withCredentials([file(variable: 'AWS_CONFIG_FILE',
6161
credentialsId: 'aws-build-upload-config')]) {
62-
def ref = pipeutils.get_source_config_ref_for_stream(pipecfg, params.STREAM)
62+
def (url, ref) = pipeutils.get_source_config_for_stream(pipecfg, params.STREAM)
6363
def variant = stream_info.variant ? "--variant ${stream_info.variant}" : ""
6464
shwrap("""
65-
cosa init --branch ${ref} ${commitopt} ${variant} ${pipecfg.source_config.url}
65+
cosa init --branch ${ref} ${commitopt} ${variant} ${url}
6666
time -v cosa buildfetch --artifact=ostree --build=${params.VERSION} \
6767
--arch=${params.ARCH} --url=s3://${s3_stream_dir}/builds
6868
""")

jobs/kola-azure.Jenkinsfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ cosaPod(memory: "${cosa_memory_request_mb}Mi", kvm: false,
6868
// Grab the metadata. Also grab the image so we can upload it.
6969
withCredentials([file(variable: 'AWS_CONFIG_FILE',
7070
credentialsId: 'aws-build-upload-config')]) {
71-
def ref = pipeutils.get_source_config_ref_for_stream(pipecfg, params.STREAM)
71+
def (url, ref) = pipeutils.get_source_config_for_stream(pipecfg, params.STREAM)
7272
def variant = stream_info.variant ? "--variant ${stream_info.variant}" : ""
7373
shwrap("""
74-
cosa init --branch ${ref} ${commitopt} ${variant} ${pipecfg.source_config.url}
74+
cosa init --branch ${ref} ${commitopt} ${variant} ${url}
7575
time -v cosa buildfetch --build=${params.VERSION} --arch=${params.ARCH} \
7676
--url=s3://${s3_stream_dir}/builds --artifact=azure
7777
""")

jobs/kola-gcp.Jenkinsfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ cosaPod(memory: "512Mi", kvm: false,
5959
}
6060
withCredentials([file(variable: 'AWS_CONFIG_FILE',
6161
credentialsId: 'aws-build-upload-config')]) {
62-
def ref = pipeutils.get_source_config_ref_for_stream(pipecfg, params.STREAM)
62+
def (url, ref) = pipeutils.get_source_config_for_stream(pipecfg, params.STREAM)
6363
def variant = stream_info.variant ? "--variant ${stream_info.variant}" : ""
6464
shwrap("""
65-
cosa init --branch ${ref} ${commitopt} ${variant} ${pipecfg.source_config.url}
65+
cosa init --branch ${ref} ${commitopt} ${variant} ${url}
6666
time -v cosa buildfetch --artifact=ostree --build=${params.VERSION} \
6767
--arch=${params.ARCH} --url=s3://${s3_stream_dir}/builds
6868
""")

jobs/kola-kubernetes.Jenkinsfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ cosaPod(memory: "512Mi", kvm: false,
5454
}
5555
withCredentials([file(variable: 'AWS_CONFIG_FILE',
5656
credentialsId: 'aws-build-upload-config')]) {
57-
def ref = pipeutils.get_source_config_ref_for_stream(pipecfg, params.STREAM)
57+
def (url, ref) = pipeutils.get_source_config_for_stream(pipecfg, params.STREAM)
5858
def variant = stream_info.variant ? "--variant ${stream_info.variant}" : ""
5959
shwrap("""
60-
cosa init --branch ${ref} ${commitopt} ${variant} ${pipecfg.source_config.url}
60+
cosa init --branch ${ref} ${commitopt} ${variant} ${url}
6161
cosa buildfetch --build=${params.VERSION} \
6262
--arch=${params.ARCH} --url=s3://${s3_stream_dir}/builds
6363
""")

0 commit comments

Comments
 (0)