diff options
author | Brian McCarthy <brian.mccarthy@mongodb.com> | 2019-02-01 21:27:40 -0500 |
---|---|---|
committer | Brian McCarthy <brian.mccarthy@mongodb.com> | 2019-02-08 10:33:56 -0500 |
commit | 9692e042ac698c0af3c9a541ebc58c0c29ec4190 (patch) | |
tree | b558f1c8aea79457c9f20e7dc0a79af24864abc6 /etc | |
parent | 315b7197505795f21fb62e69c122833def6cf75a (diff) | |
download | mongo-9692e042ac698c0af3c9a541ebc58c0c29ec4190.tar.gz |
SERVER-39379 Pin shared SCons cache pruning to master
Diffstat (limited to 'etc')
-rw-r--r-- | etc/evergreen.yml | 71 |
1 files changed, 40 insertions, 31 deletions
diff --git a/etc/evergreen.yml b/etc/evergreen.yml index b01888d8e71..df0ff9976f8 100644 --- a/etc/evergreen.yml +++ b/etc/evergreen.yml @@ -863,49 +863,58 @@ functions: command: shell.exec type: system params: + shell: bash working_dir: src script: | set -o errexit set -o verbose # removes files from the shared scons cache. - set +o errexit - mount | grep "\/efs" > /dev/null - if [ $? -eq 0 ]; then - echo "Shared cache is already mounted" - else - echo "Shared cache - mounting file system" - sudo mount /efs - fi - set -o errexit + # Only prune on master branch + if [[ "${project}" == "mongodb-mongo-master" ]]; then + + + set +o errexit + mount | grep "\/efs" > /dev/null + if [ $? -eq 0 ]; then + echo "Shared cache is already mounted" + else + echo "Shared cache - mounting file system" + sudo mount /efs + fi + set -o errexit - dirs=$(ls -l /efs | grep -v total | awk '{print $NF}') + dirs=$(ls -l /efs | grep -v total | awk '{print $NF}') - echo "Pruning shared SCons directories" + echo "Pruning shared SCons directories" - for dir in $dirs; do - echo "Pruning /efs/$dir/scons-cache" + for dir in $dirs; do + echo "Pruning /efs/$dir/scons-cache" - if [ -e /efs/$dir/info/distro_name ]; then - distro=$(cat /efs/$dir/info/distro_name) - fi + if [ -e /efs/$dir/info/distro_name ]; then + distro=$(cat /efs/$dir/info/distro_name) + fi - # Set cache sizes by distro - case $distro in - ubuntu1604|ubuntu1804|rhel62|rhel70) - cache_size=300 - ;; - *) - # default - cache_size=200 - ;; - esac - - sudo python buildscripts/scons_cache_prune.py --cache-dir /efs/$dir/scons-cache --cache-size $cache_size --prune-ratio 1.0 - echo "" - done + # Set cache sizes by distro + case $distro in + ubuntu1604|ubuntu1804|rhel62|rhel70) + cache_size=600 + ;; + *) + # default + cache_size=400 + ;; + esac + + sudo python buildscripts/scons_cache_prune.py --cache-dir /efs/$dir/scons-cache --cache-size $cache_size --prune-ratio 1.0 + echo "" + done + + sudo umount /efs || true - sudo umount /efs || true + else + echo "Not on master, shared SCons cache pruning skipped" + fi "scons cache pruning" : command: shell.exec |