From 37902c1aca190c96615d61d39f1b2b1ee9fa1f9b Mon Sep 17 00:00:00 2001 From: Oskari Timperi Date: Fri, 21 Jun 2019 11:53:19 +0300 Subject: First try downloading Python 2.X.Y --- azure-pipelines.yml | 7 +++++++ download.ps1 | 29 +++++++++++++++++++++-------- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3ac0bc1..cd6a59f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -132,6 +132,13 @@ jobs: PYVERSION: 3.7.3 PYARCH: 64 + PY2716_32: + PYVERSION: 2.7.16 + PYARCH: 32 + PY2716_64: + PYVERSION: 2.7.16 + PYARCH: 64 + pool: vmImage: 'vs2017-win2016' diff --git a/download.ps1 b/download.ps1 index ed23363..d90252b 100644 --- a/download.ps1 +++ b/download.ps1 @@ -1,7 +1,15 @@ -if ($env:PYARCH -eq "64") { - $filename = "python-${env:PYVERSION}-amd64.exe" +if ($env:PYVERSION -like "3.*") { + if ($env:PYARCH -eq "64") { + $filename = "python-${env:PYVERSION}-amd64.exe" + } else { + $filename = "python-${env:PYVERSION}.exe" + } } else { - $filename = "python-${env:PYVERSION}.exe" + if ($env:PYARCH -eq "64") { + $filename = "python-${env:PYVERSION}.amd64.msi" + } else { + $filename = "python-${env:PYVERSION}.msi" + } } $url = "https://www.python.org/ftp/python/${env:PYVERSION}/${filename}" @@ -17,10 +25,15 @@ Write-Output "Log file: $logfile" $client = New-Object System.Net.WebClient $client.DownloadFile($url, $target) -# Replace TARGET_DIR in unattend.xml.in with our target directory -((Get-Content -path unattend.xml.in -raw) -replace 'TARGET_DIR',$targetdir) | Set-Content -path unattend.xml +if ($env:PYVERSION -like "3.*") { + # Replace TARGET_DIR in unattend.xml.in with our target directory + ((Get-Content -path unattend.xml.in -raw) -replace 'TARGET_DIR',$targetdir) | Set-Content -path unattend.xml -Start-Process -FilePath "$target" -ArgumentList "/quiet","/log","$logfile" -Wait + Start-Process -FilePath "$target" -ArgumentList "/quiet","/log","$logfile" -Wait -# Remove all __pycache__ directories -Get-ChildItem -Include __pycache__ -Recurse -Force | Remove-Item -Force -Recurse + # Remove all __pycache__ directories + Get-ChildItem -Include __pycache__ -Recurse -Force | Remove-Item -Force -Recurse +} else { + msiexec /qn /i $target TARGETDIR=$targetdir ADDLOCAL=DefaultFeature,TclTk,Documentation,Tools REMOVE=Extensions,Testsuite ALLUSERS=1 + Get-ChildItem -Include "*.pyc" -Recurse -Force | Remove-Item -Force +} -- cgit v1.2.3 From 6f83444b9d8b6eeab50582e619fcd0b69d19c886 Mon Sep 17 00:00:00 2001 From: Oskari Timperi Date: Fri, 21 Jun 2019 11:58:26 +0300 Subject: Run for all branches, except release for master --- azure-pipelines.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index cd6a59f..6bed068 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,6 +1,3 @@ -trigger: -- master - jobs: - job: build @@ -164,6 +161,7 @@ jobs: - job: release dependsOn: build + condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')) pool: vmImage: 'vs2017-win2016' steps: -- cgit v1.2.3 From 0d4c1ef987ce39ec28182272efcd205eefba1d14 Mon Sep 17 00:00:00 2001 From: Oskari Timperi Date: Fri, 21 Jun 2019 12:03:15 +0300 Subject: Log to file for Python 2 --- download.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/download.ps1 b/download.ps1 index d90252b..e9a4f7b 100644 --- a/download.ps1 +++ b/download.ps1 @@ -34,6 +34,6 @@ if ($env:PYVERSION -like "3.*") { # Remove all __pycache__ directories Get-ChildItem -Include __pycache__ -Recurse -Force | Remove-Item -Force -Recurse } else { - msiexec /qn /i $target TARGETDIR=$targetdir ADDLOCAL=DefaultFeature,TclTk,Documentation,Tools REMOVE=Extensions,Testsuite ALLUSERS=1 + msiexec /qn /i $target /L*V $logfile TARGETDIR=$targetdir ADDLOCAL=DefaultFeature,TclTk,Documentation,Tools REMOVE=Extensions,Testsuite ALLUSERS=1 Get-ChildItem -Include "*.pyc" -Recurse -Force | Remove-Item -Force } -- cgit v1.2.3 From e0e812e2a9b8dd31c6f41081aa152a1c4d5203b2 Mon Sep 17 00:00:00 2001 From: Oskari Timperi Date: Sun, 23 Jun 2019 20:55:10 +0300 Subject: Move publishing install.log earlier Sometimes the installation fails and the log file is not published because the arhive step fails. --- azure-pipelines.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 6bed068..7d14e88 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -143,6 +143,11 @@ jobs: - powershell: .\download.ps1 displayName: 'Run the build' + - task: PublishPipelineArtifact@0 + inputs: + targetPath: 'install.log' + artifactName: '$(PYVERSION)-$(PYARCH)-install.log' + - task: ArchiveFiles@2 inputs: rootFolderOrFile: 'Python-$(PYVERSION)-$(PYARCH)' @@ -154,11 +159,6 @@ jobs: targetPath: '$(Build.ArtifactStagingDirectory)/Python-$(PYVERSION)-$(PYARCH).zip' artifactName: '$(PYVERSION)-$(PYARCH)' - - task: PublishPipelineArtifact@0 - inputs: - targetPath: 'install.log' - artifactName: '$(PYVERSION)-$(PYARCH)-install.log' - - job: release dependsOn: build condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')) -- cgit v1.2.3 From f95c1a668dbed1f8737bb7c2164a56813152d649 Mon Sep 17 00:00:00 2001 From: Oskari Timperi Date: Sun, 23 Jun 2019 21:12:06 +0300 Subject: Remove ALLUSERS=1 property from Python 2 install command --- download.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/download.ps1 b/download.ps1 index e9a4f7b..78bb4a9 100644 --- a/download.ps1 +++ b/download.ps1 @@ -34,6 +34,6 @@ if ($env:PYVERSION -like "3.*") { # Remove all __pycache__ directories Get-ChildItem -Include __pycache__ -Recurse -Force | Remove-Item -Force -Recurse } else { - msiexec /qn /i $target /L*V $logfile TARGETDIR=$targetdir ADDLOCAL=DefaultFeature,TclTk,Documentation,Tools REMOVE=Extensions,Testsuite ALLUSERS=1 + msiexec /qn /i $target /L*V $logfile TARGETDIR=$targetdir ADDLOCAL=DefaultFeature,TclTk,Documentation,Tools REMOVE=Extensions,Testsuite Get-ChildItem -Include "*.pyc" -Recurse -Force | Remove-Item -Force } -- cgit v1.2.3 From 5ccf25699d8f0beda0d8bb5bf19dbd08692ee893 Mon Sep 17 00:00:00 2001 From: Oskari Timperi Date: Sun, 23 Jun 2019 21:26:03 +0300 Subject: Use Start-Process with -Wait argument to execute msiexec --- download.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/download.ps1 b/download.ps1 index 78bb4a9..df06a92 100644 --- a/download.ps1 +++ b/download.ps1 @@ -34,6 +34,6 @@ if ($env:PYVERSION -like "3.*") { # Remove all __pycache__ directories Get-ChildItem -Include __pycache__ -Recurse -Force | Remove-Item -Force -Recurse } else { - msiexec /qn /i $target /L*V $logfile TARGETDIR=$targetdir ADDLOCAL=DefaultFeature,TclTk,Documentation,Tools REMOVE=Extensions,Testsuite + Start-Process -FilePath msiexec -ArgumentList "/qn","/i","$target","/L*V","$logfile","TARGETDIR=$targetdir","ADDLOCAL=DefaultFeature,TclTk,Documentation,Tools","REMOVE=Extensions,Testsuite" -Wait Get-ChildItem -Include "*.pyc" -Recurse -Force | Remove-Item -Force } -- cgit v1.2.3