Skip to content

Commit ad58dfe

Browse files
authored
CLOUDP-282817 publish RPMs to SUSE zypper repo (#3393)
1 parent dc2c55e commit ad58dfe

File tree

6 files changed

+71
-4
lines changed

6 files changed

+71
-4
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
FROM registry.suse.com/suse/sle15
2+
3+
ARG url
4+
ARG entrypoint
5+
ARG server_version
6+
7+
RUN rpm --import https://pgp.mongodb.com/server-${server_version}.asc
8+
9+
RUN zypper addrepo --gpgcheck "https://repo.mongodb.org/zypper/suse/15/mongodb-org/${server_version}/x86_64/" mongodb
10+
11+
RUN set -eux; \
12+
curl --silent --show-error --fail --location --retry 3 \
13+
--output ${entrypoint}.rpm \
14+
${url}; \
15+
zypper in -y --allow-unsigned-rpm ./${entrypoint}.rpm; \
16+
rm ./${entrypoint}.rpm
17+
18+
RUN mongosh --version
19+
RUN ${entrypoint} --version
20+
21+
ENV ENTRY=${entrypoint}
22+
23+
ENTRYPOINT $ENTRY
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM registry.suse.com/suse/sle15
2+
3+
ARG package
4+
ARG entrypoint
5+
ARG server_version
6+
ARG mongo_package
7+
ARG mongo_repo
8+
9+
RUN rpm --import https://pgp.mongodb.com/server-${server_version}.asc
10+
11+
RUN sudo zypper addrepo --gpgcheck "${mongo_repo}/zypper/suse/15/${mongo_package}/${server_version}/x86_64/" mongodb
12+
13+
RUN set -eux; \
14+
zypper in -y ${package}
15+
16+
RUN ${entrypoint} --version
17+
18+
ENV ENTRY=${entrypoint}
19+
20+
ENTRYPOINT $ENTRY
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM registry.suse.com/suse/sle15
2+
3+
ARG url
4+
ARG entrypoint
5+
6+
RUN set -eux; \
7+
curl --silent --show-error --fail --location --retry 3 \
8+
--output ${entrypoint}.rpm \
9+
${url}; \
10+
zypper in -y --allow-unsigned-rpm ./${entrypoint}.rpm; \
11+
rm ./${entrypoint}.rpm
12+
13+
RUN ${entrypoint} --version
14+
15+
ENV ENTRY=${entrypoint}
16+
17+
ENTRYPOINT $ENTRY

tools/genevergreen/generate/generate.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ var (
4242
}
4343

4444
oses = []string{
45+
"suse15",
4546
"centos8",
4647
"rhel9",
4748
"debian11",
@@ -52,6 +53,7 @@ var (
5253
}
5354
repos = []string{"org", "enterprise"}
5455
postPkgImg = map[string]string{
56+
"suse15": "suse15-rpm",
5557
"centos8": "centos8-rpm",
5658
"rhel9": "rhel9-rpm",
5759
"ubuntu20.04": "ubuntu20.04-deb",
@@ -61,6 +63,7 @@ var (
6163
"debian12": "debian12-deb",
6264
}
6365
newOs = map[string]string{
66+
"suse15": "suse15",
6467
"centos8": "rhel80",
6568
"rhel9": "rhel90",
6669
"ubuntu20.04": "ubuntu2004",

tools/genevergreen/generate/generate_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const (
3131
func TestPublishSnapshotTasks(t *testing.T) {
3232
c := &shrub.Configuration{}
3333
PublishSnapshotTasks(c)
34-
assert.Len(t, c.Tasks, 28)
34+
assert.Len(t, c.Tasks, 30)
3535
commandFound := false
3636
for _, task := range c.Tasks {
3737
for _, c := range task.Commands {
@@ -71,7 +71,7 @@ func TestPublishStableTasks(t *testing.T) {
7171

7272
assert.True(t, commandFound, "expected to find a push command")
7373
assert.Len(t, c.Variants, 4)
74-
assert.Len(t, c.Tasks, 112)
74+
assert.Len(t, c.Tasks, 120)
7575
}
7676

7777
func TestPostPkgMetaTasks(t *testing.T) {
@@ -94,7 +94,7 @@ func TestPostPkgMetaTasks(t *testing.T) {
9494
}
9595
}
9696
assert.Len(t, c.Variants, 1)
97-
assert.Len(t, c.Tasks, 24)
97+
assert.Len(t, c.Tasks, 28)
9898
}
9999

100100
func TestRepoTasks(t *testing.T) {
@@ -115,5 +115,5 @@ func TestRepoTasks(t *testing.T) {
115115
}
116116

117117
assert.Len(t, c.Variants, 4)
118-
assert.Len(t, c.Tasks, 48)
118+
assert.Len(t, c.Tasks, 56)
119119
}

tools/genevergreen/generate/publish.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ var distros = map[string]Platform{
6969
extension: deb,
7070
architectures: []string{x86_64, arm64},
7171
},
72+
"suse15": {
73+
extension: rpm,
74+
architectures: []string{x86_64},
75+
},
7276
}
7377

7478
func newPublishTask(taskName, extension, edition, distro, taskServerVersion, notaryKey, arch string, stable bool, dependency []shrub.TaskDependency) *shrub.Task {

0 commit comments

Comments
 (0)