Mercurial > hg > orthanc-stone
annotate Applications/StoneWebViewer/WebAssembly/docker-build.sh @ 2135:6cc11bd11890 dicom-sr
integration mainline->dicom-sr
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 30 May 2024 21:31:55 +0200 |
parents | 16c01cc201e7 |
children |
rev | line source |
---|---|
1495
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1 #!/bin/bash |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2 |
1589
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1544
diff
changeset
|
3 # Stone of Orthanc |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1544
diff
changeset
|
4 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1544
diff
changeset
|
5 # Department, University Hospital of Liege, Belgium |
2124
16c01cc201e7
updated copyright, as Osimis is not active on Orthanc anymore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2114
diff
changeset
|
6 # Copyright (C) 2017-2023 Osimis S.A., Belgium |
2114
c23eef785569
update year to 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2107
diff
changeset
|
7 # Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
1589
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1544
diff
changeset
|
8 # |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1544
diff
changeset
|
9 # This program is free software: you can redistribute it and/or |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1544
diff
changeset
|
10 # modify it under the terms of the GNU Affero General Public License |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1544
diff
changeset
|
11 # as published by the Free Software Foundation, either version 3 of |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1544
diff
changeset
|
12 # the License, or (at your option) any later version. |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1544
diff
changeset
|
13 # |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1544
diff
changeset
|
14 # This program is distributed in the hope that it will be useful, but |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1544
diff
changeset
|
15 # WITHOUT ANY WARRANTY; without even the implied warranty of |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1544
diff
changeset
|
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1544
diff
changeset
|
17 # Affero General Public License for more details. |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1544
diff
changeset
|
18 # |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1544
diff
changeset
|
19 # You should have received a copy of the GNU Affero General Public License |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1544
diff
changeset
|
20 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1544
diff
changeset
|
21 |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1544
diff
changeset
|
22 |
1495
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 set -ex |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 |
1827
21ccc00839f7
upgrade to Emscripten 2.0.23
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1739
diff
changeset
|
25 # NB: Sources of the "jodogne/wasm-builder" Docker image: |
21ccc00839f7
upgrade to Emscripten 2.0.23
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1739
diff
changeset
|
26 # https://github.com/jodogne/OrthancDocker/tree/master/wasm-builder |
2107
5970030a413c
Upgraded Emscripten version to 3.1.49
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2083
diff
changeset
|
27 IMAGE=jodogne/wasm-builder:3.1.49 |
1495
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 if [ "$1" != "Debug" -a "$1" != "Release" ]; then |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 echo "Please provide build type: Debug or Release" |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 exit -1 |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 fi |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 |
1827
21ccc00839f7
upgrade to Emscripten 2.0.23
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1739
diff
changeset
|
34 if [ "$2" == "" ]; then |
21ccc00839f7
upgrade to Emscripten 2.0.23
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1739
diff
changeset
|
35 echo "No branch provided, trying to identify the current branch" |
21ccc00839f7
upgrade to Emscripten 2.0.23
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1739
diff
changeset
|
36 STONE_BRANCH=`hg identify -b` |
21ccc00839f7
upgrade to Emscripten 2.0.23
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1739
diff
changeset
|
37 echo "Detected branch of the Stone Web viewer: ${STONE_BRANCH}" |
21ccc00839f7
upgrade to Emscripten 2.0.23
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1739
diff
changeset
|
38 else |
21ccc00839f7
upgrade to Emscripten 2.0.23
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1739
diff
changeset
|
39 STONE_BRANCH=$2 |
21ccc00839f7
upgrade to Emscripten 2.0.23
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1739
diff
changeset
|
40 fi |
21ccc00839f7
upgrade to Emscripten 2.0.23
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1739
diff
changeset
|
41 |
1495
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
42 if [ -t 1 ]; then |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
43 # TTY is available => use interactive mode |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
44 DOCKER_FLAGS='-i' |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
45 fi |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
46 |
1544 | 47 ROOT_DIR=`dirname $(readlink -f $0)`/../../.. |
1495
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
48 |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
49 mkdir -p ${ROOT_DIR}/wasm-binaries |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
50 |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
51 docker run -t ${DOCKER_FLAGS} --rm \ |
2083 | 52 --dns=8.8.8.8 \ |
1495
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
53 --user $(id -u):$(id -g) \ |
1827
21ccc00839f7
upgrade to Emscripten 2.0.23
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1739
diff
changeset
|
54 -e STONE_BRANCH=${STONE_BRANCH} \ |
1495
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
55 -v ${ROOT_DIR}:/source:ro \ |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
56 -v ${ROOT_DIR}/wasm-binaries:/target:rw ${IMAGE} \ |
1544 | 57 bash /source/Applications/StoneWebViewer/WebAssembly/docker-internal.sh $1 |
1495
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
58 |
1496
d450653b46d3
build stone web viewer using docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1495
diff
changeset
|
59 ls -lR ${ROOT_DIR}/wasm-binaries/StoneWebViewer/ |