Skip to content

Commit 3ac659d

Browse files
committed
enh(circle): speed up upload of artifacts [skip ci]
1 parent eef07cd commit 3ac659d

File tree

1 file changed

+32
-16
lines changed

1 file changed

+32
-16
lines changed

.circleci/config.yml

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -461,14 +461,20 @@ jobs:
461461
exit $?
462462
- run:
463463
name: Clean working directory
464-
when: always
464+
when: on_success
465465
command: |
466466
sudo chown $(id -un):$(id -gn) -R /tmp/ds005
467-
find /tmp/ds005/work -not -name "*.svg" -not -name "*.html" -not -name "*.rst" \
468-
-not -name "*.mat" -not -name "*.lta" -not -name "*.json" -not -name "*.txt" -not -name "*.pklz" -type f -delete
469-
find /tmp/ds005/work_partial -not -name "*.svg" -not -name "*.html" -not -name "*.rst" \
470-
-not -name "*.mat" -not -name "*.lta" -not -name "*.json" -not -name "*.txt" -not -name "*.pklz" -type f -delete
471-
# tar cf - work_partial/ | pigz -2 -p 2 > ds005_workdir.tar.gz && sudo rm -fr work work_partial
467+
sudo rm -rf /tmp/ds005/work
468+
sudo rm -rf /tmp/ds005/work_partial
469+
- run:
470+
name: Clean working directory
471+
when: on_fail
472+
command: |
473+
sudo chown $(id -un):$(id -gn) -R /tmp/ds005
474+
find /tmp/ds005/work \( -name "*.nii.gz" -or -name "*.nii" -or "*.gii" -or "*.h5" \) \
475+
-exec sh -c 'rm -f {}; touch {}' \;
476+
find /tmp/ds005/work_partial \( -name "*.nii.gz" -or -name "*.nii" -or "*.gii" -or "*.h5" \) \
477+
-exec sh -c 'rm -f {}; touch {}' \;
472478
473479
- store_artifacts:
474480
path: /tmp/ds005
@@ -587,13 +593,18 @@ jobs:
587593
set -e
588594
[[ "$RET" -eq "1" ]]
589595
- run:
590-
name: Clean-up work directory
591-
when: always
596+
name: Clean working directory
597+
when: on_success
598+
command: |
599+
sudo chown $(id -un):$(id -gn) -R /tmp/ds054
600+
sudo rm -rf /tmp/ds054/work
601+
- run:
602+
name: Clean working directory
603+
when: on_fail
592604
command: |
593605
sudo chown $(id -un):$(id -gn) -R /tmp/ds054
594-
find /tmp/ds054/work -not -name "*.svg" -not -name "*.html" -not -name "*.rst" \
595-
-not -name "*.mat" -not -name "*.lta" -not -name "*.json" -not -name "*.txt" -not -name "*.pklz" -type f -delete
596-
# tar cf - work/ | pigz -2 -p 2 > ds054_workdir.tar.gz && sudo rm -fr work
606+
find /tmp/ds054/work \( -name "*.nii.gz" -or -name "*.nii" -or "*.gii" -or "*.h5" \) \
607+
-exec sh -c 'rm -f {}; touch {}' \;
597608
- store_artifacts:
598609
path: /tmp/ds054
599610

@@ -685,13 +696,18 @@ jobs:
685696
diff /tmp/src/fmriprep/.circleci/ds210_outputs.txt /tmp/ds210/test/outputs.out
686697
exit $?
687698
- run:
688-
name: Clean-up work directory
689-
when: always
699+
name: Clean working directory
700+
when: on_success
701+
command: |
702+
sudo chown $(id -un):$(id -gn) -R /tmp/ds210
703+
sudo rm -rf /tmp/ds210/work
704+
- run:
705+
name: Clean working directory
706+
when: on_fail
690707
command: |
691708
sudo chown $(id -un):$(id -gn) -R /tmp/ds210
692-
find /tmp/ds210/work -not -name "*.svg" -not -name "*.html" -not -name "*.rst" \
693-
-not -name "*.mat" -not -name "*.lta" -not -name "*.json" -not -name "*.txt" -not -name "*.pklz" -type f -delete
694-
# tar cf - work/ | pigz -2 -p 2 > ds054_workdir.tar.gz && sudo rm -fr work
709+
find /tmp/ds210/work \( -name "*.nii.gz" -or -name "*.nii" -or "*.gii" -or "*.h5" \) \
710+
-exec sh -c 'rm -f {}; touch {}' \;
695711
- store_artifacts:
696712
path: /tmp/ds210
697713

0 commit comments

Comments
 (0)