Skip to content

Commit f221709

Browse files
committed
python: add installer option
If MSI checksum is set, then the builder will download the Python installer, install Python at a temp location, then move the folder to the known location. At the end, the Python package will be uninstalled. Signed-off-by: Adrian Vladu <avladu@cloudbasesolutions.com>
1 parent cf1eedd commit f221709

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

.github/workflows/build_test_cbsinit.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ jobs:
2929
-VCVars "automatic" ^
3030
-VSRedistDir "''" ^
3131
-CloudbaseInitRepoUrl ${{ matrix.cbsinit_repo }} ^
32-
-CloudbaseInitRepoBranch ${{ matrix.cbsinit_branch }}
32+
-CloudbaseInitRepoBranch ${{ matrix.cbsinit_branch }} ^
33+
-PythonMsiChecksum "not a real checksum"
3334
- uses: actions/upload-artifact@v7
3435
with:
3536
name: "CloudbaseInit_${{ matrix.platform }}_${{ matrix.os }}_MSI_${{ matrix.cbsinit_branch }}"

BuildAutomation/BuildCloudbaseInitSetup.ps1

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ Param(
1010
[switch]$ClonePullInstallerRepo = $true,
1111
[string]$VSRedistDir = "${ENV:ProgramFiles(x86)}\Common Files\Merge Modules",
1212
[string]$SignTimestampUrl = "http://timestamp.digicert.com?alg=sha256",
13-
[string]$VCVars="2019"
13+
[string]$VCVars="2019",
14+
[string]$PythonMsiChecksum = $null
1415
)
1516

1617
$ErrorActionPreference = "Stop"
@@ -77,6 +78,10 @@ try
7778

7879
$python_template_dir = join-path $cloudbaseInitInstallerDir "Python$($pythonversion.replace('.', ''))_${platform}_Template"
7980

81+
if ($PythonMsiChecksum) {
82+
DownloadInstall-PythonMsi $platform $python_template_dir $pythonversion $PythonMsiChecksum
83+
}
84+
8085
CheckCopyDir $python_template_dir $python_dir
8186

8287
# Make sure that we don't have temp files from a previous build

0 commit comments

Comments
 (0)