-
Notifications
You must be signed in to change notification settings - Fork 80
Expand file tree
/
Copy pathpackage.sh
More file actions
executable file
·30 lines (24 loc) · 1.12 KB
/
Copy pathpackage.sh
File metadata and controls
executable file
·30 lines (24 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env sh
#
# Publish Markdown files to Confluence wiki.
#
# Copyright 2022-2026, Levente Hunyadi
# https://github.com/hunyadi/md2conf
#
# Builds a Python package and runs unit tests in Docker
#
set -e
PYTHON_EXECUTABLE=${PYTHON:-python3}
# clean up output from previous runs
if [ -d dist ]; then rm -rf dist; fi
if [ -d *.egg-info ]; then rm -rf *.egg-info; fi
# create PyPI package for distribution
$PYTHON_EXECUTABLE -m build --sdist --wheel
# build Docker image
VERSION=`$PYTHON_EXECUTABLE -c "from md2conf import __version__; print(__version__)"`
docker build -f Dockerfile -t leventehunyadi/md2conf:latest -t leventehunyadi/md2conf:$VERSION .
# run Docker image with Markdown input files containing diagrams to produce PNG/SVG output
# pass environment variables from the file `.env`
FILES="tests/source/mermaid.md tests/source/plantuml.md"
docker run -i -t --rm --env-file .env --name md2conf -v $(pwd):/data leventehunyadi/md2conf:latest --local --diagram-output-format=png $FILES
docker run -i -t --rm --env-file .env --name md2conf -v $(pwd):/data leventehunyadi/md2conf:latest --local --diagram-output-format=svg $FILES