File tree Expand file tree Collapse file tree 3 files changed +53
-0
lines changed
legacy_config_generator/evergreen_config_lib Expand file tree Collapse file tree 3 files changed +53
-0
lines changed Original file line number Diff line number Diff line change @@ -879,6 +879,15 @@ tasks:
879
879
content_type : ${content_type|application/x-gzip}
880
880
- name : rpm-package-build
881
881
commands :
882
+ - command : shell.exec
883
+ type : test
884
+ params :
885
+ working_dir : mongoc
886
+ shell : bash
887
+ script : |-
888
+ set -o errexit
889
+ export IS_PATCH="${is_patch}"
890
+ sh .evergreen/scripts/check_rpm_spec.sh
882
891
- command : shell.exec
883
892
type : test
884
893
params :
Original file line number Diff line number Diff line change @@ -328,6 +328,7 @@ def __init__(
328
328
NamedTask (
329
329
"rpm-package-build" ,
330
330
commands = [
331
+ shell_mongoc ('export IS_PATCH="${is_patch}"\n ' "sh .evergreen/scripts/check_rpm_spec.sh" ),
331
332
shell_mongoc ("sh .evergreen/scripts/build_snapshot_rpm.sh" ),
332
333
s3_put (
333
334
local_file = "rpm.tar.gz" ,
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ #
4
+ # Copyright 2024 MongoDB, Inc.
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+
19
+ set -o errexit
20
+
21
+ #
22
+ # check_rpm_spec.sh - Check if our RPM spec matches downstream's
23
+ #
24
+ # Supported/used environment variables:
25
+ # IS_PATCH If "true", this is an Evergreen patch build.
26
+
27
+
28
+ on_exit () {
29
+ if [ -n " ${SPEC_FILE} " ]; then
30
+ rm -f " ${SPEC_FILE} "
31
+ fi
32
+ }
33
+ trap on_exit EXIT
34
+
35
+ if [ " ${IS_PATCH} " = " true" ]; then
36
+ echo " This is a patch build...skipping RPM spec check"
37
+ exit
38
+ fi
39
+
40
+ SPEC_FILE=$( mktemp --tmpdir -u mongo-c-driver.XXXXXXXX.spec)
41
+ curl --retry 5 https://src.fedoraproject.org/rpms/mongo-c-driver/raw/rawhide/f/mongo-c-driver.spec -sS --max-time 120 --fail --output " ${SPEC_FILE} "
42
+
43
+ diff -q .evergreen/etc/mongo-c-driver.spec " ${SPEC_FILE} " || (echo " Synchronize RPM spec from downstream to fix this failure. See instructions here: https://docs.google.com/document/d/1ItyBC7VN383zNXu3oUOQJYR7adfYI8ECjLMJ5kqA9X8/edit#heading=h.ahdrr3b5xv3" ; exit 1)
You can’t perform that action at this time.
0 commit comments