From 91b50b08e2eb58740bf02b49884c50a8c7368472 Mon Sep 17 00:00:00 2001 From: dannc Date: Tue, 26 Dec 2023 10:55:35 +0700 Subject: [PATCH] trying to add version to app bump php and composer version in docker image --- .github/Dockerfile | 7 +++++-- .github/workflows/ci-tags.yml | 1 + merger | 7 ++++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/Dockerfile b/.github/Dockerfile index 351f47d..748ba24 100644 --- a/.github/Dockerfile +++ b/.github/Dockerfile @@ -1,5 +1,6 @@ -ARG PHP_VERSION=8.2.11 -ARG COMPOSER_VERSION=2.6.5 +ARG PHP_VERSION=8.2.13 +ARG COMPOSER_VERSION=2.6.6 +ARG MERGER_VERSION=dev-master FROM composer:${COMPOSER_VERSION} as composer @@ -15,4 +16,6 @@ RUN composer update --no-dev COPY merger merger COPY src src +ENV MERGER_VERSION=${MERGER_VERSION} + ENTRYPOINT ["/app/merger"] diff --git a/.github/workflows/ci-tags.yml b/.github/workflows/ci-tags.yml index 3abc9b6..9fac587 100644 --- a/.github/workflows/ci-tags.yml +++ b/.github/workflows/ci-tags.yml @@ -18,6 +18,7 @@ jobs: --build-arg BUILDKIT_INLINE_CACHE=1 \ --build-arg PHP_VERSION=${{ vars.DOCKER_RUNTIME_PHP_VERSION }} \ --build-arg COMPOSER_VERSION=${{ vars.DOCKER_RUNTIME_COMPOSER_VERSION }} \ + --build-arg MERGER_VERSION=${{ github.ref_name }} \ --target=runtime \ --tag=dannecron/coverage-merger:${{ github.ref_name }} \ --file=./.github/Dockerfile . diff --git a/merger b/merger index 54538cb..d86f779 100755 --- a/merger +++ b/merger @@ -27,7 +27,12 @@ if (isset($GLOBALS['_composer_autoload_path'])) { unset($knownAutoloadPaths, $path); } -$app = new \Ahc\Cli\Application('clover-merger', '0.1.0'); +$appVersion = \getenv('MERGER_VERSION'); +if ($appVersion === false) { + $appVersion = 'dev'; +} + +$app = new \Ahc\Cli\Application('clover-merger', $appVersion); $app->onException(static function (\Throwable $exception, int $exitCode) use ($app): void { $io = $app->io();