Skip to content

Commit ccb8fd8

Browse files
authored
Upload host linux artifacts as .tar.gz to preserve file permissions (#11357)
1 parent 6015892 commit ccb8fd8

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

eng/ci/templates/official/jobs/build-artifacts-linux.yml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ jobs:
66
project: src/WebJobs.Script.WebHost/WebJobs.Script.WebHost.csproj
77
configuration: release
88
runtime: linux-x64
9+
intermediate_path: $(Agent.TempDirectory)/linux_host
910
drop_path: $(Build.ArtifactStagingDirectory)
1011
linux_drop_path: $(drop_path)/linux
1112
build_args: '-v m -c $(configuration) -r $(runtime) --self-contained true --no-restore'
@@ -48,7 +49,7 @@ jobs:
4849
zipAfterPublish: false # we use our own zip logic
4950
modifyOutputPath: false
5051
projects: $(project)
51-
arguments: '$(build_args) -f net6.0 -p:MinorVersionPrefix=6 -o $(linux_drop_path)/host_net6.0'
52+
arguments: '$(build_args) -f net6.0 -p:MinorVersionPrefix=6 -o $(intermediate_path)/net6.0'
5253

5354
- task: DotNetCoreCLI@2
5455
displayName: Publish (net8.0)
@@ -59,4 +60,24 @@ jobs:
5960
zipAfterPublish: false # we use our own zip logic
6061
modifyOutputPath: false
6162
projects: $(project)
62-
arguments: '$(build_args) -f net8.0 -p:MinorVersionPrefix=8 -o $(linux_drop_path)/host_net8.0'
63+
arguments: '$(build_args) -f net8.0 -p:MinorVersionPrefix=8 -o $(intermediate_path)/net8.0'
64+
65+
# Pipeline artifacts do not retain file metadata and lose file permission bits.
66+
# As a workaround, we tar/gzip the files to retain the permission bits.
67+
- task: ArchiveFiles@2
68+
displayName: Archive Linux Artifacts
69+
inputs:
70+
rootFolderOrFile: $(intermediate_path)/net6.0
71+
includeRootFolder: false
72+
archiveType: tar
73+
tarCompression: gz
74+
archiveFile: $(linux_drop_path)/host.linux-x64.net6.tar.gz
75+
76+
- task: ArchiveFiles@2
77+
displayName: Archive Linux Artifacts
78+
inputs:
79+
rootFolderOrFile: $(intermediate_path)/net8.0
80+
includeRootFolder: false
81+
archiveType: tar
82+
tarCompression: gz
83+
archiveFile: $(linux_drop_path)/host.linux-x64.net8.tar.gz

0 commit comments

Comments
 (0)