From 7c15540a49a0f793b32df1cee98b8a7fee801368 Mon Sep 17 00:00:00 2001 From: rschoene <rene.schoene@tu-dresden.de> Date: Thu, 28 Jan 2021 13:52:17 +0100 Subject: [PATCH] CI docker build --- .dockerignore | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ .gitlab-ci.yml | 15 +++++++++++++++ Dockerfile | 9 +++++++++ build-view.sh | 2 ++ 4 files changed, 74 insertions(+) create mode 100644 .dockerignore create mode 100644 .gitlab-ci.yml create mode 100644 Dockerfile create mode 100755 build-view.sh diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..7102138 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,48 @@ +/src/data/ +Dockerfile +.dockerignore +.gitlab-ci.yml +/rd-builder/ +/.git/ + +# compiled output +/dist +/tmp +/out-tsc +/build + +# dependencies +/node_modules + +# IDEs and editors +/.idea +.project +.classpath +.c9/ +*.launch +.settings/ +*.sublime-workspace + +# IDE - VSCode +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + +# misc +/.sass-cache +/connect.lock +/coverage +/libpeerconnection.log +npm-debug.log +testem.log +/typings + +# e2e +/e2e/*.js +/e2e/*.map + +# System Files +.DS_Store +Thumbs.db diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..05749a0 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,15 @@ +image: docker:latest + +variables: + GIT_SUBMODULE_STRATEGY: recursive + IMG_NAME: "$CI_REGISTRY/jastadd/ragdoc-view:" + IMG_SUFFIX: "relations" + +deploy: + stage: deploy + tags: + - docker + script: + - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY + - docker build -t "$IMG_NAME""$IMG_SUFFIX" . + - docker push "$IMG_NAME""$IMG_SUFFIX" diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..29d5555 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM node:15.6.0-buster +WORKDIR /ragdoc-view +ADD . /ragdoc-view/ +RUN npm install +RUN npm install -g @angular/cli@11.1.1 +VOLUME ["/data"] +VOLUME ["/dist"] +RUN chmod +x build-view.sh && ln -s /dist && cd src/ && ln -s /data +ENTRYPOINT ["./build-view.sh"] diff --git a/build-view.sh b/build-view.sh new file mode 100755 index 0000000..f8f1dc9 --- /dev/null +++ b/build-view.sh @@ -0,0 +1,2 @@ +#!/bin/sh +ng build --base-href . --delete-output-path=false -- GitLab