trying to add version to app

bump php and composer version in docker image
This commit is contained in:
2023-12-26 10:55:35 +07:00
parent 3433be1e79
commit 91b50b08e2
3 changed files with 12 additions and 3 deletions

7
.github/Dockerfile vendored
View File

@@ -1,5 +1,6 @@
ARG PHP_VERSION=8.2.11 ARG PHP_VERSION=8.2.13
ARG COMPOSER_VERSION=2.6.5 ARG COMPOSER_VERSION=2.6.6
ARG MERGER_VERSION=dev-master
FROM composer:${COMPOSER_VERSION} as composer FROM composer:${COMPOSER_VERSION} as composer
@@ -15,4 +16,6 @@ RUN composer update --no-dev
COPY merger merger COPY merger merger
COPY src src COPY src src
ENV MERGER_VERSION=${MERGER_VERSION}
ENTRYPOINT ["/app/merger"] ENTRYPOINT ["/app/merger"]

View File

@@ -18,6 +18,7 @@ jobs:
--build-arg BUILDKIT_INLINE_CACHE=1 \ --build-arg BUILDKIT_INLINE_CACHE=1 \
--build-arg PHP_VERSION=${{ vars.DOCKER_RUNTIME_PHP_VERSION }} \ --build-arg PHP_VERSION=${{ vars.DOCKER_RUNTIME_PHP_VERSION }} \
--build-arg COMPOSER_VERSION=${{ vars.DOCKER_RUNTIME_COMPOSER_VERSION }} \ --build-arg COMPOSER_VERSION=${{ vars.DOCKER_RUNTIME_COMPOSER_VERSION }} \
--build-arg MERGER_VERSION=${{ github.ref_name }} \
--target=runtime \ --target=runtime \
--tag=dannecron/coverage-merger:${{ github.ref_name }} \ --tag=dannecron/coverage-merger:${{ github.ref_name }} \
--file=./.github/Dockerfile . --file=./.github/Dockerfile .

7
merger
View File

@@ -27,7 +27,12 @@ if (isset($GLOBALS['_composer_autoload_path'])) {
unset($knownAutoloadPaths, $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 { $app->onException(static function (\Throwable $exception, int $exitCode) use ($app): void {
$io = $app->io(); $io = $app->io();