Skip to content

Commit ea2a42d

Browse files
richardsamuelsEvergreen Agent
authored and
Evergreen Agent
committed
SERVER-55626 Extract shell scripts from evergreen.yml part 1
1 parent c056a09 commit ea2a42d

10 files changed

+216
-124
lines changed

etc/evergreen.yml

+85-124
Original file line numberDiff line numberDiff line change
@@ -3012,16 +3012,18 @@ tasks:
30123012
content_type: application/gzip
30133013
display_name: Binaries
30143014

3015-
- command: shell.exec
3015+
- command: expansions.write
3016+
params:
3017+
file: expansions.yml
3018+
- command: subprocess.exec
30163019
type: test
30173020
params:
3018-
working_dir: src
3019-
shell: bash
3020-
script: |
3021-
set -o errexit
3022-
set -o verbose
3023-
${activate_virtualenv}
3024-
$python buildscripts/idl/gen_all_feature_flag_list.py --import-dir src --import-dir src/mongo/db/modules/enterprise/src
3021+
binary: bash
3022+
args:
3023+
- "src/evergreen/gen_feature_flags.sh"
3024+
env:
3025+
python: ${python}
3026+
workdir: ${workdir}
30253027

30263028
- command: archive.targz_pack
30273029
params:
@@ -3150,13 +3152,17 @@ tasks:
31503152

31513153
- name: libdeps_graph_linting
31523154
commands:
3153-
- command: shell.exec
3155+
- command: expansions.write
31543156
params:
3155-
working_dir: src
3156-
shell: bash
3157-
script: |
3158-
${activate_virtualenv}
3159-
python -m pip install -r etc/pip/libdeps-requirements.txt
3157+
file: expansions.yml
3158+
- command: subprocess.exec
3159+
params:
3160+
binary: bash
3161+
args:
3162+
- "src/evergreen/libdeps_setup.sh"
3163+
env:
3164+
python: ${python}
3165+
workdir: ${workdir}
31603166

31613167
- func: "scons compile"
31623168
vars:
@@ -3168,19 +3174,14 @@ tasks:
31683174
targets:
31693175
generate-libdeps-graph
31703176

3171-
- command: shell.exec
3177+
- command: subprocess.exec
31723178
params:
3173-
working_dir: src
3174-
shell: bash
3175-
script: |
3176-
set -o errexit
3177-
set -o verbose
3178-
3179-
${activate_virtualenv}
3180-
GRAPH_FILE=$(find build -name "libdeps.graphml")
3181-
python buildscripts/libdeps/gacli.py --graph-file $GRAPH_FILE > results.txt
3182-
gzip $GRAPH_FILE
3183-
mv $GRAPH_FILE.gz .
3179+
binary: bash
3180+
args:
3181+
- "src/evergreen/libdeps_run.sh"
3182+
env:
3183+
python: ${python}
3184+
workdir: ${workdir}
31843185

31853186
- command: s3.put
31863187
params:
@@ -3370,42 +3371,17 @@ tasks:
33703371

