annotate Applications/StoneWebViewer/WebAssembly/docker-build.sh @ 2046:98b44468332e deep-learning

note
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 06 Mar 2023 09:04:10 +0100
parents 7053b8a0aaec
children 07964689cb0b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
1871
7053b8a0aaec upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1870
diff changeset
6 # Copyright (C) 2017-2022 Osimis S.A., Belgium
7053b8a0aaec upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1870
diff changeset
7 # Copyright (C) 2021-2022 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
21ccc00839f7 upgrade to Emscripten 2.0.23
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
27 IMAGE=jodogne/wasm-builder:2.0.23
1496
d450653b46d3 build stone web viewer using docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1495
diff changeset
28 #IMAGE=wasm-builder
1495
fb74ed5d8c22 initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29
fb74ed5d8c22 initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 if [ "$1" != "Debug" -a "$1" != "Release" ]; then
fb74ed5d8c22 initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 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
32 exit -1
fb74ed5d8c22 initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 fi
fb74ed5d8c22 initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34
1827
21ccc00839f7 upgrade to Emscripten 2.0.23
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
35 if [ "$2" == "" ]; then
21ccc00839f7 upgrade to Emscripten 2.0.23
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
36 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
37 STONE_BRANCH=`hg identify -b`
21ccc00839f7 upgrade to Emscripten 2.0.23
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
38 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
39 else
21ccc00839f7 upgrade to Emscripten 2.0.23
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
40 STONE_BRANCH=$2
21ccc00839f7 upgrade to Emscripten 2.0.23
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
41 fi
21ccc00839f7 upgrade to Emscripten 2.0.23
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
42
1495
fb74ed5d8c22 initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 if [ -t 1 ]; then
fb74ed5d8c22 initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 # TTY is available => use interactive mode
fb74ed5d8c22 initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 DOCKER_FLAGS='-i'
fb74ed5d8c22 initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 fi
fb74ed5d8c22 initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47
1544
8ddf77198ed7 fixing paths
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1538
diff changeset
48 ROOT_DIR=`dirname $(readlink -f $0)`/../../..
1495
fb74ed5d8c22 initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49
fb74ed5d8c22 initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 mkdir -p ${ROOT_DIR}/wasm-binaries
fb74ed5d8c22 initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51
fb74ed5d8c22 initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 docker run -t ${DOCKER_FLAGS} --rm \
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
8ddf77198ed7 fixing paths
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1538
diff changeset
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/