Skip to content

Commit

Permalink
update docker pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
WeihanLi committed Dec 3, 2024
1 parent cbd9d17 commit d08aad0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .azure/pipelines/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down
1 change: 1 addition & 0 deletions build/build-version-image.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

0 comments on commit d08aad0

Please sign in to comment.