33713372
- name: embedded_sdk_build_cdriver
33723373
commands:
3373-
- command: shell.exec
3374+
- command: expansions.write
33743375
params:
3375-
shell: bash
3376-
script: |
3377-
set -o errexit
3378-
set -o verbose
3379-
3380-
VERSION=${version}
3381-
WORKDIR=${workdir}
3382-
3383-
# build in a different directory then we run tests so that we can verify that the linking
3384-
# of tests are not relying any built in absolute paths
3385-
FINAL_PREFIX=$WORKDIR/src/build/mongo-embedded-sdk-$VERSION
3386-
BUILD_PREFIX=$FINAL_PREFIX-tmp
3387-
3388-
rm -rf mongo-c-driver
3389-
3390-
# NOTE: If you change the C Driver version here, also change the substitution in the CocoaPod podspec below in the apple builder.
3391-
git clone --branch r1.13 --depth 1 https://github.com/mongodb/mongo-c-driver.git
3392-
cd mongo-c-driver
3393-
3394-
# Fixup VERSION so we don't end up with -dev on it. Remove this once we are building a stable version and CDRIVER-2861 is resolved.
3395-
cp -f VERSION_RELEASED VERSION_CURRENT
3396-
3397-
trap "cat CMakeFiles/CMakeOutput.log" EXIT
3398-
export ${compile_env|}
3399-
${cmake_path|/opt/cmake/bin/cmake} -DCMAKE_INSTALL_PREFIX=$BUILD_PREFIX -DENABLE_SHM_COUNTERS=OFF -DENABLE_SNAPPY=OFF -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF -DENABLE_TESTS=OFF -DENABLE_EXAMPLES=OFF -DENABLE_STATIC=OFF -DCMAKE_OSX_DEPLOYMENT_TARGET=${cdriver_cmake_osx_deployment_target|} ${cdriver_cmake_flags}
3400-
trap - EXIT # cancel the previous trap '...' EXIT
3401-
make install VERBOSE=1
3402-
3403-
# TODO: Remove this when we upgrade to a version of the C driver that has CDRIVER-2854 fixed.
3404-
mkdir -p $BUILD_PREFIX/share/doc/mongo-c-driver
3405-
cp COPYING $BUILD_PREFIX/share/doc/mongo-c-driver
3406-
cp THIRD_PARTY_NOTICES $BUILD_PREFIX/share/doc/mongo-c-driver
3407-
3408-
mv $BUILD_PREFIX $FINAL_PREFIX
3376+
file: expansions.yml
3377+
- command: subprocess.exec
3378+
params:
3379+
binary: bash
3380+
args:
3381+
- "src/evergreen/embedded_sdk_build_cdriver.sh"
3382+
env:
3383+
python: ${python}
3384+
workdir: ${workdir}
34093385

34103386
- name: embedded_sdk_install_dev
34113387
commands:
@@ -3429,24 +3405,17 @@ tasks:
34293405
34303406
- name: embedded_sdk_s3_put
34313407
commands:
3432-
# Not using archive.targz_pack here because I can't get it to work.
3433-
- command: shell.exec
3408+
- command: expansions.write
34343409
params:
3435-
working_dir: "src/build"
3436-
shell: bash
3437-
script: |
3438-
set -o errexit
3439-
set -o verbose
3440-
3441-
cat <<EOF > mongo-embedded-sdk-${version}/README-Licenses.txt
3442-
The software accompanying this file is Copyright (C) 2018 MongoDB, Inc. and
3443-
is licensed to you on the terms set forth in the following files:
3444-
- mongo-c-driver: share/doc/mongo-c-driver/COPYING
3445-
- mongo_embedded: share/doc/mongo_embedded/LICENSE-Embedded.txt
3446-
- mongoc_embedded: share/doc/mongo_embedded/LICENSE-Embedded.txt
3447-
EOF
3448-
3449-
tar cfvz embedded-sdk.tgz mongo-embedded-sdk-${version}
3410+
file: expansions.yml
3411+
- command: subprocess.exec
3412+
params:
3413+
binary: bash
3414+
args:
3415+
- "src/evergreen/embedded_sdk_s3_tar.sh"
3416+
env:
3417+
python: ${python}
3418+
workdir: ${workdir}
34503419

34513420
# Upload it so we can download from EVG.
34523421
- command: s3.put
@@ -3478,16 +3447,18 @@ tasks:
34783447

34793448
- name: embedded_sdk_tests_s3_put
34803449
commands:
3481-
# Not using archive.targz_pack here because I can't get it to work.
3482-
- command: shell.exec
3450+
- command: expansions.write
34833451
params:
3484-
working_dir: "src/build"
3485-
shell: bash
3486-
script: |
3487-
set -o errexit
3488-
set -o verbose
3489-
3490-
tar cfvz embedded-sdk-tests.tgz mongo-embedded-sdk-${version}
3452+
file: expansions.yml
3453+
- command: subprocess.exec
3454+
type: test
3455+
params:
3456+
binary: bash
3457+
args:
3458+
- "src/evergreen/embedded_sdk_s3_tar.sh"
3459+
env:
3460+
python: ${python}
3461+
workdir: ${workdir}
34913462

