Skip to content

Commit

Permalink
Publish new version to PyPI & Docker Hub
Browse files Browse the repository at this point in the history
  • Loading branch information
hunyadi committed Oct 1, 2024
1 parent eb8447d commit d9a4183
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"cSpell.words": [
"blockquote",
"levelname",
"leventehunyadi",
"mdignore",
"mmdc",
"scandir",
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,13 @@ You can run the Docker container via `docker run` or via `Dockerfile`. Either ca
With `docker run`, you can pass Confluence domain, user, API and space key directly to `docker run`:

```sh
docker run --rm --name md2conf -v $(pwd):/data hunyadi/md2conf -d instructure.atlassian.net -u levente.hunyadi@instructure.com -a 0123456789abcdef -s DAP ./
docker run --rm --name md2conf -v $(pwd):/data leventehunyadi/md2conf:latest -d instructure.atlassian.net -u levente.hunyadi@instructure.com -a 0123456789abcdef -s DAP ./
```

Alternatively, you can use a separate file `.env` to pass these parameters as environment variables:

```sh
docker run --rm --env-file .env --name md2conf -v $(pwd):/data hunyadi/md2conf ./
docker run --rm --env-file .env --name md2conf -v $(pwd):/data leventehunyadi/md2conf:latest ./
```

In each case, `-v $(pwd):/data` maps the current directory to Docker container's `WORKDIR` such *md2conf* can scan files and directories in the local file system.
Expand All @@ -193,7 +193,7 @@ Note that the entry point for the Docker container's base image is `ENTRYPOINT [
With the `Dockerfile` approach, you can extend the base image:

```Dockerfile
FROM hunyadi/md2conf:latest
FROM leventehunyadi/md2conf:latest

ENV CONFLUENCE_DOMAIN='instructure.atlassian.net'
ENV CONFLUENCE_PATH='/wiki/'
Expand All @@ -207,7 +207,7 @@ CMD ["./"]
Alternatively,

```Dockerfile
FROM hunyadi/md2conf:latest
FROM leventehunyadi/md2conf:latest

CMD ["-d", "instructure.atlassian.net", "-u", "levente.hunyadi@instructure.com", "-a", "0123456789abcdef", "-s", "DAP", "./"]
```
2 changes: 1 addition & 1 deletion md2conf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Confluence API endpoints to upload images and content.
"""

__version__ = "0.2.1"
__version__ = "0.2.2"
__author__ = "Levente Hunyadi"
__copyright__ = "Copyright 2022-2024, Levente Hunyadi"
__license__ = "MIT"
Expand Down
5 changes: 3 additions & 2 deletions package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ if [ -d *.egg-info ]; then rm -rf *.egg-info; fi
# create PyPI package for distribution
$PYTHON -m build

docker build -f Dockerfile -t md2conf-image .
docker run -i -t --rm --env-file .env --name md2conf -v $(pwd):/data md2conf-image sample/index.md --ignore-invalid-url
VERSION=`$PYTHON -c "from md2conf import __version__; print(__version__)"`
docker build -f Dockerfile -t leventehunyadi/md2conf:latest -t leventehunyadi/md2conf:$VERSION .
docker run -i -t --rm --env-file .env --name md2conf -v $(pwd):/data leventehunyadi/md2conf:latest sample/index.md --ignore-invalid-url

# test PyPI package with various Python versions
# pass environment variables from the file `.env`
Expand Down

0 comments on commit d9a4183

Please sign in to comment.