|
15 | 15 | parameters: |
16 | 16 | name: Windows |
17 | 17 | vmImage: vs2017-win2016 |
18 | | - |
19 | | -- job: 'Web_and_Docs' |
20 | | - pool: |
21 | | - vmImage: ubuntu-16.04 |
22 | | - timeoutInMinutes: 90 |
23 | | - steps: |
24 | | - - script: | |
25 | | - echo '##vso[task.setvariable variable=ENV_FILE]environment.yml' |
26 | | - echo '##vso[task.prependpath]$(HOME)/miniconda3/bin' |
27 | | - displayName: 'Setting environment variables' |
28 | | -
|
29 | | - - script: | |
30 | | - sudo apt-get install -y libc6-dev-i386 |
31 | | - ci/setup_env.sh |
32 | | - displayName: 'Setup environment and build pandas' |
33 | | -
|
34 | | - - script: | |
35 | | - source activate pandas-dev |
36 | | - python web/pandas_web.py web/pandas --target-path=web/build |
37 | | - displayName: 'Build website' |
38 | | -
|
39 | | - - script: | |
40 | | - source activate pandas-dev |
41 | | - # Next we should simply have `doc/make.py --warnings-are-errors`, everything else is required because the ipython directive doesn't fail the build on errors (https://github.com/ipython/ipython/issues/11547) |
42 | | - doc/make.py --warnings-are-errors | tee sphinx.log ; SPHINX_RET=${PIPESTATUS[0]} |
43 | | - grep -B1 "^<<<-------------------------------------------------------------------------$" sphinx.log ; IPY_RET=$(( $? != 1 )) |
44 | | - exit $(( $SPHINX_RET + $IPY_RET )) |
45 | | - displayName: 'Build documentation' |
46 | | -
|
47 | | - - script: | |
48 | | - mkdir -p to_deploy/docs |
49 | | - cp -r web/build/* to_deploy/ |
50 | | - cp -r doc/build/html/* to_deploy/docs/ |
51 | | - displayName: 'Merge website and docs' |
52 | | -
|
53 | | - - script: | |
54 | | - cd to_deploy |
55 | | - git init |
56 | | - touch .nojekyll |
57 | | - echo "dev.pandas.io" > CNAME |
58 | | - printf "User-agent: *\nDisallow: /" > robots.txt |
59 | | - git add --all . |
60 | | - git config user.email "pandas-dev@python.org" |
61 | | - git config user.name "pandas-bot" |
62 | | - git commit -m "pandas web and documentation in master" |
63 | | - displayName: 'Create git repo for docs build' |
64 | | - condition : | |
65 | | - and(not(eq(variables['Build.Reason'], 'PullRequest')), |
66 | | - eq(variables['Build.SourceBranch'], 'refs/heads/master')) |
67 | | -
|
68 | | - # For `InstallSSHKey@0` to work, next steps are required: |
69 | | - # 1. Generate a pair of private/public keys (i.e. `ssh-keygen -t rsa -b 4096 -C "your_email@example.com"`) |
70 | | - # 2. Go to "Library > Secure files" in the Azure Pipelines dashboard: https://dev.azure.com/pandas-dev/pandas/_library?itemType=SecureFiles |
71 | | - # 3. Click on "+ Secure file" |
72 | | - # 4. Upload the private key (the name of the file must match with the specified in "sshKeySecureFile" input below, "pandas_docs_key") |
73 | | - # 5. Click on file name after it is created, tick the box "Authorize for use in all pipelines" and save |
74 | | - # 6. The public key specified in "sshPublicKey" is the pair of the uploaded private key, and needs to be set as a deploy key of the repo where the docs will be pushed (with write access): https://github.com/pandas-dev/pandas-dev.github.io/settings/keys |
75 | | - - task: InstallSSHKey@0 |
76 | | - inputs: |
77 | | - hostName: 'github.com,192.30.252.128 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==' |
78 | | - sshPublicKey: 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDHmz3l/EdqrgNxEUKkwDUuUcLv91unig03pYFGO/DMIgCmPdMG96zAgfnESd837Rm0wSSqylwSzkRJt5MV/TpFlcVifDLDQmUhqCeO8Z6dLl/oe35UKmyYICVwcvQTAaHNnYRpKC5IUlTh0JEtw9fGlnp1Ta7U1ENBLbKdpywczElhZu+hOQ892zqOj3CwA+U2329/d6cd7YnqIKoFN9DWT3kS5K6JE4IoBfQEVekIOs23bKjNLvPoOmi6CroAhu/K8j+NCWQjge5eJf2x/yTnIIP1PlEcXoHIr8io517posIx3TBup+CN8bNS1PpDW3jyD3ttl1uoBudjOQrobNnJeR6Rn67DRkG6IhSwr3BWj8alwUG5mTdZzwV5Pa9KZFdIiqX7NoDGg+itsR39QCn0thK8lGRNSR8KrWC1PSjecwelKBO7uQ7rnk/rkrZdBWR4oEA8YgNH8tirUw5WfOr5a0AIaJicKxGKNdMxZt+zmC+bS7F4YCOGIm9KHa43RrKhoGRhRf9fHHHKUPwFGqtWG4ykcUgoamDOURJyepesBAO3FiRE9rLU6ILbB3yEqqoekborHmAJD5vf7PWItW3Q/YQKuk3kkqRcKnexPyzyyq5lUgTi8CxxZdaASIOu294wjBhhdyHlXEkVTNJ9JKkj/obF+XiIIp0cBDsOXY9hDQ== pandas-dev@python.org' |
79 | | - sshKeySecureFile: 'pandas_docs_key' |
80 | | - displayName: 'Install GitHub ssh deployment key' |
81 | | - condition : | |
82 | | - and(not(eq(variables['Build.Reason'], 'PullRequest')), |
83 | | - eq(variables['Build.SourceBranch'], 'refs/heads/master')) |
84 | | -
|
85 | | - - script: | |
86 | | - cd to_deploy |
87 | | - git remote add origin git@github.com:pandas-dev/pandas-dev.github.io.git |
88 | | - git push -f origin master |
89 | | - displayName: 'Publish web and docs to GitHub pages' |
90 | | - condition : | |
91 | | - and(not(eq(variables['Build.Reason'], 'PullRequest')), |
92 | | - eq(variables['Build.SourceBranch'], 'refs/heads/master')) |
0 commit comments