Skip to content

Enable aptly job to publish packages generated by enabled build jobs (#328)

So if either one or more build jobs of different architectures are enabled, packages generated by them will be published by the aptly job instead of build job packages (amd64) being the only one that is being published.

It enables that by adding all build jobs of different architectures with optional: true keyword for each one of them in the needs keyword of aptly job so if at least one of them is enabled, the aptly job will work fine. (without optional: true, if one of the build jobs is disabled, the aptly job will not run)

This patch results in a behavior that didn't exist before which is in the case all build jobs are disabled and the SALSA_CI_DISABLE_APTLY variable is set to any value other than yes, 1, and true, the aptly job will run and fail.

What happens without this patch is that if the build job is disabled, the aptly job will also be disabled as the build job is not optional.

It seems Salsa/GitLab doesn't have OR syntax in the needs keyword such that if either one or more jobs are enabled, the job should be enabled, otherwise it should be disabled.

If such a feature exists or has been added in the future, It would be better to use it.

Related resource: https://forum.gitlab.com/t/is-there-a-way-to-use-or-condition-with-needs-in-gitlab-ci-job/70393/3

The commit author's name and email is added to CONTRIBUTORS ‎file.

Closes #328 (closed)

Edited by Ahmed Siam

Merge request reports

Loading