-
Notifications
You must be signed in to change notification settings - Fork 26
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
Build deb client pkgs #152
Conversation
Are client bits OS independent, so it's sufficient to build them once? Given python is involved, I'd think not? |
well, they have dependencies on python library. If they are dependent on the OS, what do I need to consider in this PR? |
We need to decide on a layout. With https://github.com/theforeman/foreman-packaging/tree/deb/develop we have 2 layouts:
Generally speaking, OS dependent is a safe assumption. In this case Python is very OS dependent since the version changes for every release. In this PR it would be much safer to copy the You could even go a step further and create a common function that's used in |
b3f5384
to
7582391
Compare
Have a look again @ekohl , please :-) |
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.
This looks pretty close. See inline comments.
7582391
to
84e5d0c
Compare
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.
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.
this goes into the right direction, but is not yet sufficient!
with the current structure of the "publishing" workflow, this will land in the "core" repository, not in a dedicated "client" repo, which I think is the intention here?
jenkins-jobs/theforeman.org/pipelines/lib/packaging.groovy
Lines 141 to 161 in 47c3753
if (type == 'plugin' && !pull_request) { | |
suite = 'plugins' | |
component = version | |
release_type = 'release' | |
echo "plugin build without PR: uploading directly to deb/${suite}/${component}" | |
} else if (type == 'plugin' && pull_request) { | |
suite = 'plugins' | |
component = repoowner | |
release_type = 'stage' | |
echo "scratch build: uploading to stagingdeb/${suite}/${component}" | |
} else { | |
suite = os | |
component = "${repoowner}-${version}" | |
release_type = 'stage' | |
echo "scratch build: uploading to stagingdeb/${suite}/${component}" | |
} | |
if (!repos["${suite}-${component}"]) { | |
repos["${suite}-${component}"] = [suite: suite, component: component, deb_paths: [], type: release_type] | |
} | |
repos["${suite}-${component}"].deb_paths.add("${deb_path}/*deb") |
Right now, we have the following repo structure
deb http://deb.theforeman.org/ <OS> <version>
deb http://deb.theforeman.org/ plugins <version>
deb http://stagingdeb.theforeman.org/ <OS> <USER>-<version>
To translate:
- a core/dependencies PR gets published to
http://stagingdeb.theforeman.org/ <OS> theforeman-<version>
on merge - a plugins PR gets published to
deb http://deb.theforeman.org/ plugins <version>
on merge - when pipelines pass, stuff from
http://stagingdeb.theforeman.org/ <OS> theforeman-<version>
is copied over tohttp://deb.theforeman.org/ <OS> <version>
I think we should not stage client stuff (we have no tests for them anyways, and we don't do it right now for RPM either), but make it publish to deb http://deb.theforeman.org/ <OS> <version>-client
directly. If you agree, I can propose a patch to ⬆️ to do the same.
I think the following should do it: diff --git theforeman.org/pipelines/lib/packaging.groovy theforeman.org/pipelines/lib/packaging.groovy
index f5acc9a..ba49378 100644
--- theforeman.org/pipelines/lib/packaging.groovy
+++ theforeman.org/pipelines/lib/packaging.groovy
@@ -160,6 +160,16 @@ def build_deb_package_steps(packages_to_build, version, repoowner = 'theforeman'
component = repoowner
release_type = 'stage'
echo "scratch build: uploading to stagingdeb/${suite}/${component}"
+ } else if (type == 'client' && !pull_request) {
+ suite = "${os}-client"
+ component = version
+ release_type = 'release'
+ echo "plugin build without PR: uploading directly to deb/${suite}/${component}"
+ } else if (type == 'client' && pull_request) {
+ suite = "${os}-client"
+ component = "${repoowner}-${version}"
+ release_type = 'stage'
+ echo "scratch build: uploading to stagingdeb/${suite}/${component}"
} else {
suite = os
component = "${repoowner}-${version}" |
Or: diff --git theforeman.org/pipelines/lib/packaging.groovy theforeman.org/pipelines/lib/packaging.groovy
index f5acc9a..ba49378 100644
--- theforeman.org/pipelines/lib/packaging.groovy
+++ theforeman.org/pipelines/lib/packaging.groovy
@@ -160,6 +160,16 @@ def build_deb_package_steps(packages_to_build, version, repoowner = 'theforeman'
component = repoowner
release_type = 'stage'
echo "scratch build: uploading to stagingdeb/${suite}/${component}"
+ } else if (type == 'client' && !pull_request) {
+ suite = os
+ component = "${version}-client"
+ release_type = 'release'
+ echo "plugin build without PR: uploading directly to deb/${suite}/${component}"
+ } else if (type == 'client' && pull_request) {
+ suite = os
+ component = "${repoowner}-${version}-client"
+ release_type = 'stage'
+ echo "scratch build: uploading to stagingdeb/${suite}/${component}"
} else {
suite = os
component = "${repoowner}-${version}" |
The former patch results in
While the latter results in:
I think I prefer the latter. |
So do I. @sbernhard what do you think? |
84e5d0c
to
d537740
Compare
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.
This looks good to me, but I missed something earlier.
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.
Leaving it to @evgeni to catch things before we break things
I must admit I mostly forgot about this due to the many other tasks. I'd be in favor of getting this live next week. |
Prepare jenkins jobs to build e.g. theforeman/foreman-packaging#6958