34923463
# Upload it so we can download from EVG.
34933464
- command: s3.put
@@ -7101,36 +7072,27 @@ tasks:
71017072
patchable: false
71027073
commands:
71037074
- func: "do non-compile setup"
7104-
- command: shell.exec
7075+
- command: expansions.write
7076+
params:
7077+
file: expansions.yml
7078+
- command: subprocess.exec
71057079
type: setup
71067080
params:
7107-
working_dir: src
7081+
binary: bash
71087082
silent: true
7109-
shell: bash
7110-
script: |
7111-
# Create the Evergreen API credentials
7112-
cat > .restconfig.json <<END_OF_CREDS
7113-
{
7114-
"baseurl": "${blackduck_url}",
7115-
"username": "${blackduck_username}",
7116-
"password": "${blackduck_password}",
7117-
"debug": false,
7118-
"insecure" : false
7119-
}
7120-
END_OF_CREDS
7121-
- command: shell.exec
7122-
type: test
7083+
args:
7084+
- "src/evergreen/blackduck_setup.sh"
7085+
env:
7086+
python: ${python}
7087+
workdir: ${workdir}
7088+
- command: subprocess.exec
71237089
params:
7124-
working_dir: src/
7125-
shell: bash
7126-
script: |
7127-
set -o errexit
7128-
set -o verbose
7129-
7130-
# activate the virtualenv if it has been set up
7131-
${activate_virtualenv}
7132-
7133-
python buildscripts/blackduck_hub.py -v scan_and_report --build_logger=mci.buildlogger --build_logger_task_id=${task_id} --report_file=report.json
7090+
binary: bash
7091+
args:
7092+
- "src/evergreen/blackduck_hub.sh"
7093+
env:
7094+
python: ${python}
7095+
workdir: ${workdir}
71347096

71357097
- name: tla_plus
71367098
commands:
@@ -7195,18 +7157,17 @@ tasks:
71957157
task_compile_flags: >-
71967158
--separate-debug
71977159
--legacy-tarball
7198-
- command: shell.exec
7160+
- command: expansions.write
71997161
params:
7200-
working_dir: src
7201-
shell: bash
7202-
script: |
7203-
set -o errexit
7204-
set -o verbose
7205-
7206-
if [ $(find . -name mongocryptd${exe} | wc -l) -eq 1 ] ; then
7207-
# Validate that this build_variant is listed as a known enterprise task for mongocryptd
7208-
PATH=$PATH:$HOME $python ../buildscripts/validate_mongocryptd.py --variant "${build_variant}" ../etc/evergreen.yml
7209-
fi
7162+
file: expansions.yml
7163+
- command: subprocess.exec
7164+
params:
7165+
binary: bash
7166+
args:
7167+
- "src/evergreen/package.sh"
7168+
env:
7169+
python: ${python}
7170+
workdir: ${workdir}
72107171
- command: s3.put
72117172
params:
72127173
aws_key: ${aws_key}

evergreen/blackduck_hub.sh

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
2+
. "$DIR/prelude.sh"
3+
4+
cd src
5+
6+
set -o errexit
7+
set -o verbose
8+
9+
# activate the virtualenv if it has been set up
10+
activate_venv
11+
12+
python buildscripts/blackduck_hub.py -v scan_and_report --build_logger=mci.buildlogger --build_logger_task_id=${task_id} --report_file=report.json

