platypush/.drone.yml

78 lines
1.8 KiB
YAML
Raw Normal View History

2023-07-24 12:12:13 +02:00
---
2023-07-24 11:05:38 +02:00
kind: pipeline
type: docker
name: default
steps:
2023-07-25 00:00:47 +02:00
- name: github-mirror
image: alpine
environment:
SSH_PUBKEY:
from_secret: ssh_pubkey
SSH_PRIVKEY:
from_secret: ssh_privkey
commands:
- apk add --update --no-cache git openssh
- mkdir -p ~/.ssh
- |
cat <<EOF > ~/.ssh/id_rsa.pub
$SSH_PUBKEY
EOF
- |
cat <<EOF > ~/.ssh/id_rsa
$SSH_PRIVKEY
EOF
- chmod 0600 ~/.ssh/id_rsa
- ssh-keyscan github.com >> ~/.ssh/known_hosts 2>/dev/null
- git config --global --add safe.directory $PWD
2023-07-25 00:00:47 +02:00
- git remote add github git@github.com:/BlackLight/platypush.git
- git pull github master
- git push --all -v github
2023-07-25 00:00:47 +02:00
- name: rebuild-docs
image: alpine
volumes:
- name: docs
path: /docs
commands:
- echo "Installing required build dependencies"
- apk add --update --no-cache make py3-sphinx py3-pip py3-paho-mqtt
- pip install -U hid sphinx-rtd-theme sphinx-book-theme
- pip install .
- mkdir -p /docs/current
- export APPDIR=$PWD
- rm -rf "$APPDIR/docs/build"
- echo "Building the updated documentation"
- cd "$APPDIR/docs"
- make html
- rm -f config*.yaml
- cd "$APPDIR"
- echo "Copying the new documentation files to the target folder"
- mv -v "$APPDIR/docs/build" /docs/new
- cd /docs
- mv current old
- mv new current
- rm -rf old
when:
event:
- tag
2023-07-24 11:05:38 +02:00
- name: run-tests
image: python:3.11-alpine
commands:
- apk add --update --no-cache redis
- apk add --update --no-cache --virtual build-base g++ rust
- pip install -U pip
- pip install .
- pip install -r requirements-tests.txt
- apk del build-base g++ rust
- pytest tests
volumes:
- name: docs
host:
path: /opt/docs/platypush