Skip to content

feat: use docker entrypoint #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ RUN ["pip", "install", "-U", "--no-cache-dir", "pip"]
ARG CZ_VERSION=2.28.0
RUN pip install --no-cache-dir commitizen==$CZ_VERSION

CMD [ "cz", "version" ]
ENTRYPOINT ["cz"]

CMD [ "version" ]
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ This repo checks daily for the latest version and tries to publish it.
## As Script

```bash
docker run --rm -v $(pwd):/app commitizen/commitizen:latest /bin/sh -c 'cz bump --changelog'
docker run --rm \
-v $(pwd):/app \
commitizen/commitizen:latest \
bump --changelog
```

## Inside container
Expand All @@ -34,7 +37,10 @@ Open a terminal inside docker with `cz` available and with the current directory
This way we can run any `cz` command.

```bash
docker run --rm -it -v $(pwd):/app commitizen/commitizen:latest
docker run --rm -it \
--entrypoint /bin/sh \
-v $(pwd):/app \
commitizen/commitizen:latest
```

## Contributing
Expand All @@ -50,5 +56,5 @@ docker run --rm -it -v $(pwd):/app commitizen/commitizen:latest

```bash
./scripts/build
./scripts/run 'cz ls'
./scripts/cz ls
```
2 changes: 1 addition & 1 deletion scripts/run → scripts/cz
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/sh -ex
docker run --rm --name commitizen registry.hub.docker.com/commitizen/commitizen:3 /bin/sh -c "$@"
docker run --rm --name commitizen registry.hub.docker.com/commitizen/commitizen:3 "$@"