Skip to content

Commit

Permalink
add entrypoint script
Browse files Browse the repository at this point in the history
  • Loading branch information
robdefeo committed Feb 19, 2020
1 parent 4b4b359 commit 8d15722
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ RUN apt-get update && \
apt-get install -y docker-ce \
docker-ce-cli

CMD ["goreleaser", "-v"]
ENTRYPOINT ["/entrypoint.sh"]
CMD ["-h"]
17 changes: 17 additions & 0 deletions scripts/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

if [ -n "$DOCKER_USERNAME" ] && [ -n "$DOCKER_PASSWORD" ]; then
echo "Login to the docker..."
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD $DOCKER_REGISTRY
fi

# Workaround for github actions when access to different repositories is needed.
# Github actions provides a GITHUB_TOKEN secret that can only access the current
# repository and you cannot configure it's value.
# Access to different repositories is needed by brew for example.

if [ -n "$GORELEASER_GITHUB_TOKEN" ] ; then
export GITHUB_TOKEN=$GORELEASER_GITHUB_TOKEN
fi

goreleaser $@

0 comments on commit 8d15722

Please sign in to comment.