-
Notifications
You must be signed in to change notification settings - Fork 55
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
fcos-release-notes: add job for generating release notes #261
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
@Library('github.com/coreos/coreos-ci-lib@master') _ | ||
|
||
config_repo = "coreos/fedora-coreos-config" | ||
releng_script_repo = "coreos/fedora-coreos-releng-automation" | ||
branches = [ | ||
"testing-devel" | ||
"next-devel" | ||
] | ||
botCreds = "github-coreosbot-token" | ||
|
||
cosaPod { | ||
// set up fedora-coreos-releng-automation repository | ||
shwrap(""" | ||
mkdir fcos-releng | ||
git clone --branch master https://github.com/${releng_script_repo} fcos-releng" | ||
git config --global user.name "CoreOS Bot" | ||
git config --global user.email "coreosbot@fedoraproject.org" | ||
""") | ||
|
||
parallel branches.collectEntries { branch -> [branch, { | ||
// build 'release-notes.yaml' using 'release-notes.d/' under testing-devel and next-devel | ||
stage("Build 'release-notes.yaml'") { | ||
shwrap("mkdir ${branch}") | ||
|
||
dir(branch) { | ||
shwrap("cosa init --branch ${branch} https://github.com/${config_repo}") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All I needed was a FCOS config repo so no hard need for a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, let's just use |
||
} | ||
|
||
// generate 'release-notes.yaml' from yaml snippets under 'config/release-notes.d/' | ||
dir("fcos-releng") { | ||
shwrap("python3 coreos-release-note-generator/release-note-generator.py build \ | ||
--config-dir ~/${branch}/src/config \ | ||
--output-dir ~/${branch}/src/config") | ||
} | ||
} | ||
|
||
// delete all 'release-notes.d/*.yaml' files for next release version | ||
stage("Clean up 'release-notes.d/'") { | ||
shwrap(""" | ||
cd ${branch}/src/config | ||
git checkout ${branch} | ||
rm -rf release-notes.d/*.yaml | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we probably need to use |
||
git commit -am "release-notes.d: clean up release-notes.d for next release" | ||
""") | ||
withCredentials([usernamePassword(credentialsId: botCreds, | ||
usernameVariable: 'GHUSER', | ||
passwordVariable: 'GHTOKEN')]) { | ||
// should gracefully handle race conditions here | ||
sh("git push https://\${GHUSER}:\${GHTOKEN}@github.com/${config_repo} ${branch}") | ||
Comment on lines
+48
to
+49
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. doing a |
||
} | ||
} | ||
|
||
// push 'release-notes.yaml' from testing-devel and next-devel to testing and next branch correspondingly | ||
stage("Push 'release-notes.yaml'") { | ||
target_branch = branch.replace("-devel", "") | ||
shwrap(""" | ||
cd ${branch}/src/config | ||
git checkout ${target_branch} | ||
git add release-notes.yaml | ||
git commit -am "release-notes.yaml: generate latest release notes" | ||
""") | ||
withCredentials([usernamePassword(credentialsId: botCreds, | ||
usernameVariable: 'GHUSER', | ||
passwordVariable: 'GHTOKEN')]) { | ||
// should gracefully handle race conditions here | ||
sh("git push https://\${GHUSER}:\${GHTOKEN}@github.com/${config_repo} ${target_branch}") | ||
} | ||
} | ||
}] } | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something in my mind keeps telling me this is not correct / desired. Since
Jenkinsfile
primarily used only usedcosa
, and not sure if I could usebotCreds
andaws-fcos-builds-bot
here. The logic comes frombump-lockfile.Jenkinsfile
andsync-stream-metadata.Jenkinsfile
.Could you sanity check please? @jlebon
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still trying to understand how everything fits together (so the next statements might not fit with the intended design), but ISTM like we shouldn't do anything related to release notes as part of the main build pipeline. That should instead be in the release job (or a job triggered by the release job), and only on production streams.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. Discussed at #261 (comment).