Mercurial > hg > orthanc-authorization
changeset 20:549d67db766c
merge from 0.2.1
author | am@osimis.io |
---|---|
date | Thu, 19 Jul 2018 15:04:50 +0200 |
parents | 02c83c12d3d5 (diff) d795b48a62a8 (current diff) |
children | 67dc0e5de125 c44013681a51 |
files | NEWS |
diffstat | 6 files changed, 88 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.dockerignore Thu Jul 19 15:04:50 2018 +0200 @@ -0,0 +1,6 @@ +scripts/ +NEWS +NOTES.txt +README +Jenkinsfile +Dockerfile \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Dockerfile Thu Jul 19 15:04:50 2018 +0200 @@ -0,0 +1,31 @@ + +FROM jodogne/orthanc:1.2.0 + +WORKDIR /root/source + +RUN apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get -y install \ + libxml++2.6-dev libxml++2.6-doc uuid-dev \ + git \ + python3-dev \ + python3.4-venv \ + python3-pip && \ + rm -rf /var/lib/apt/lists/* + +# Used to copy the plugin to AWS after successful integration tests +RUN pip3 install awscli + +COPY . /root/source/ + +# Build the plugin +RUN mkdir /root/build/ +WORKDIR /root/build +RUN cmake -DALLOW_DOWNLOADS=ON \ + -DSTATIC_BUILD=ON \ + -DCMAKE_BUILD_TYPE=Release \ + /root/source +RUN make "--jobs=$(grep --count ^processor /proc/cpuinfo)" +RUN make install + +ENTRYPOINT [ "Orthanc" ] +CMD [ "/etc/orthanc/" ]
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Jenkinsfile Thu Jul 19 15:04:50 2018 +0200 @@ -0,0 +1,21 @@ +try { + node('docker') { + stage 'Retrieve sources' + deleteDir() + checkout scm + + lock(resource: 'orthanc-authorization-plugin', inversePrecedence: false) { + stage 'Build Docker image & run unit tests' + sh 'scripts/ciBuildDockerImage.sh' + } + + withCredentials([[$class: 'AmazonWebServicesCredentialsBinding', credentialsId: 'aws-orthanc.osimis.io']]) { + stage 'Push Docker plugin to AWS' + sh 'scripts/ciPushToAws.sh ${BRANCH_NAME}' + } + } +} +catch (e) { + slackSend color: '#FF0000', message: "${env.JOB_NAME} has failed ${env.JOB_URL}" + throw e +} \ No newline at end of file
--- a/NEWS Fri Mar 09 10:35:52 2018 +0100 +++ b/NEWS Thu Jul 19 15:04:50 2018 +0200 @@ -1,6 +1,7 @@ Pending changes in the mainline =============================== +* Added automated build 2018-03-09 - v 0.2.1 ====================
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scripts/ciBuildDockerImage.sh Thu Jul 19 15:04:50 2018 +0200 @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +# Builds the Orthanc authorization plugin Docker image +# Arguments: + +set -x # Trace execution +set -e # Stop on error +set -u # Stop on uninitialized variable + +docker build -t osimis/orthanc-authorization-plugin .
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scripts/ciPushToAws.sh Thu Jul 19 15:04:50 2018 +0200 @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +# Builds the MSSQL Orthanc plugin Docker image +# Arguments: +# $1 - Git branch name + +set -e # Stop on error +set -u # Stop on uninitialized variable +set -x # Trace execution + +branchName=${1:-$(hg branch)} #if no argument defined, get the branch name from git +commitId=$(hg identify --id) + +if [[ $branchName == "default" ]]; then + releaseTag=$commitId +else + releaseTag=$branchName +fi + +docker run --rm -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY --entrypoint bash osimis/orthanc-authorization-plugin -c \ + "aws s3 --region eu-west-1 cp /usr/local/share/orthanc/plugins/libOrthancAuthorization.so s3://orthanc.osimis.io/docker-so/orthanc-authorization/$releaseTag/ --cache-control max-age=1" \ No newline at end of file