Skip to content

Commit

Permalink
update build version image
Browse files Browse the repository at this point in the history
  • Loading branch information
WeihanLi committed Dec 3, 2024
1 parent 128e1f5 commit d0a4a74
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 1 addition & 3 deletions .azure/pipelines/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ steps:

- script: |
dotnet tool install -g dotnet-execute
dotnet-exec ./build/getVersion.cs
echo $RELEASE_VERSION
docker buildx build --push -f Dockerfile --platform="linux/amd64,linux/arm64" --output="type=image" -t weihanli/dotnet-httpie:$(RELEASE_VERSION) .
dotnet-exec ./build/build-version-image.cs
displayName: 'Push versioned image'
# condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))

Expand Down
3 changes: 2 additions & 1 deletion build/getVersion.cs → build/build-version-image.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
var version = $"{propertyGroupNode.Element("VersionMajor").Value}.{propertyGroupNode.Element("VersionMinor").Value}.{propertyGroupNode.Element("VersionPatch").Value}";
Console.WriteLine($"Version: {version}");

Environment.SetEnvironmentVariable("RELEASE_VERSION", version);
var dockerBuildCommand = $"""docker buildx build --push -f Dockerfile --platform="linux/amd64,linux/arm64" --output="type=image" -t weihanli/dotnet-httpie:{version} .""";
CommandExecutor.ExecuteCommandAndOutput(dockerBuildCommand);

0 comments on commit d0a4a74

Please sign in to comment.