From 69239d67ba8b5457c949ce29a5362711c242ac4a Mon Sep 17 00:00:00 2001 From: NateScarlet Date: Thu, 4 Jul 2019 11:54:14 +0800 Subject: [PATCH] ci(drone): support docs build --- .drone.yml | 74 +++++++++++++++++++++++++++++----- Makefile | 12 ++++-- requirements.txt | 1 + scripts/get-venv-python-lib.sh | 0 scripts/util.sh | 0 5 files changed, 72 insertions(+), 15 deletions(-) mode change 100644 => 100755 scripts/get-venv-python-lib.sh mode change 100644 => 100755 scripts/util.sh diff --git a/.drone.yml b/.drone.yml index ee718f05..38d9dc8e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -6,13 +6,12 @@ steps: - name: test image: natescarlet/nuke:10.0v4 environment: - PIP_INDEX_URL: https://mirrors.huaweicloud.com/repository/pypi/simple + PIP_INDEX_URL: https://pypi.tuna.tsinghua.edu.cn/simple + PYTHON_PATH: '/drone/src/lib' foundry_LICENSE: from_secret: foundry_LICENSE - LC_ALL: C.UTF-8 commands: - sudo chown -R nuke:nuke . - - pip install --user virtualenv - make test --- kind: pipeline @@ -22,30 +21,82 @@ steps: - name: test image: natescarlet/nuke:10.5v7 environment: - PIP_INDEX_URL: https://mirrors.huaweicloud.com/repository/pypi/simple + PIP_INDEX_URL: https://pypi.tuna.tsinghua.edu.cn/simple foundry_LICENSE: from_secret: foundry_LICENSE - LC_ALL: C.UTF-8 commands: - sudo chown -R nuke:nuke . - - pip install --user virtualenv - make test --- kind: pipeline -name: latest-nuke +name: nuke:latest steps: - name: test image: natescarlet/nuke:latest environment: - PIP_INDEX_URL: https://mirrors.huaweicloud.com/repository/pypi/simple + PIP_INDEX_URL: https://pypi.tuna.tsinghua.edu.cn/simple foundry_LICENSE: from_secret: foundry_LICENSE - LC_ALL: C.UTF-8 commands: - sudo chown -R nuke:nuke . - - pip install --user virtualenv - make test + +--- +kind: pipeline +name: docs + +steps: + - name: build + image: natescarlet/nuke:10.5v7 + environment: + PIP_INDEX_URL: https://pypi.tuna.tsinghua.edu.cn/simple + foundry_LICENSE: + from_secret: foundry_LICENSE + commands: + - sudo chown -R nuke:nuke . + - make docs + - name: deploy to github + image: natescarlet/nuke:10.5v7 + environment: + GITHUB_DEPLOY_KEY: + from_secret: GITHUB_DEPLOY_KEY + SSH_PROXY: + from_secret: SSH_PROXY + commands: + - mkdir ~/.ssh/ + - echo "$${GITHUB_DEPLOY_KEY}" > ~/.ssh/id_rsa + - |- + if [ -n "$SSH_PROXY" ]; then + sudo sed -i "s@http://.\+\.debian\.org/debian@http://mirrors.huaweicloud.com/debian@g" /etc/apt/sources.list + sudo apt-get update + sudo apt-get -y install connect-proxy + echo "ProxyCommand connect -H $SSH_PROXY %h %p" > ~/.ssh/config + fi + - chmod 600 ~/.ssh/id_rsa + - "echo 'github.com ssh-rsa \ + AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrT\ + tw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUj\ + vSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSC\ + ZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3\ + RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJi\ + S5ap43JXiUFFAaQ==' \ + > ~/.ssh/known_hosts" + - git config --global user.name 'CI User' + - git config --global user.email '<>' + - cd docs/build/html + - git add --all + - "git commit -m 'docs: build' -m '[skip ci]'" + - git push -f origin gh-pages + - git push -f git@github.com:WuLiFang/Nuke.git gh-pages + when: + branch: + - master + +depends_on: + - nuke10.0v4 + - nuke10.5v7 + - nuke:latest --- kind: pipeline name: notification @@ -69,7 +120,8 @@ steps: depends_on: - nuke10.0v4 - nuke10.5v7 - - latest-nuke + - nuke:latest + - docs trigger: status: - success diff --git a/Makefile b/Makefile index 06ae9130..4acadf3e 100644 --- a/Makefile +++ b/Makefile @@ -13,16 +13,18 @@ endif lib/site-packages/.make_sucess: .venv/.make_sucess requirements.txt rm -rf lib/site-packages - $(PYTHON27) -m pip install --target="lib/site-packages" --upgrade -r "requirements.txt" + $(PYTHON27) -m pip install --target="lib/site-packages" -r "requirements.txt" ./scripts/add-lib-path.sh echo > lib/site-packages/.make_sucess docs/.git: - git worktree add -f --checkout docs docs + git fetch -fn origin docs:docs + git worktree add -f docs docs -docs/build/html/.git: docs/.git +docs/build/html/.git: docs/.git lib/site-packages/.make_sucess + git fetch -fn origin gh-pages:gh-pages rm -rf docs/build/html - git worktree add -f --checkout docs/build/html gh-pages + git worktree add -f docs/build/html gh-pages docs: docs/* docs/build/html/.git . ./scripts/activate-venv.sh &&\ @@ -42,3 +44,5 @@ release: echo > .venv/.make_sucess docs/requirements.txt: docs/.git + +docs/*: docs/.git diff --git a/requirements.txt b/requirements.txt index 68a249e5..a39bd36d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,3 +6,4 @@ pendulum==2.0.5 pyblish-lite==0.8.4 pluggy==0.12.0 websocket-client==0.56.0 +urllib3[secure]==1.23 diff --git a/scripts/get-venv-python-lib.sh b/scripts/get-venv-python-lib.sh old mode 100644 new mode 100755 diff --git a/scripts/util.sh b/scripts/util.sh old mode 100644 new mode 100755