|
| 1 | +# Repartitioning runs on Azure Pipelines, because that's where we have SSH |
| 2 | +# access to the download server. |
| 3 | + |
| 4 | +name: $(Date:yyyyMMdd).$(Rev:r) |
| 5 | + |
| 6 | +# Do not run automatically |
| 7 | +trigger: none |
| 8 | + |
| 9 | + |
| 10 | +parameters: |
| 11 | +- name: Publish |
| 12 | + displayName: "Publish" |
| 13 | + type: boolean |
| 14 | + default: false |
| 15 | +- name: TestPublish |
| 16 | + displayName: "Run all steps without publishing" |
| 17 | + type: boolean |
| 18 | + default: false |
| 19 | + |
| 20 | +stages: |
| 21 | +- stage: PyManagerIndexPartition |
| 22 | + displayName: 'Repartition PyManager Index' |
| 23 | + |
| 24 | + jobs: |
| 25 | + - job: Repartition |
| 26 | + |
| 27 | + pool: |
| 28 | + vmImage: 'windows-latest' |
| 29 | + |
| 30 | + variables: |
| 31 | + - group: PythonOrgPublish |
| 32 | + |
| 33 | + steps: |
| 34 | + - checkout: self |
| 35 | + |
| 36 | + - task: NugetToolInstaller@0 |
| 37 | + displayName: 'Install Nuget' |
| 38 | + |
| 39 | + - powershell: | |
| 40 | + nuget install -o host_python -x -noninteractive -prerelease python |
| 41 | + Write-Host "##vso[task.prependpath]$(gi host_python\python\tools)" |
| 42 | + displayName: 'Install host Python' |
| 43 | + workingDirectory: $(Build.BinariesDirectory) |
| 44 | +
|
| 45 | + - powershell: | |
| 46 | + cd (mkdir -Force index) |
| 47 | + python "$(Build.SourcesDirectory)\scripts\repartition-index.py" --windows-default |
| 48 | + displayName: 'Repartition index' |
| 49 | + workingDirectory: $(Build.BinariesDirectory) |
| 50 | +
|
| 51 | + - publish: $(Build.BinariesDirectory)\index |
| 52 | + artifact: index |
| 53 | + displayName: Publish index artifact |
| 54 | + |
| 55 | + - ${{ if or(eq(parameters.Publish, 'true'), eq(parameters.TestPublish, 'true')) }}: |
| 56 | + - ${{ if ne(parameters.TestPublish, 'true') }}: |
| 57 | + - task: DownloadSecureFile@1 |
| 58 | + name: sshkey |
| 59 | + inputs: |
| 60 | + secureFile: pydotorg-ssh.ppk |
| 61 | + displayName: 'Download PuTTY key' |
| 62 | + |
| 63 | + - powershell: | |
| 64 | + git clone https://github.com/python/cpython-bin-deps --branch putty --single-branch --depth 1 --progress -v "putty" |
| 65 | + "##vso[task.prependpath]$(gi putty)" |
| 66 | + workingDirectory: $(Pipeline.Workspace) |
| 67 | + displayName: 'Download PuTTY binaries' |
| 68 | +
|
| 69 | + - powershell: | |
| 70 | + python ci\upload.py |
| 71 | + displayName: 'Publish packages' |
| 72 | + env: |
| 73 | + UPLOAD_URL: $(PyDotOrgUrlPrefix)python/ |
| 74 | + UPLOAD_DIR: $(Build.BinariesDirectory)\index |
| 75 | + UPLOAD_URL_PREFIX: $(PyDotOrgUrlPrefix) |
| 76 | + UPLOAD_PATH_PREFIX: $(PyDotOrgUploadPathPrefix) |
| 77 | + UPLOAD_HOST: $(PyDotOrgServer) |
| 78 | + UPLOAD_HOST_KEY: $(PyDotOrgHostKey) |
| 79 | + UPLOAD_USER: $(PyDotOrgUsername) |
| 80 | + UPLOADING_INDEX: true |
| 81 | + ${{ if eq(parameters.TestPublish, 'true') }}: |
| 82 | + NO_UPLOAD: 1 |
| 83 | + ${{ else }}: |
| 84 | + UPLOAD_KEYFILE: $(sshkey.secureFilePath) |
0 commit comments