diff options
| author | Oskari Timperi <oskari.timperi@iki.fi> | 2019-06-23 21:48:52 +0300 |
|---|---|---|
| committer | Oskari Timperi <oskari.timperi@iki.fi> | 2019-06-23 21:48:52 +0300 |
| commit | 82d748d7a5f508c349817b407fc39e2d897d24df (patch) | |
| tree | d7fda0e1710cdc68350f00362d5600afac5a2ef6 | |
| parent | a447739463ef7c0d6e34d4a85c66555e77c08193 (diff) | |
| parent | 5ccf25699d8f0beda0d8bb5bf19dbd08692ee893 (diff) | |
| download | portablepython-82d748d7a5f508c349817b407fc39e2d897d24df.tar.gz portablepython-82d748d7a5f508c349817b407fc39e2d897d24df.zip | |
Merge branch 'python27'release-2
| -rw-r--r-- | azure-pipelines.yml | 21 | ||||
| -rw-r--r-- | download.ps1 | 29 |
2 files changed, 34 insertions, 16 deletions
diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3ac0bc1..7d14e88 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,6 +1,3 @@ -trigger: -- master - jobs: - job: build @@ -132,6 +129,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' @@ -139,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)' @@ -150,13 +159,9 @@ 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')) pool: vmImage: 'vs2017-win2016' steps: diff --git a/download.ps1 b/download.ps1 index ed23363..df06a92 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 { + 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 +} |
