Mercurial > hg > orthanc-volview
comparison Resources/CreateVolViewDist.sh @ 0:3f1cf4a8e31f
initial commit
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 22 Mar 2023 10:16:47 +0100 |
parents | |
children | ad2fc4ec99fb |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:3f1cf4a8e31f |
---|---|
1 #!/bin/bash | |
2 | |
3 # SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium | |
4 # SPDX-License-Identifier: GPL-3.0-or-later | |
5 | |
6 # Kitware's VolView plugin for Orthanc | |
7 # Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium | |
8 # | |
9 # This program is free software: you can redistribute it and/or | |
10 # modify it under the terms of the GNU General Public License as | |
11 # published by the Free Software Foundation, either version 3 of the | |
12 # License, or (at your option) any later version. | |
13 # | |
14 # This program is distributed in the hope that it will be useful, but | |
15 # WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
17 # General Public License for more details. | |
18 # | |
19 # You should have received a copy of the GNU General Public License | |
20 # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
21 | |
22 | |
23 | |
24 # This command-line script uses the "npm" tool to populate the "dist" | |
25 # folder of VolView. It uses Docker to this end, in order to be usable | |
26 # on our CIS. | |
27 | |
28 set -ex | |
29 | |
30 if [ "$1" = "" ]; then | |
31 VERSION=20147b7 | |
32 else | |
33 VERSION=$1 | |
34 fi | |
35 | |
36 if [ -t 1 ]; then | |
37 # TTY is available => use interactive mode | |
38 DOCKER_FLAGS='-i' | |
39 fi | |
40 | |
41 ROOT_DIR=`dirname $(readlink -f $0)`/.. | |
42 IMAGE=node:19.7.0-bullseye-slim | |
43 | |
44 echo "Creating the distribution of VolView $VERSION" | |
45 | |
46 if [ -e "${ROOT_DIR}/VolView/dist/" ]; then | |
47 echo "Target folder is already existing, aborting" | |
48 exit -1 | |
49 fi | |
50 | |
51 if [ ! -f "${ROOT_DIR}/VolView/VolView-${VERSION}.tar.gz" ]; then | |
52 ( cd ${ROOT_DIR}/VolView && wget https://orthanc.uclouvain.be/third-party-downloads/VolView-${VERSION}.tar.gz ) | |
53 fi | |
54 | |
55 mkdir -p ${ROOT_DIR}/VolView/dist/ | |
56 | |
57 docker run -t ${DOCKER_FLAGS} --rm \ | |
58 --user $(id -u):$(id -g) \ | |
59 -v ${ROOT_DIR}/Resources/CreateVolViewDist-build.sh:/source/build.sh:ro \ | |
60 -v ${ROOT_DIR}/VolView/VolView-${VERSION}.patch:/source/VolView-${VERSION}.patch:ro \ | |
61 -v ${ROOT_DIR}/VolView/VolView-${VERSION}.tar.gz:/source/VolView-${VERSION}.tar.gz:ro \ | |
62 -v ${ROOT_DIR}/VolView/dist/:/target:rw \ | |
63 ${IMAGE} \ | |
64 bash /source/build.sh ${VERSION} |