Skip to content
Snippets Groups Projects
Commit 07e22b39 authored by Nicolas Pernoud's avatar Nicolas Pernoud
Browse files

feat: added Gitlab CI

parents
Branches
Tags
No related merge requests found
image: docker:git
services:
- docker:dind
variables:
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
stages:
- build
build-master:
stage: build
script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- DOCKER_BUILDKIT=1 docker build --pull -t "$CI_REGISTRY_IMAGE" .
- docker push "$CI_REGISTRY_IMAGE"
only:
- master
build:
stage: build
script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- DOCKER_BUILDKIT=1 docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" .
- docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
except:
- master
#
# Build stage
#
FROM debian:buster as build-env
RUN apt-get update && apt-get install -y python3-pip wget
RUN pip3 install pandoc-plantuml-filter
# make slim-jdk
RUN wget https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_linux-x64_bin.tar.gz -P /tmp/
RUN tar xfvz /tmp/openjdk-11.0.2_linux-x64_bin.tar.gz -C /tmp/
RUN /tmp/jdk-11.0.2/bin/jlink --output /opt/openjdk-11-slim \
--add-modules java.base,java.datatransfer,java.desktop,java.logging,java.prefs,java.scripting,java.xml
# make plant UML
RUN mkdir -p /opt/plantuml/
RUN wget https://managedway.dl.sourceforge.net/project/plantuml/plantuml.jar -P /opt/plantuml/
RUN echo '#!/bin/bash\n\
/opt/openjdk-11-slim/bin/java -jar /opt/plantuml/plantuml.jar $@' > /usr/bin/plantuml
RUN chmod a+x /usr/bin/plantuml
#
# Run stage
#
FROM debian:buster as setup-env
RUN apt-get update && apt-get install -y python3 pandoc graphviz libfreetype6 fontconfig \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN ln -s /usr/bin/python3 /usr/bin/python
COPY --from=build-env /usr/local/lib/python3.7/dist-packages/ /usr/local/lib/python3.7/dist-packages/
COPY --from=build-env /usr/bin/plantuml /usr/bin/plantuml
COPY --from=build-env /usr/local/bin/pandoc-plantuml /usr/local/bin/pandoc-plantuml
COPY --from=build-env /opt/plantuml/ /opt/plantuml/
COPY --from=build-env /opt/openjdk-11-slim/ /opt/openjdk-11-slim/
WORKDIR /var/docs/
ENTRYPOINT ["pandoc", "--filter", "pandoc-plantuml"]
\ No newline at end of file
# docker-pandoc-with-plantuml
This is pandoc image with PlantUML.
Forked from https://github.com/koduki/docker-pandoc-with-plantuml
## Setup
```bash
docker pull koduki/pandoc
alias pandoc="docker run -it -v `pwd`:/var/docs koduki/pandoc"
```
## Generate HTML with SVG
```bash
pandoc examples/input.md -o test.html
```
## Examples
### List
- list 1
- list 2
- list 3
### Table
| Right | Left | Default | Center |
| ----: | :--- | ------- | :----: |
| 12 | 12 | 12 | 12 |
| 123 | 123 | 123 | 123 |
| 1 | 1 | 1 | 1 |
### PlantUML Example
#### Sequence Diagram
```plantuml
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response
Alice -> Bob: Another authentication Request
Alice <-- Bob: another authentication Response
```
#### ER Diagrams
```plantuml
entity "entity1" {
id
--
attribute
}
entity "entity 2" as entity2 {
id
--
entity1_id
}
entity1 -----{ entity2
```
## Ref
- [Pandoc](https://pandoc.org/)
- [PlantUML](http://plantuml.com/)
- [pandoc-plantuml-filter](https://github.com/timofurrer/pandoc-plantuml-filter)
- [Markdown Preview Enhanced](https://shd101wyy.github.io/markdown-preview-enhanced/#/)
Makrdown Sample
=========
This is example for Markdown with UML and ER diagram.
## List
- list 1
- list 2
- list 3
## Table
|Right | Left |Default |Center |
|------:|:-----|---------|:------:|
| 12 | 12 | 12 | 12 |
| 123 | 123 | 123 | 123 |
| 1 | 1 | 1 | 1 |
## PlantUML Examples
### Sequence Diagram
```plantuml
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response
Alice -> Bob: Another authentication Request
Alice <-- Bob: another authentication Response
```
### ER Diagrams
```plantuml
entity "entity1" {
id
--
attribute
}
entity "entity 2" as entity2 {
id
--
entity1_id
}
entity1 -----{ entity2
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment