Commit 7364c288 authored by Henrik Tramberend's avatar Henrik Tramberend
Browse files

Merge remote-tracking branch 'refs/remotes/origin/master'

parents 4a87958e f1858425
......@@ -23,3 +23,4 @@ auto/
*.fls
*.log
*.synctex.gz
decker.css
image: docker:latest
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
build:
only:
- schedules
stage: build
script:
- docker build -t $CI_REGISTRY_IMAGE .
- docker push $CI_REGISTRY_IMAGE
\ No newline at end of file
# Builds the decker executable
FROM ubuntu:artful
RUN apt-get update && apt-get install -y \
wget \
unzip \
zip
#set the encoding on UTF-8, so the parser works correctly, german language is also added for umlaute
#source of fix: https://blog.mkowalski.net/2016/05/16/solving-locale-issues-with-docker-containers/
RUN apt-get install --reinstall -y locales && \
sed -i 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen && \
locale-gen de_DE.UTF-8
ENV LANG de_DE.UTF-8
ENV LANGUAGE de_DE
ENV LC_ALL de_DE.UTF-8
RUN dpkg-reconfigure --frontend noninteractive locales
RUN wget -qO- https://get.haskellstack.org/ | sh
WORKDIR /decker
COPY . /decker
RUN make install
RUN ldd /root/.local/bin/decker | grep "=> /" | awk '{print $3}' | xargs -I '{}' cp -v '{}' /root/.local/bin
# Image that will execute decker
FROM ubuntu:artful
RUN apt-get update && apt-get install -y \
graphviz \
gnuplot \
rsync \
sassc \
unzip \
zip
ENV PATH="/root/.local/bin:${PATH}"
COPY --from=0 /root/.local /root/.local
COPY --from=0 /root/.stack/snapshots/x86_64-linux-nopie/lts-10.10/8.2.2/share/x86_64-linux-ghc-8.2.2/pandoc-citeproc-0.12.2.5/locales/locales-en-US.xml /root/.stack/snapshots/x86_64-linux-nopie/lts-10.10/8.2.2/share/x86_64-linux-ghc-8.2.2/pandoc-citeproc-0.12.2.5/locales/locales-en-US.xml
#COPY --from=0 /root/.stack /root/.stack
#set the encoding on UTF-8, so the parser works correctly, german language is also added for umlaute
#source of fix: https://blog.mkowalski.net/2016/05/16/solving-locale-issues-with-docker-containers/
RUN apt-get install --reinstall -y locales && \
sed -i 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen && \
locale-gen de_DE.UTF-8
ENV LANG de_DE.UTF-8
ENV LANGUAGE de_DE
ENV LC_ALL de_DE.UTF-8
RUN dpkg-reconfigure --frontend noninteractive locales
WORKDIR /decker
ENTRYPOINT ["decker"]
\ No newline at end of file
......@@ -72,9 +72,10 @@ main = do
need ["support"]
everythingA <++> indexA >>= need
--
phony "pdf" $ pagesPdfA <++> handoutsPdfA <++> indexA >>= need
phony "pdf" $
decksPdfA <++> pagesPdfA <++> handoutsPdfA <++> indexA >>= need
--
-- phony "pdf-decks" $ decksPdfA <++> indexA >>= need
phony "pdf-decks" $ decksPdfA <++> indexA >>= need
--
phony "watch" $ do
need ["html"]
......@@ -135,11 +136,26 @@ main = do
markdownToHtmlPage src out
--
indexSource <.> "generated" %> \out -> do
-- deckSources <- deckSourcesA
-- pageSources <- pageSourcesA
decks <- decksA
decksPdf <- decksPdfA
pagesPdf <- pagesPdfA
handouts <- handoutsA
handoutsPdf <- handoutsPdfA
pages <- pagesA
-- let deckData =
-- transpose [deckSources, decks, handouts, decksPdf, handoutsPdf]
-- let pageData = transpose [pageSources, pages, pagesPdf]
need $ decks ++ handouts ++ pages
writeIndex out (takeDirectory index) decks handouts pages
writeIndexLists
out
(takeDirectory index)
(zip decks decksPdf)
(zip handouts handoutsPdf)
(zip pages pagesPdf)
-- writeIndexTable out (takeDirectory index) deckData pageData
-- writeIndex out (takeDirectory index) decks handouts pages
--
priority 2 $
"//*.dot.svg" %> \out -> do
......
#Ubuntu just provides the the best toolbox for decker, the offical Haskell immage doesn't have all dependencies
#The 17.10 as a rolling release is used because of the sass-compiler
# source of the missing dependecy: https://askubuntu.com/questions/849057/how-to-install-libsass-on-ubuntu-16-04
# if the 18:04 LTS is available this one is automatically used, maybe then it can be set it as a fixed base-mage
FROM ubuntu:rolling
#update the packages and install all haskell-stack dependencies, for some reasons an extra gcc is required
RUN apt-get update && apt-get install -y \
gcc \
git \
wget \
xz-utils
#install haskell-stack
RUN wget -qO- https://get.haskellstack.org/ | sh
#install all decker dependencies
RUN apt-get install -y \
graphviz \
gnuplot \
rsync \
sassc \
unzip \
zip
#for pdf-features:
RUN apt-get install -y \
pdf2svg \
texlive-latex-base
#add the later location of decker binary to the PATH
ENV PATH="/root/.local/bin:${PATH}"
#cloning the decker repo with HTTPS to avoid SSH-Key hazzle, otherwise the SSH-key has to be added to the container with 'ADD'
RUN git clone https://gitlab2.informatik.uni-wuerzburg.de/decker/decker.git
#change to the decker source-folder
WORKDIR /decker
#the git checkout is a stable release under ubuntu, maybe this could be solved nicer
#a checkout by a tag would of course be better
RUN git checkout cb68693de73576cff738a531a65229191351030b
#install decker from the source
RUN make install
#set the encoding on UTF-8, so the parser works correctly, german language is also added for umlaute
#source of fix: https://blog.mkowalski.net/2016/05/16/solving-locale-issues-with-docker-containers/
RUN apt-get install --reinstall -y locales && \
sed -i 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen && \
locale-gen de_DE.UTF-8
ENV LANG de_DE.UTF-8
ENV LANGUAGE de_DE
ENV LC_ALL de_DE.UTF-8
RUN dpkg-reconfigure --frontend noninteractive locales
#cleanup to get a smaller image
RUN apt-get clean autoclean && \
apt-get autoremove -y
#Create a loction for the volume with the decker-files
WORKDIR /
RUN mkdir served-files
#serving Files
CMD [ "sh", "-c", "cd /served-files/; decker server" ]
#open the port for mapping
Expose 8888
# Usage:
Note: On some systems docker may requires super user previliges.
1. Install [Docker](https://docs.docker.com/install/) on your host-OS.
2. Download the `docker` directory.
3. Change the directory to this one: `cd <path/to/dir/docker>`
4. Put your sildes in the `served-files` directory.
5. Run: `docker build -t decker .` to build the image.
6. Run: `docker run -d -p 80:8888 -v "$PWD"/served-files:/served-files --name my-decker decker` to run the image in a container.
Now you have the slides on your [localhost](http://localhost).
## How it works:
Decker with all dependencies runs in a Docker-container.
The `served-files` is mounted as a volume in the Docker-container.
# This a test
- It seems that the Server is working :)
# Your silde could be here
- Copy your Decker-files to the ´servedFiles´
- Restart the Container
......@@ -4,9 +4,7 @@ A markdown based tool for slide deck creation.
## Installation
Pick a [published
release](../../releases), download and
unpack:
Pick a [published release](), download and unpack:
``` {.sh}
gunzip decker.gz
......
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment