Skip to content

Commit 6619d60

Browse files
author
Axel von Bertoldi
committed
Merge branch 'avonbertoldi/pulp-push-ci-job' into 'main'
Add CI Jobs to push packages to Pulp Closes #39121 See merge request https://gitlab.com/gitlab-org/gitlab-runner/-/merge_requests/6073 Merged-by: Axel von Bertoldi <avonbertoldi@gitlab.com> Approved-by: Balasankar 'Balu' C <balasankar@gitlab.com> Approved-by: Vishal Tak <vtak@gitlab.com> Approved-by: Georgi N. Georgiev | GitLab <ggeorgiev@gitlab.com> Reviewed-by: Balasankar 'Balu' C <balasankar@gitlab.com>
2 parents a2a4181 + 7a162b3 commit 6619d60

3 files changed

Lines changed: 59 additions & 3 deletions

File tree

.gitlab/ci/release.gitlab-ci.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,19 @@
3636
- mage packagecloud:push deb "$CI_JOB_NAME" "$DIST_FLAVOR"
3737
- mage packagecloud:push rpm "$CI_JOB_NAME" "$DIST_FLAVOR"
3838

39+
.release_pulp:
40+
stage: release
41+
dependencies:
42+
- "package-deb"
43+
- "package-rpm"
44+
- "package-helpers"
45+
before_script:
46+
- ./ci/touch_git
47+
- mage pulp:createConfig
48+
script:
49+
- mage pulp:push deb "$CI_JOB_NAME" "$DIST_FLAVOR"
50+
- mage pulp:push rpm "$CI_JOB_NAME" "$DIST_FLAVOR"
51+
3952
.release_artifacts:
4053
artifacts:
4154
paths:
@@ -85,6 +98,24 @@ bleeding edge packagecloud:
8598
- sles
8699
- opensuse
87100

101+
unstable pulp:
102+
extends:
103+
- .release_pulp
104+
- .rules:release:bleeding-edge
105+
environment:
106+
name: bleeding_edge/pulp
107+
url: https://pulp.gitlab.com/runner/unstable
108+
parallel:
109+
matrix:
110+
- DIST_FLAVOR:
111+
- debian
112+
- ubuntu
113+
- el
114+
- fedora
115+
- amazon
116+
- sles
117+
- opensuse
118+
88119
stable packagecloud:
89120
extends:
90121
- .release_packagecloud
@@ -106,6 +137,27 @@ stable packagecloud:
106137
- sles
107138
- opensuse
108139

140+
stable pulp:
141+
extends:
142+
- .release_pulp
143+
- .rules:release:stable:branch
144+
environment:
145+
name: stable/pulp
146+
url: https://pulp.gitlab.com/runner/gitlab-runner
147+
parallel:
148+
matrix:
149+
- DIST_FLAVOR:
150+
- debian
151+
- ubuntu
152+
- raspbian
153+
- linuxmint
154+
- el
155+
- ol
156+
- fedora
157+
- amazon
158+
- sles
159+
- opensuse
160+
109161
# Image Registry Releases
110162
#########################
111163

magefiles/magefile.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@ func init() {
2929
config.Concurrency = 1
3030
}
3131

32+
level := slog.LevelInfo
3233
if config.Verbose {
33-
slog.SetDefault(slog.New(slog.NewTextHandler(os.Stdout, &slog.HandlerOptions{Level: slog.LevelDebug})))
34+
level = slog.LevelDebug
3435
}
36+
slog.SetDefault(slog.New(slog.NewTextHandler(os.Stdout, &slog.HandlerOptions{Level: level})))
3537
}
3638

3739
// Generate runs go generate for all files in the magefiles directory

magefiles/pulp/push.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ func Push(opts PushOpts) error {
5050
})
5151

5252
if len(releases) == 0 {
53-
return fmt.Errorf("no valid releases to push to")
53+
slog.Info("No releases to push for package type", "package-type", opts.PkgType)
54+
return nil
5455
}
5556

5657
// get the packages to upload...
@@ -60,7 +61,8 @@ func Push(opts PushOpts) error {
6061
}
6162

6263
if len(packages) == 0 {
63-
return fmt.Errorf("no packages to push")
64+
slog.Info("No packages to push")
65+
return nil
6466
}
6567

6668
// the actual repo name for the stable branch is gitlab-runner

0 commit comments

Comments
 (0)