Skip to content

Commit

Permalink
ci(drone): support docs build
Browse files Browse the repository at this point in the history
  • Loading branch information
NateScarlet committed Jul 5, 2019
1 parent 46702ee commit 69239d6
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 15 deletions.
74 changes: 63 additions & 11 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 [email protected]:WuLiFang/Nuke.git gh-pages
when:
branch:
- master

depends_on:
- nuke10.0v4
- nuke10.5v7
- nuke:latest
---
kind: pipeline
name: notification
Expand All @@ -69,7 +120,8 @@ steps:
depends_on:
- nuke10.0v4
- nuke10.5v7
- latest-nuke
- nuke:latest
- docs
trigger:
status:
- success
Expand Down
12 changes: 8 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&\
Expand All @@ -42,3 +44,5 @@ release:
echo > .venv/.make_sucess

docs/requirements.txt: docs/.git

docs/*: docs/.git
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Empty file modified scripts/get-venv-python-lib.sh
100644 → 100755
Empty file.
Empty file modified scripts/util.sh
100644 → 100755
Empty file.

0 comments on commit 69239d6

Please sign in to comment.