Skip to content

Commit

Permalink
fix: Make entrypoint gitlab friendly
Browse files Browse the repository at this point in the history
  • Loading branch information
cliedeman authored and christophwitzko committed Nov 16, 2021
1 parent 2950bd6 commit 7a0d1f2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
FROM alpine
ARG VERSION

ADD ./docker/entrypoint.sh /usr/local/bin/docker-entrypoint
RUN apk update && apk add --no-cache git ca-certificates && update-ca-certificates
COPY "./bin/semantic-release_v${VERSION}_linux_amd64" /usr/local/bin/semantic-release

ENTRYPOINT ["semantic-release"]
ENTRYPOINT ["docker-entrypoint"]
14 changes: 14 additions & 0 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh
set -e

if [ "$GITLAB_CI" == "true" ]; then
# Gitlab CI environment detected, skipping entrypoint
exit 0
fi

if [ "$1" == "semantic-release" ]; then
# remove first argument
shift 1
fi

exec semantic-release "$@"

0 comments on commit 7a0d1f2

Please sign in to comment.