From d08aad03de2db17b8f90bfbec8c7430960db9279 Mon Sep 17 00:00:00 2001 From: Weihan Li Date: Tue, 3 Dec 2024 08:44:31 +0800 Subject: [PATCH] update docker pipeline --- .azure/pipelines/docker.yml | 4 ++++ build/build-version-image.cs | 1 + 2 files changed, 5 insertions(+) diff --git a/.azure/pipelines/docker.yml b/.azure/pipelines/docker.yml index cdbab32..0647485 100644 --- a/.azure/pipelines/docker.yml +++ b/.azure/pipelines/docker.yml @@ -46,6 +46,10 @@ steps: - script: | dotnet tool install -g dotnet-execute + dotnet-exec info + displayName: 'dotnet-exec' + +- script: | dotnet-exec ./build/build-version-image.cs displayName: 'Push versioned image' condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main')) diff --git a/build/build-version-image.cs b/build/build-version-image.cs index b680596..3e41896 100644 --- a/build/build-version-image.cs +++ b/build/build-version-image.cs @@ -6,4 +6,5 @@ Console.WriteLine($"Version: {version}"); var dockerBuildCommand = $"""docker buildx build --push -f Dockerfile --platform="linux/amd64,linux/arm64" --output="type=image" -t weihanli/dotnet-httpie:{version} ."""; +Console.WriteLine($"Executing command: {dockerBuildCommand}"); CommandExecutor.ExecuteCommandAndOutput(dockerBuildCommand);