-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.sh
69 lines (54 loc) · 2.03 KB
/
script.sh
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
# Must be run from the directory that contains this script (docker-aims)
# This script
####################################
# 1. Downloads brainvisa dev image #
####################################
: ${CASA_BASE_REPOSITORY:=/volatile/bv/casa_distro_repo} # set default value
export CASA_BASE_REPOSITORY
export IMAGE_VERSION=5.0-4
export IMAGE_NAME=aims-opensource-master-$IMAGE_VERSION
casa_distro \
setup_dev \
branch=master \
url=https://brainvisa.info/download \
image_version=$IMAGE_VERSION \
output=$CASA_BASE_REPOSITORY/$IMAGE_NAME
# mv $CASA_BASE_REPOSITORY/opensource-master-$IMAGE_VERSION \
# $CASA_BASE_REPOSITORY/$IMAGE_NAME
export PATH="$CASA_BASE_REPOSITORY/$IMAGE_NAME/bin:$PATH"
###################################
# 2. Configures bv_maker #
###################################
# Only aims dependencies will be installed
cat <<'EOF' > "$CASA_BASE_REPOSITORY"/$IMAGE_NAME/conf/bv_maker.cfg
[ source $CASA_SRC ]
brainvisa brainvisa-cmake $CASA_BRANCH
brainvisa soma-base $CASA_BRANCH
brainvisa soma-io $CASA_BRANCH
brainvisa aims-free $CASA_BRANCH
[ build $CASA_BUILD ]
default_steps = configure build
make_options = -j$NCPU
build_type = Release
packaging_thirdparty = OFF
clean_config = ON
clean_build = ON
test_ref_data_dir = $CASA_TESTS/ref
test_run_data_dir = $CASA_TESTS/test
brainvisa brainvisa-cmake $CASA_BRANCH $CASA_SRC
brainvisa soma-base $CASA_BRANCH $CASA_SRC
brainvisa soma-io $CASA_BRANCH $CASA_SRC
brainvisa aims-free $CASA_BRANCH $CASA_SRC
EOF
###################################
# 3. Installs aims in image #
###################################
bv_maker
bv /bin/sh -c 'cd /casa/host/build && make install-runtime BRAINVISA_INSTALL_PREFIX=/casa/host/install'
rm -rf install && cp -a "$CASA_BASE_REPOSITORY"/"$IMAGE_NAME"/install .
###################################
# 4. Creates docker image #
###################################
DOCKER_IMAGE=brainvisa-aims:master_$(date -Id)
docker build -t $DOCKER_IMAGE .
docker save -o $DOCKER_IMAGE.tar $DOCKER_IMAGE