# HG changeset patch # User Sebastien Jodogne # Date 1679482292 -3600 # Node ID ad2fc4ec99fb1e5f7ab4ac98b89d39e5f4d86915 # Parent 3518c3c41b30f75713abb7ad4353dbba5db0cd9d fix missing "patch" command-line tool in Docker diff -r 3518c3c41b30 -r ad2fc4ec99fb Resources/CreateVolViewDist-build.sh --- a/Resources/CreateVolViewDist-build.sh Wed Mar 22 10:32:18 2023 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -#!/bin/bash - -# SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium -# SPDX-License-Identifier: GPL-3.0-or-later - -# Kitware's VolView plugin for Orthanc -# Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium -# -# This program is free software: you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -set -ex - -if [ "$1" = "" ]; then - echo "Please provide a version number of VolView" - exit -1 -fi - -apt update -apt install patch - -cd /tmp/ -tar xvf /source/VolView-$1.tar.gz - -cd /tmp/VolView-$1 -patch -p1 < /source/VolView-$1.patch -npm install --cache /tmp/npm-cache -npm run build --cache /tmp/npm-cache - -cp -r /tmp/VolView-$1/dist/* /target diff -r 3518c3c41b30 -r ad2fc4ec99fb Resources/CreateVolViewDist.sh --- a/Resources/CreateVolViewDist.sh Wed Mar 22 10:32:18 2023 +0100 +++ b/Resources/CreateVolViewDist.sh Wed Mar 22 11:51:32 2023 +0100 @@ -39,7 +39,7 @@ fi ROOT_DIR=`dirname $(readlink -f $0)`/.. -IMAGE=node:19.7.0-bullseye-slim +IMAGE=orthanc-volview-node echo "Creating the distribution of VolView $VERSION" @@ -49,14 +49,18 @@ fi if [ ! -f "${ROOT_DIR}/VolView/VolView-${VERSION}.tar.gz" ]; then - ( cd ${ROOT_DIR}/VolView && wget https://orthanc.uclouvain.be/third-party-downloads/VolView-${VERSION}.tar.gz ) + ( cd ${ROOT_DIR}/VolView && \ + wget https://orthanc.uclouvain.be/third-party-downloads/VolView-${VERSION}.tar.gz ) fi mkdir -p ${ROOT_DIR}/VolView/dist/ +( cd ${ROOT_DIR}/Resources/CreateVolViewDist && \ + docker build --no-cache -t ${IMAGE} . ) + docker run -t ${DOCKER_FLAGS} --rm \ --user $(id -u):$(id -g) \ - -v ${ROOT_DIR}/Resources/CreateVolViewDist-build.sh:/source/build.sh:ro \ + -v ${ROOT_DIR}/Resources/CreateVolViewDist/build.sh:/source/build.sh:ro \ -v ${ROOT_DIR}/VolView/VolView-${VERSION}.patch:/source/VolView-${VERSION}.patch:ro \ -v ${ROOT_DIR}/VolView/VolView-${VERSION}.tar.gz:/source/VolView-${VERSION}.tar.gz:ro \ -v ${ROOT_DIR}/VolView/dist/:/target:rw \ diff -r 3518c3c41b30 -r ad2fc4ec99fb Resources/CreateVolViewDist/Dockerfile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Resources/CreateVolViewDist/Dockerfile Wed Mar 22 11:51:32 2023 +0100 @@ -0,0 +1,27 @@ +# SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium +# SPDX-License-Identifier: GPL-3.0-or-later + +# Kitware's VolView plugin for Orthanc +# Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +FROM node:19.7.0-bullseye-slim + +MAINTAINER Sebastien Jodogne +LABEL Description="Orthanc, free DICOM server" Vendor="The Orthanc project" + +RUN apt-get -y clean && apt-get -y update && \ + DEBIAN_FRONTEND=noninteractive apt-get -y install patch && \ + apt-get clean && rm -rf /var/lib/apt/lists/* diff -r 3518c3c41b30 -r ad2fc4ec99fb Resources/CreateVolViewDist/build.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Resources/CreateVolViewDist/build.sh Wed Mar 22 11:51:32 2023 +0100 @@ -0,0 +1,37 @@ +#!/bin/bash + +# SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium +# SPDX-License-Identifier: GPL-3.0-or-later + +# Kitware's VolView plugin for Orthanc +# Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +set -ex + +if [ "$1" = "" ]; then + echo "Please provide a version number of VolView" + exit -1 +fi + +cd /tmp/ +tar xvf /source/VolView-$1.tar.gz + +cd /tmp/VolView-$1 +patch -p1 < /source/VolView-$1.patch +npm install --cache /tmp/npm-cache +npm run build --cache /tmp/npm-cache + +cp -r /tmp/VolView-$1/dist/* /target