Skip to content

Commit 052df04

Browse files
authored
Add publish steps for deb packages (#186)
* Add deb build scripts * Save * save * indent * Update azure-pipelines-linux.yml for Azure Pipelines * Update azure-pipelines-linux.yml for Azure Pipelines * Update azure-pipelines-linux.yml for Azure Pipelines * Update azure-pipelines-linux.yml for Azure Pipelines * Update azure-pipelines-linux.yml for Azure Pipelines * Update azure-pipelines-linux.yml for Azure Pipelines * Update azure-pipelines-linux.yml for Azure Pipelines * Update azure-pipelines-linux.yml for Azure Pipelines * Update azure-pipelines-linux.yml for Azure Pipelines * Update azure-pipelines-linux.yml for Azure Pipelines * Update azure-pipelines-linux.yml for Azure Pipelines * Update azure-pipelines-linux.yml for Azure Pipelines * Update azure-pipelines-linux.yml for Azure Pipelines * Save * Save * save * Add a little doc * test * Update azure-pipelines-linux.yml for Azure Pipelines * Update azure-pipelines-linux.yml for Azure Pipelines * Update azure-pipelines-linux.yml for Azure Pipelines * Update azure-pipelines-linux.yml for Azure Pipelines * Update azure-pipelines-linux.yml for Azure Pipelines * Update azure-pipelines-linux.yml for Azure Pipelines * Update azure-pipelines-linux.yml for Azure Pipelines * Update azure-pipelines-linux.yml for Azure Pipelines * Update azure-pipelines-linux.yml for Azure Pipelines * Update azure-pipelines-linux.yml for Azure Pipelines * Update azure-pipelines-linux.yml for Azure Pipelines * save * Update azure-pipelines-linux.yml for Azure Pipelines * Update azure-pipelines-linux.yml for Azure Pipelines * Update azure-pipelines-linux.yml for Azure Pipelines * save * Change document * Complete doc * Add linking
1 parent a9e31a3 commit 052df04

File tree

4 files changed

+276
-32
lines changed

4 files changed

+276
-32
lines changed

.pipelines/azure-pipelines-linux.yml

Lines changed: 259 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,17 @@ stages:
5555

5656
- script: $(Build.SourcesDirectory)/src/VirtualClient/VirtualClient.Packaging/build-deb-linux-arm64.sh $(VcVersion)
5757
displayName: 'Build deb package for linux arm64'
58+
59+
- task: CopyFiles@2
60+
inputs:
61+
SourceFolder: '$(Build.SourcesDirectory)/out/packages'
62+
Contents: '*.deb'
63+
TargetFolder: '$(Build.ArtifactStagingDirectory)'
5864

5965
- task: EsrpCodeSigning@1
6066
inputs:
6167
ConnectedServiceName: 'virtualclient-esrp'
62-
FolderPath: '$(Build.SourcesDirectory)/out/packages'
68+
FolderPath: '$(Build.ArtifactStagingDirectory)'
6369
Pattern: '*.deb'
6470
signConfigType: 'inlineSignParams'
6571
inlineOperation: |
@@ -78,12 +84,11 @@ stages:
7884

7985
- task: PublishBuildArtifacts@1
8086
inputs:
81-
pathToPublish: '$(Build.SourcesDirectory)/out/packages'
87+
pathToPublish: '$(Build.ArtifactStagingDirectory)'
8288
artifactName: drop
8389

84-
85-
- job: PublishPackage
86-
condition: false
90+
- job: PublishDebPackage
91+
timeoutInMinutes: 180
8792
dependsOn: BuildPackage
8893
pool:
8994
vmImage: 'ubuntu-latest'
@@ -94,19 +99,263 @@ stages:
9499
inputs:
95100
artifactFeeds: 'CRC-Dev'
96101
- script: pip install pmc-cli
102+
103+
- download: current
104+
artifact: drop
105+
106+
- task: CopyFiles@2
107+
inputs:
108+
SourceFolder: '$(Agent.BuildDirectory)/drop/'
109+
Contents: '*.deb'
110+
TargetFolder: '$(Agent.BuildDirectory)/drop/packages'
97111

98112
- task: AzureKeyVault@2
99113
inputs:
100114
ConnectedServiceName: 'VirtualClient-AzureRM-AME'
101115
KeyVaultName: 'junoprod01vault01'
102-
SecretsFilter: 'virtualclient-cert-pem'
116+
SecretsFilter: 'virtualclient'
103117
RunAsPreJob: true
104118

119+
# Debian
120+
- task: PublishLinuxPackagesPMC@0
121+
displayName: 'Debian 12.0 deb publish'
122+
inputs:
123+
profile: 'prod' # or tux-dev or ppe or prod depending on what you selected
124+
msal_SNIAuth: 'msal-sniauth'
125+
msal_cert: $(virtualclient)
126+
msal_client_ID: 'f407a268-1184-4845-92b1-eebfbe0749c0'
127+
package_path: '$(Agent.BuildDirectory)/drop/packages'
128+
repository: 'microsoft-debian-bookworm-prod-apt'
129+
release: 'bookworm'
130+
131+
- task: PublishLinuxPackagesPMC@0
132+
displayName: 'Debian 11.0 deb publish'
133+
inputs:
134+
profile: 'prod' # or tux-dev or ppe or prod depending on what you selected
135+
msal_SNIAuth: 'msal-sniauth'
136+
msal_cert: $(virtualclient)
137+
msal_client_ID: 'f407a268-1184-4845-92b1-eebfbe0749c0'
138+
package_path: '$(Agent.BuildDirectory)/drop/packages'
139+
repository: 'microsoft-debian-bullseye-prod-apt'
140+
release: 'bullseye'
141+
142+
- task: PublishLinuxPackagesPMC@0
143+
displayName: 'Debian 10.0 deb publish'
144+
inputs:
145+
profile: 'prod' # or tux-dev or ppe or prod depending on what you selected
146+
msal_SNIAuth: 'msal-sniauth'
147+
msal_cert: $(virtualclient)
148+
msal_client_ID: 'f407a268-1184-4845-92b1-eebfbe0749c0'
149+
package_path: '$(Agent.BuildDirectory)/drop/packages'
150+
repository: 'microsoft-debian-buster-prod-apt'
151+
release: 'buster'
152+
153+
- task: PublishLinuxPackagesPMC@0
154+
displayName: 'Debian 8.0 deb publish'
155+
inputs:
156+
profile: 'prod' # or tux-dev or ppe or prod depending on what you selected
157+
msal_SNIAuth: 'msal-sniauth'
158+
msal_cert: $(virtualclient)
159+
msal_client_ID: 'f407a268-1184-4845-92b1-eebfbe0749c0'
160+
package_path: '$(Agent.BuildDirectory)/drop/packages'
161+
repository: 'microsoft-debian-jessie-prod-apt'
162+
release: 'jessie'
163+
164+
- task: PublishLinuxPackagesPMC@0
165+
displayName: 'Debian 9.0 deb publish'
166+
inputs:
167+
profile: 'prod' # or tux-dev or ppe or prod depending on what you selected
168+
msal_SNIAuth: 'msal-sniauth'
169+
msal_cert: $(virtualclient)
170+
msal_client_ID: 'f407a268-1184-4845-92b1-eebfbe0749c0'
171+
package_path: '$(Agent.BuildDirectory)/drop/packages'
172+
repository: 'microsoft-debian-stretch-prod-apt'
173+
release: 'stretch'
174+
175+
# Ubuntu
176+
- task: PublishLinuxPackagesPMC@0
177+
displayName: 'Ubuntu 17.10 deb publish'
178+
inputs:
179+
profile: 'prod' # or tux-dev or ppe or prod depending on what you selected
180+
msal_SNIAuth: 'msal-sniauth'
181+
msal_cert: $(virtualclient)
182+
msal_client_ID: 'f407a268-1184-4845-92b1-eebfbe0749c0'
183+
package_path: '$(Agent.BuildDirectory)/drop/packages'
184+
repository: 'microsoft-ubuntu-artful-prod-apt'
185+
release: 'artful'
186+
187+
- task: PublishLinuxPackagesPMC@0
188+
displayName: 'Ubuntu 18.04 deb publish'
189+
inputs:
190+
profile: 'prod' # or tux-dev or ppe or prod depending on what you selected
191+
msal_SNIAuth: 'msal-sniauth'
192+
msal_cert: $(virtualclient)
193+
msal_client_ID: 'f407a268-1184-4845-92b1-eebfbe0749c0'
194+
package_path: '$(Agent.BuildDirectory)/drop/packages'
195+
repository: 'microsoft-ubuntu-bionic-prod-apt'
196+
release: 'bionic'
197+
198+
- task: PublishLinuxPackagesPMC@0
199+
displayName: 'Ubuntu 18.10 deb publish'
200+
inputs:
201+
profile: 'prod' # or tux-dev or ppe or prod depending on what you selected
202+
msal_SNIAuth: 'msal-sniauth'
203+
msal_cert: $(virtualclient)
204+
msal_client_ID: 'f407a268-1184-4845-92b1-eebfbe0749c0'
205+
package_path: '$(Agent.BuildDirectory)/drop/packages'
206+
repository: 'microsoft-ubuntu-cosmic-prod-apt'
207+
release: 'cosmic'
208+
209+
- task: PublishLinuxPackagesPMC@0
210+
displayName: 'Ubuntu 19.04 deb publish'
211+
inputs:
212+
profile: 'prod' # or tux-dev or ppe or prod depending on what you selected
213+
msal_SNIAuth: 'msal-sniauth'
214+
msal_cert: $(virtualclient)
215+
msal_client_ID: 'f407a268-1184-4845-92b1-eebfbe0749c0'
216+
package_path: '$(Agent.BuildDirectory)/drop/packages'
217+
repository: 'microsoft-ubuntu-disco-prod-apt'
218+
release: 'disco'
219+
220+
- task: PublishLinuxPackagesPMC@0
221+
displayName: 'Ubuntu 19.10 deb publish'
222+
inputs:
223+
profile: 'prod' # or tux-dev or ppe or prod depending on what you selected
224+
msal_SNIAuth: 'msal-sniauth'
225+
msal_cert: $(virtualclient)
226+
msal_client_ID: 'f407a268-1184-4845-92b1-eebfbe0749c0'
227+
package_path: '$(Agent.BuildDirectory)/drop/packages'
228+
repository: 'microsoft-ubuntu-eoan-prod-apt'
229+
release: 'eoan'
230+
231+
- task: PublishLinuxPackagesPMC@0
232+
displayName: 'Ubuntu 20.04 deb publish'
233+
inputs:
234+
profile: 'prod' # or tux-dev or ppe or prod depending on what you selected
235+
msal_SNIAuth: 'msal-sniauth'
236+
msal_cert: $(virtualclient)
237+
msal_client_ID: 'f407a268-1184-4845-92b1-eebfbe0749c0'
238+
package_path: '$(Agent.BuildDirectory)/drop/packages'
239+
repository: 'microsoft-ubuntu-focal-prod-apt'
240+
release: 'focal'
241+
242+
- task: PublishLinuxPackagesPMC@0
243+
displayName: 'Ubuntu 20.10 deb publish'
244+
inputs:
245+
profile: 'prod' # or tux-dev or ppe or prod depending on what you selected
246+
msal_SNIAuth: 'msal-sniauth'
247+
msal_cert: $(virtualclient)
248+
msal_client_ID: 'f407a268-1184-4845-92b1-eebfbe0749c0'
249+
package_path: '$(Agent.BuildDirectory)/drop/packages'
250+
repository: 'microsoft-ubuntu-groovy-prod-apt'
251+
release: 'groovy'
252+
253+
- task: PublishLinuxPackagesPMC@0
254+
displayName: 'Ubuntu 21.04 deb publish'
255+
inputs:
256+
profile: 'prod' # or tux-dev or ppe or prod depending on what you selected
257+
msal_SNIAuth: 'msal-sniauth'
258+
msal_cert: $(virtualclient)
259+
msal_client_ID: 'f407a268-1184-4845-92b1-eebfbe0749c0'
260+
package_path: '$(Agent.BuildDirectory)/drop/packages'
261+
repository: 'microsoft-ubuntu-hirsute-prod-apt'
262+
release: 'hirsute'
263+
264+
- task: PublishLinuxPackagesPMC@0
265+
displayName: 'Ubuntu 21.10 deb publish'
266+
inputs:
267+
profile: 'prod' # or tux-dev or ppe or prod depending on what you selected
268+
msal_SNIAuth: 'msal-sniauth'
269+
msal_cert: $(virtualclient)
270+
msal_client_ID: 'f407a268-1184-4845-92b1-eebfbe0749c0'
271+
package_path: '$(Agent.BuildDirectory)/drop/packages'
272+
repository: 'microsoft-ubuntu-impish-prod-apt'
273+
release: 'impish'
274+
275+
- task: PublishLinuxPackagesPMC@0
276+
displayName: 'Ubuntu 22.04 deb publish'
277+
inputs:
278+
profile: 'prod' # or tux-dev or ppe or prod depending on what you selected
279+
msal_SNIAuth: 'msal-sniauth'
280+
msal_cert: $(virtualclient)
281+
msal_client_ID: 'f407a268-1184-4845-92b1-eebfbe0749c0'
282+
package_path: '$(Agent.BuildDirectory)/drop/packages'
283+
repository: 'microsoft-ubuntu-jammy-prod-apt'
284+
release: 'jammy'
285+
286+
- task: PublishLinuxPackagesPMC@0
287+
displayName: 'Ubuntu 22.10 deb publish'
288+
inputs:
289+
profile: 'prod' # or tux-dev or ppe or prod depending on what you selected
290+
msal_SNIAuth: 'msal-sniauth'
291+
msal_cert: $(virtualclient)
292+
msal_client_ID: 'f407a268-1184-4845-92b1-eebfbe0749c0'
293+
package_path: '$(Agent.BuildDirectory)/drop/packages'
294+
repository: 'microsoft-ubuntu-kinetic-prod-apt'
295+
release: 'kinetic'
296+
297+
- task: PublishLinuxPackagesPMC@0
298+
displayName: 'Ubuntu 23.04 deb publish'
299+
inputs:
300+
profile: 'prod' # or tux-dev or ppe or prod depending on what you selected
301+
msal_SNIAuth: 'msal-sniauth'
302+
msal_cert: $(virtualclient)
303+
msal_client_ID: 'f407a268-1184-4845-92b1-eebfbe0749c0'
304+
package_path: '$(Agent.BuildDirectory)/drop/packages'
305+
repository: 'microsoft-ubuntu-lunar-prod-apt'
306+
release: 'lunar'
307+
308+
- task: PublishLinuxPackagesPMC@0
309+
displayName: 'Ubuntu 14.04 deb publish'
310+
inputs:
311+
profile: 'prod' # or tux-dev or ppe or prod depending on what you selected
312+
msal_SNIAuth: 'msal-sniauth'
313+
msal_cert: $(virtualclient)
314+
msal_client_ID: 'f407a268-1184-4845-92b1-eebfbe0749c0'
315+
package_path: '$(Agent.BuildDirectory)/drop/packages'
316+
repository: 'microsoft-ubuntu-trusty-prod-apt'
317+
release: 'trusty'
318+
319+
- task: PublishLinuxPackagesPMC@0
320+
displayName: 'Ubuntu 15.10 deb publish'
321+
inputs:
322+
profile: 'prod' # or tux-dev or ppe or prod depending on what you selected
323+
msal_SNIAuth: 'msal-sniauth'
324+
msal_cert: $(virtualclient)
325+
msal_client_ID: 'f407a268-1184-4845-92b1-eebfbe0749c0'
326+
package_path: '$(Agent.BuildDirectory)/drop/packages'
327+
repository: 'microsoft-ubuntu-wily-prod-apt'
328+
release: 'wily'
329+
330+
- task: PublishLinuxPackagesPMC@0
331+
displayName: 'Ubuntu 16.04 deb publish'
332+
inputs:
333+
profile: 'prod' # or tux-dev or ppe or prod depending on what you selected
334+
msal_SNIAuth: 'msal-sniauth'
335+
msal_cert: $(virtualclient)
336+
msal_client_ID: 'f407a268-1184-4845-92b1-eebfbe0749c0'
337+
package_path: '$(Agent.BuildDirectory)/drop/packages'
338+
repository: 'microsoft-ubuntu-xenial-prod-apt'
339+
release: 'xenial'
340+
341+
- task: PublishLinuxPackagesPMC@0
342+
displayName: 'Ubuntu 16.10 deb publish'
343+
inputs:
344+
profile: 'prod' # or tux-dev or ppe or prod depending on what you selected
345+
msal_SNIAuth: 'msal-sniauth'
346+
msal_cert: $(virtualclient)
347+
msal_client_ID: 'f407a268-1184-4845-92b1-eebfbe0749c0'
348+
package_path: '$(Agent.BuildDirectory)/drop/packages'
349+
repository: 'microsoft-ubuntu-yakkety-prod-apt'
350+
release: 'yakkety'
351+
105352
- task: PublishLinuxPackagesPMC@0
353+
displayName: 'Ubuntu 17.04 deb publish'
106354
inputs:
107-
profile: 'ppe' # or tux-dev or ppe or prod depending on what you selected
355+
profile: 'prod' # or tux-dev or ppe or prod depending on what you selected
108356
msal_SNIAuth: 'msal-sniauth'
109-
msal_cert: $(virtualclient-cert-pem)
357+
msal_cert: $(virtualclient)
110358
msal_client_ID: 'f407a268-1184-4845-92b1-eebfbe0749c0'
111-
package_path: '$(Build.SourcesDirectory)/out/packages/*.deb'
112-
repository: 'virtualclient-apt'
359+
package_path: '$(Agent.BuildDirectory)/drop/packages'
360+
repository: 'microsoft-ubuntu-zesty-prod-apt'
361+
release: 'zesty'

src/VirtualClient/VirtualClient.Packaging/build-deb-linux-arm64.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ EOF
2929
cat > "$DEB_DIR/DEBIAN/postinst" << EOF
3030
#!/bin/bash
3131
ln -sf /opt/virtualclient/VirtualClient /usr/local/bin/VirtualClient
32+
ln -sf /opt/virtualclient/VirtualClient /usr/local/bin/virtualclient
3233
EOF
3334

3435
# Copy the build files to the package directory (/opt/package-name)

src/VirtualClient/VirtualClient.Packaging/build-deb-linux-x64.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,15 @@ mkdir -p "$DEB_DIR/DEBIAN"
2121
cat > "$DEB_DIR/DEBIAN/control" << EOF
2222
Package: $PACKAGE_NAME
2323
Version: $PACKAGE_VERSION
24-
Architecture: x64
24+
Architecture: amd64
2525
Maintainer: Virtual Client Team <[email protected]>
2626
Description: VirtualClient, the open sourced workload automation.
2727
EOF
2828

2929
cat > "$DEB_DIR/DEBIAN/postinst" << EOF
3030
#!/bin/bash
3131
ln -sf /opt/virtualclient/VirtualClient /usr/local/bin/VirtualClient
32+
ln -sf /opt/virtualclient/VirtualClient /usr/local/bin/virtualclient
3233
EOF
3334

3435
# Copy the build files to the package directory (/opt/package-name)
@@ -40,6 +41,6 @@ chmod -R 775 "$DEB_DIR/opt/$PACKAGE_NAME"
4041
chmod -R 775 "$DEB_DIR/DEBIAN"
4142

4243
# Build the package using dpkg-deb
43-
dpkg-deb --build "$DEB_DIR" "$OUT_DIR/$PACKAGE_NAME"_"$PACKAGE_VERSION"_x64.deb
44+
dpkg-deb --build "$DEB_DIR" "$OUT_DIR/$PACKAGE_NAME"_"$PACKAGE_VERSION"_amd64.deb
4445

45-
echo "Debian package created: "$OUT_DIR/$PACKAGE_NAME"_"$PACKAGE_VERSION"_x64.deb"
46+
echo "Debian package created: "$OUT_DIR/$PACKAGE_NAME"_"$PACKAGE_VERSION"_amd64.deb"

website/docs/guides/0001-getting-started.md

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,22 @@ SHA256 algorithm.
1414
Virtual Client is a self-contained .NET 6 application, so "Installation" really just means copying the Virtual Client package onto your system. It runs out-of-box on
1515
[all operating systems supported by .NET 6](https://github.com/dotnet/core/blob/main/release-notes/6.0/supported-os.md).
1616

17-
### Ubuntu (Deb)
18-
We maintain deb package for releases. Use the following command to install. You can then call VirtualClient from this path `/usr/local/bin/VirtualClient`, which is typically in Linux `$PATH`.
17+
### Debian / Ubuntu
18+
We maintain deb package for releases. Use the following command to install. You can then call VirtualClient from this path `/usr/local/bin/virtualclient`, which is typically in Linux `$PATH`.
1919

20-
#### linux-x64
2120
```bash
22-
sudo apt-get install wget gpg
23-
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
24-
sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg
25-
wget https://virtualclient.blob.core.windows.net/packages/virtualclient_1.11.0_x64.deb
26-
sudo apt install ./virtualclient_1.11.0_x64.deb
21+
# example: ubuntu
22+
declare os_distro=$(if command -v lsb_release &> /dev/null; then lsb_release -is | tr '[:upper:]' '[:lower:]' ; else grep -oP '(?<=^ID=).+' /etc/os-release ; fi)
23+
# example: 20.04
24+
declare os_version=$(if command -v lsb_release &> /dev/null; then lsb_release -rs; else grep -oP '(?<=^VERSION_ID=).+' /etc/os-release | tr -d '"'; fi)
25+
# Add Microsoft deb repo
26+
curl -sSL -O https://packages.microsoft.com/config/$os_distro/$os_version/packages-microsoft-prod.deb
27+
sudo dpkg -i packages-microsoft-prod.deb
28+
rm packages-microsoft-prod.deb
29+
sudo apt-get update
30+
sudo apt-get install virtualclient
2731
```
2832

29-
#### linux-arm64
30-
```bash
31-
sudo apt-get install wget gpg
32-
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
33-
sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg
34-
wget https://virtualclient.blob.core.windows.net/packages/virtualclient_1.11.0_arm64.deb
35-
sudo apt install ./virtualclient_1.11.0_arm64.deb
36-
```
37-
38-
39-
4033
### Zip Package
4134
You can find zip files in the latest [GitHub Releases](https://github.com/microsoft/VirtualClient/releases).
4235

0 commit comments

Comments
 (0)