annotate Applications/Samples/WebAssembly/docker-build.sh @ 1886:ca89fec8c48f

test
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 14 Jan 2022 19:10:30 +0100
parents 7053b8a0aaec
children 0208f99b8bde
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1492
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 #!/bin/bash
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2
1589
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1542
diff changeset
3 # Stone of Orthanc
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1542
diff changeset
4 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1542
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: 1542
diff changeset
8 #
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1542
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: 1542
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: 1542
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: 1542
diff changeset
12 # the License, or (at your option) any later version.
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1542
diff changeset
13 #
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1542
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: 1542
diff changeset
15 # WITHOUT ANY WARRANTY; without even the implied warranty of
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1542
diff changeset
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1542
diff changeset
17 # Affero General Public License for more details.
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1542
diff changeset
18 #
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1542
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: 1542
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: 1542
diff changeset
21
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1542
diff changeset
22
1492
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 set -ex
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 IMAGE=jodogne/wasm-builder:1.39.17-upstream
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 if [ "$1" != "Debug" -a "$1" != "Release" ]; then
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 echo "Please provide build type: Debug or Release"
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 exit -1
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 fi
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 if [ -t 1 ]; then
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 # TTY is available => use interactive mode
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 DOCKER_FLAGS='-i'
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 fi
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36
1513
24068dd8c445 fix path
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
37 ROOT_DIR=`dirname $(readlink -f $0)`/../../..
1492
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 mkdir -p ${ROOT_DIR}/wasm-binaries
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 docker run -t ${DOCKER_FLAGS} --rm \
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 --user $(id -u):$(id -g) \
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 -v ${ROOT_DIR}:/source:ro \
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 -v ${ROOT_DIR}/wasm-binaries:/target:rw ${IMAGE} \
1542
6e0da8370270 fixing paths
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1538
diff changeset
45 bash /source/Applications/Samples/WebAssembly/docker-internal.sh $1
1492
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 ls -lR ${ROOT_DIR}/wasm-binaries/