evergreen/blackduck_setup.sh

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
2+
. "$DIR/prelude.sh"
3+
4+
cd src
5+
6+
# Create the Evergreen API credentials
7+
cat >.restconfig.json <<END_OF_CREDS
8+
{
9+
"baseurl": "${blackduck_url}",
10+
"username": "${blackduck_username}",
11+
"password": "${blackduck_password}",
12+
"debug": false,
13+
"insecure" : false
14+
}
15+
END_OF_CREDS
+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
2+
. "$DIR/prelude.sh"
3+
4+
set -o errexit
5+
set -o verbose
6+
7+
VERSION=${version}
8+
WORKDIR=${workdir}
9+
10+
# build in a different directory then we run tests so that we can verify that the linking
11+
# of tests are not relying any built in absolute paths
12+
FINAL_PREFIX=$WORKDIR/src/build/mongo-embedded-sdk-$VERSION
13+
BUILD_PREFIX=$FINAL_PREFIX-tmp
14+
15+
rm -rf mongo-c-driver
16+
17+
# NOTE: If you change the C Driver version here, also change the substitution in the CocoaPod podspec below in the apple builder.
18+
git clone --branch r1.13 --depth 1 https://github.com/mongodb/mongo-c-driver.git
19+
cd mongo-c-driver
20+
21+
# Fixup VERSION so we don't end up with -dev on it. Remove this once we are building a stable version and CDRIVER-2861 is resolved.
22+
cp -f VERSION_RELEASED VERSION_CURRENT
23+
24+
trap "cat CMakeFiles/CMakeOutput.log" EXIT
25+
export ${compile_env}
26+
eval ${cmake_path} -DCMAKE_INSTALL_PREFIX=$BUILD_PREFIX -DENABLE_SHM_COUNTERS=OFF -DENABLE_SNAPPY=OFF -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF -DENABLE_TESTS=OFF -DENABLE_EXAMPLES=OFF -DENABLE_STATIC=OFF -DCMAKE_OSX_DEPLOYMENT_TARGET=${cdriver_cmake_osx_deployment_target} ${cdriver_cmake_flags}
27+
trap - EXIT # cancel the previous trap '...' EXIT
28+
make install VERBOSE=1
29+
30+
# TODO: Remove this when we upgrade to a version of the C driver that has CDRIVER-2854 fixed.
31+
mkdir -p $BUILD_PREFIX/share/doc/mongo-c-driver
32+
cp COPYING $BUILD_PREFIX/share/doc/mongo-c-driver
33+
cp THIRD_PARTY_NOTICES $BUILD_PREFIX/share/doc/mongo-c-driver
34+
35+
mv $BUILD_PREFIX $FINAL_PREFIX

evergreen/embedded_sdk_s3_tar.sh

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
2+
. "$DIR/prelude.sh"
3+
4+
cd src/build
5+
6+
# Not using archive.targz_pack here because I can't get it to work.
7+
set -o errexit
8+
set -o verbose
9+
10+
cat <<EOF >mongo-embedded-sdk-${version}/README-Licenses.txt
11+
The software accompanying this file is Copyright (C) 2018 MongoDB, Inc. and
12+
is licensed to you on the terms set forth in the following files:
13+
- mongo-c-driver: share/doc/mongo-c-driver/COPYING
14+
- mongo_embedded: share/doc/mongo_embedded/LICENSE-Embedded.txt
15+
- mongoc_embedded: share/doc/mongo_embedded/LICENSE-Embedded.txt
16+
EOF
17+
18+
tar cfvz embedded-sdk.tgz mongo-embedded-sdk-${version}
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
2+
. "$DIR/prelude.sh"
3+
4+
cd src/build
5+
6+
# Not using archive.targz_pack here because I can't get it to work.
7+
set -o errexit
8+
set -o verbose
9+
10+
tar cfvz embedded-sdk-tests.tgz mongo-embedded-sdk-${version}

evergreen/gen_feature_flags.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
2+
. "$DIR/prelude.sh"
3+
4+
cd src
5+
6+
set -o errexit
7+
set -o verbose
8+
activate_venv
9+
$python buildscripts/idl/gen_all_feature_flag_list.py --import-dir src --import-dir src/mongo/db/modules/enterprise/src

evergreen/libdeps_run.sh

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
2+
. "$DIR/prelude.sh"
3+
4+
cd src
5+
6+
set -o errexit
7+
set -o verbose
8+
9+
activate_venv
10+
GRAPH_FILE=$(find build -name "libdeps.graphml")
11+
python buildscripts/libdeps/gacli.py --graph-file $GRAPH_FILE >results.txt
12+
gzip $GRAPH_FILE
13+
mv $GRAPH_FILE.gz .

0 commit comments

Comments
 (0)