-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.appveyor.yml
152 lines (129 loc) · 5.26 KB
/
.appveyor.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# This setup tests ICF-related software and workflows. There are two elements
# that have to be kept aligned with ICF's environment:
#
# 1. The input data structure should match the data that ICF receives from
# acquisition sides.
#
# 2. The software environment should match the environment on ICF's machines,
# i.e. the versions of: `git`, `git-annex`, `python`, `datalad`, and
# `datalad-next`.
# This version of Ubuntu is based on debian bullseye
image: Ubuntu2004
hosts:
data.inm-icf.de: 127.0.0.2
environment:
# Set this to `post-install` to activate the ssh login after the
# install-steps are executed.
# Set it to 'pre-tests' to activate ssh login just before the tests are
# executed.
# This requires setting `APPVEYOR_SSH_KEY` and `APPVEYOR_SSH_BLOCK`
ACTIVATE_SSH_LOGIN: no
# The root for study data and the studies that we simulate. These variables
# are available throughout ``install:´´ and in the executed scripts.
FROM_SCANNER: /data/incoming
STUDIES_DIR: /data/archive
STUDIES: "study_1 study_2"
skip_commits:
files:
- docs/
- README.md
- .readthedocs.yaml
cache:
# we reuse the image unless the recipe or the scripts change
# ATTN: This means that updates to software dependencies will not
# trigger an image update!! If that is desired, the build cache needs
# to be wiped first:
# https://www.appveyor.com/docs/build-cache/#cleaning-up-cache
- icf.sif -> singularity/icf.def, bin/*
- singularity-container_3.8.7_amd64.deb
artifacts:
- path: icf.sif
name: ICF utils singularity image
type: File
# In `install` we prep the test system with any non-DataLad tooling
install:
- curl -sflL 'https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-ssh.sh' | bash -e -;
# Bootstrap ICF-like system installation
- sudo .appveyor/install_apt_pkgs
# build the singularity image, unless we got it from the cache
- sh: "[ ! -f icf.sif ] && singularity build --fakeroot icf.sif singularity/icf.def || true"
# install image as `icf-utils` (mounting the ICF /data store on-run)
- sh: echo -e '#!/bin/sh\nset -e -u\nsingularity run -B /data /home/appveyor/projects/inm-icf-utilities/icf.sif "$@"' > icf-utils
- sudo install -t /usr/bin icf-utils
# Bootstrap ICF data organization
# Create data input directory and populate it
- sudo mkdir -p "$FROM_SCANNER"
- sh:
for s in $STUDIES; do
sudo .appveyor/data_create_scanner_output $FROM_SCANNER $s 10 20;
done
# Create ICF store
- sudo mkdir /data/archive
# we use the 'appveyor' group as a placeholder for the actual ICF group
# which has write access on the real system
- sudo chown :appveyor /data/archive
- sudo chmod g+ws /data/archive
# Run the non-DataLad DICOM data ingestion script. Create two visits, i.e.
# ``visit_a´´ and ``visit_b´´, for each study defined in ${STUDIES}
- sh:
for s in $STUDIES; do
for v in visit_a visit_b; do
icf-utils make_studyvisit_archive
--store-dir "$STUDIES_DIR"
--id $s $v
"$FROM_SCANNER";
done
done
# show the full store/incoming content before any DataLad business
- tree /data/
# Create user http content and create links to the studies in.
- .appveyor/apache_enable_user_dir
- mkdir ~/public_html
- sh:
for s in $STUDIES; do
ln -s "$STUDIES_DIR"/$s /home/appveyor/public_html/$s;
done
# Enable basic authentication and authorization for the study directories. The
# username is ``test.user´´, the password is ``secret_1´´.
- sh:
.appveyor/apache_enable_authentication
$STUDIES_DIR
test.user secret_1
$STUDIES
# Enable external SSH access to CI worker on all other systems. This uses the
# public key defined in APPVEYOR_SSH_KEY. If APPVEYOR_SSH_BLOCK is ``true´´,
# the worker waits with the continuation of the build beyond this point until
# the file ``~/build.lock´´ is removed.
- sh:
if [ X"$ACTIVATE_SSH_LOGIN" == "Xpost-install" ]; then
curl -sflL 'https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-ssh.sh' | bash -e -;
fi
# Disable automatic builds with MSBuild, we use custom build steps instead.
build: off
# In `build` and `*test*` we perform the actual deployment and validation
# of the DataLad-tooling
build_script:
# Set up git identification
- git config --global user.email "[email protected]"
- git config --global user.name "Appveyor Almighty"
before_test:
# simple call to see if datalad and git-annex are installed properly
- icf-utils datalad wtf
test_script:
# run tests found in the $PROJECT_ROOT/test directory
- mkdir __testhome__
- cd __testhome__
- sh:
if [ X"$ACTIVATE_SSH_LOGIN" == "Xpre-tests" ]; then
curl -sflL 'https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-ssh.sh' | bash -e -;
fi
- icf-utils python3 -m pytest -s -v ../tests
- sh:
if [ X"$ACTIVATE_SSH_LOGIN" == "Xpost-tests" ]; then
curl -sflL 'https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-ssh.sh' | bash -e -;
touch $HOME/build.lock;
while [ -e $HOME/build.lock ]; do sleep 5; done;
fi;
on_finish:
# conditionally block the exit of a CI run for direct debugging
- sh: while [ -f ~/BLOCK ]; do sleep 5; done