Skip to content

Commit

Permalink
Improve docker labels and move safe git dir to entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
williamdes committed Jul 5, 2024
1 parent 3ea35ae commit 187a98c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
18 changes: 16 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
RUN apk add --no-cache --update git && \
git --version && \
composer --version && \
git config --global --add safe.directory /github/workspace && \
COMPOSER_BIN_DIR="/usr/bin" composer global require --no-cache scrutinizer/ocular:${RELEASE_VERSION} && \
composer global show scrutinizer/ocular 2>/dev/null && \
RELEASE_VERSION="$(php -r "require_once '/root/.composer/vendor/autoload.php';echo \Composer\InstalledVersions::getVersion('scrutinizer/ocular');")" && \
Expand All @@ -34,6 +33,21 @@ LABEL org.label-schema.vendor="Sudo-Bot" \
org.label-schema.vcs-url="https://github.com/sudo-bot/action-scrutinizer.git" \
org.label-schema.vcs-ref=${VCS_REF} \
org.label-schema.build-date=${BUILD_DATE} \
org.label-schema.docker.schema-version="1.0"
org.label-schema.docker.schema-version="1.0" \
\
com.docker.extension.publisher-url="https://github.com/wdes" \
\
org.opencontainers.image.title="Scrutinizer coverage action" \
org.opencontainers.image.description="Scrutinizer coverage action for GitHub actions" \
org.opencontainers.image.authors="[email protected]" \
org.opencontainers.image.url="https://github.com/sudo-bot/action-scrutinizer#readme" \
org.opencontainers.image.documentation="https://github.com/sudo-bot/action-scrutinizer#readme" \
org.opencontainers.image.source="https://github.com/sudo-bot/action-scrutinizer" \
org.opencontainers.image.vendor="Sudo-Bot" \
org.opencontainers.image.licenses="MPL-2.0" \
org.opencontainers.image.created=${BUILD_DATE} \
org.opencontainers.image.version=${RELEASE_VERSION} \
org.opencontainers.image.revision=${VCS_REF} \
org.opencontainers.image.ref.name="latest"

ENTRYPOINT ["/entrypoint.sh"]
5 changes: 4 additions & 1 deletion docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
#!/bin/sh -l

##
# @license http://unlicense.org/UNLICENSE The UNLICENSE
# @author William Desportes <[email protected]>
##

set -e
set -eu

CLI_ARGS="$1"

echo "::debug CLI_ARGS: ${CLI_ARGS}"

git config --global --add safe.directory $PWD

ocular code-coverage:upload ${CLI_ARGS}

0 comments on commit 187a98c

Please sign in to comment.