2023-07-24 12:12:13 +02:00
|
|
|
---
|
2023-07-24 11:05:38 +02:00
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: default
|
|
|
|
|
2023-08-06 10:49:44 +02:00
|
|
|
volumes:
|
|
|
|
- name: docs
|
|
|
|
host:
|
|
|
|
path: /opt/docs/platypush
|
|
|
|
|
2023-10-19 21:48:59 +02:00
|
|
|
- name: repos
|
|
|
|
host:
|
|
|
|
path: /opt/repos/platypush
|
|
|
|
|
2023-07-24 11:05:38 +02:00
|
|
|
steps:
|
2023-09-19 00:36:16 +02:00
|
|
|
|
|
|
|
###
|
|
|
|
### Mirror the current repository state to Github
|
|
|
|
###
|
|
|
|
|
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:
|
2024-05-23 00:17:55 +02:00
|
|
|
- . .drone/github-mirror.sh
|
2023-07-25 00:00:47 +02:00
|
|
|
|
2023-09-19 00:36:16 +02:00
|
|
|
###
|
|
|
|
### Rebuild the docs
|
|
|
|
###
|
|
|
|
|
2023-08-06 10:49:44 +02:00
|
|
|
- name: docs
|
2023-08-04 11:18:42 +02:00
|
|
|
image: alpine
|
|
|
|
volumes:
|
|
|
|
- name: docs
|
|
|
|
path: /docs
|
|
|
|
|
|
|
|
commands:
|
2024-05-23 00:17:55 +02:00
|
|
|
- . .drone/rebuild-docs.sh
|
2023-08-04 11:18:42 +02:00
|
|
|
|
2023-08-05 14:43:10 +02:00
|
|
|
when:
|
|
|
|
event:
|
|
|
|
- tag
|
|
|
|
|
2023-09-19 00:36:16 +02:00
|
|
|
###
|
|
|
|
### Run the tests
|
|
|
|
###
|
|
|
|
|
2023-08-06 00:44:03 +02:00
|
|
|
- name: tests
|
2023-09-30 13:36:28 +02:00
|
|
|
image: alpine
|
2023-07-24 11:05:38 +02:00
|
|
|
commands:
|
2024-05-23 00:17:55 +02:00
|
|
|
- . .drone/run-tests.sh
|
2023-08-04 11:18:42 +02:00
|
|
|
|
2023-09-19 00:36:16 +02:00
|
|
|
###
|
|
|
|
### Rebuild the UI files
|
|
|
|
###
|
|
|
|
|
2023-08-06 22:21:22 +02:00
|
|
|
- name: build-ui
|
|
|
|
image: node:current-alpine3.18
|
|
|
|
|
|
|
|
environment:
|
|
|
|
SSH_PUBKEY:
|
|
|
|
from_secret: ssh_pubkey
|
|
|
|
SSH_PRIVKEY:
|
|
|
|
from_secret: ssh_privkey
|
|
|
|
PGP_KEY:
|
|
|
|
from_secret: pgp_key
|
|
|
|
PGP_KEY_ID:
|
|
|
|
from_secret: pgp_key_id
|
|
|
|
|
|
|
|
when:
|
|
|
|
branch:
|
|
|
|
- master
|
|
|
|
event:
|
|
|
|
- push
|
|
|
|
|
|
|
|
depends_on:
|
|
|
|
- tests
|
|
|
|
|
|
|
|
commands:
|
2024-05-23 00:17:55 +02:00
|
|
|
- . .drone/build-ui.sh
|
2024-01-06 22:21:59 +01:00
|
|
|
|
|
|
|
###
|
|
|
|
### Regenerate the components.json cache
|
|
|
|
###
|
|
|
|
|
|
|
|
- name: update-components-cache
|
|
|
|
image: alpine
|
|
|
|
|
|
|
|
environment:
|
|
|
|
SSH_PUBKEY:
|
|
|
|
from_secret: ssh_pubkey
|
|
|
|
SSH_PRIVKEY:
|
|
|
|
from_secret: ssh_privkey
|
|
|
|
PGP_KEY:
|
|
|
|
from_secret: pgp_key
|
|
|
|
PGP_KEY_ID:
|
|
|
|
from_secret: pgp_key_id
|
|
|
|
|
|
|
|
when:
|
|
|
|
branch:
|
|
|
|
- master
|
|
|
|
event:
|
|
|
|
- push
|
|
|
|
|
|
|
|
depends_on:
|
|
|
|
- build-ui
|
|
|
|
|
|
|
|
commands:
|
2024-05-23 00:17:55 +02:00
|
|
|
- . .drone/update-components-cache.sh
|
2023-08-07 00:19:02 +02:00
|
|
|
|
2023-09-19 00:36:16 +02:00
|
|
|
###
|
|
|
|
### Update the Arch packages
|
|
|
|
###
|
|
|
|
|
2023-08-06 00:44:03 +02:00
|
|
|
- name: update-arch-packages
|
|
|
|
image: python:3.11-alpine
|
|
|
|
environment:
|
|
|
|
WORKDIR: /tmp/workdir
|
|
|
|
SSH_PUBKEY:
|
|
|
|
from_secret: ssh_pubkey
|
|
|
|
SSH_PRIVKEY:
|
|
|
|
from_secret: ssh_privkey
|
|
|
|
|
|
|
|
when:
|
|
|
|
branch:
|
|
|
|
- master
|
2023-08-06 22:21:22 +02:00
|
|
|
event:
|
|
|
|
- push
|
2023-08-06 00:44:03 +02:00
|
|
|
|
|
|
|
depends_on:
|
2024-01-06 22:21:59 +01:00
|
|
|
- update-components-cache
|
2023-08-06 00:44:03 +02:00
|
|
|
|
|
|
|
commands:
|
2024-05-23 00:17:55 +02:00
|
|
|
- . .drone/update-arch-packages.sh
|
2023-08-06 00:44:03 +02:00
|
|
|
|
2023-09-19 00:36:16 +02:00
|
|
|
###
|
|
|
|
### Update the Debian (stable) packages
|
|
|
|
###
|
|
|
|
|
2023-09-18 13:36:59 +02:00
|
|
|
- name: update-debian-stable-packages
|
2023-09-18 21:31:42 +02:00
|
|
|
image: debian:stable
|
2023-10-19 21:48:59 +02:00
|
|
|
volumes:
|
|
|
|
- name: repos
|
|
|
|
path: /repos
|
|
|
|
|
2023-09-18 11:00:46 +02:00
|
|
|
environment:
|
2023-09-18 21:31:42 +02:00
|
|
|
DEB_VERSION: stable
|
2023-09-18 11:00:46 +02:00
|
|
|
WORKDIR: /tmp/workdir
|
2023-10-19 21:48:59 +02:00
|
|
|
APT_ROOT: /repos/apt
|
2023-09-19 00:36:16 +02:00
|
|
|
PKG_NAME: platypush
|
2023-09-18 11:00:46 +02:00
|
|
|
|
|
|
|
when:
|
|
|
|
branch:
|
|
|
|
- master
|
|
|
|
event:
|
|
|
|
- push
|
|
|
|
|
|
|
|
depends_on:
|
2024-01-06 22:21:59 +01:00
|
|
|
- update-components-cache
|
2023-09-18 11:00:46 +02:00
|
|
|
|
|
|
|
commands:
|
2024-05-23 00:17:55 +02:00
|
|
|
- . .drone/update-deb-packages.sh
|
2023-09-20 01:42:25 +02:00
|
|
|
|
2023-09-19 00:36:16 +02:00
|
|
|
###
|
|
|
|
### Update the Debian (oldstable) packages
|
|
|
|
###
|
2023-09-18 13:36:59 +02:00
|
|
|
|
|
|
|
- name: update-debian-oldstable-packages
|
2023-09-18 21:31:42 +02:00
|
|
|
image: debian:oldstable
|
2023-10-19 21:48:59 +02:00
|
|
|
volumes:
|
|
|
|
- name: repos
|
|
|
|
path: /repos
|
|
|
|
|
2023-09-18 13:36:59 +02:00
|
|
|
environment:
|
2023-09-18 21:31:42 +02:00
|
|
|
DEB_VERSION: oldstable
|
2023-09-18 13:36:59 +02:00
|
|
|
WORKDIR: /tmp/workdir
|
2023-10-19 21:48:59 +02:00
|
|
|
APT_ROOT: /repos/apt
|
2023-10-19 21:54:03 +02:00
|
|
|
PKG_NAME: platypush
|
2023-09-18 13:36:59 +02:00
|
|
|
|
|
|
|
when:
|
|
|
|
branch:
|
|
|
|
- master
|
|
|
|
event:
|
|
|
|
- push
|
|
|
|
|
|
|
|
depends_on:
|
2024-01-06 22:21:59 +01:00
|
|
|
- update-components-cache
|
2023-09-18 13:36:59 +02:00
|
|
|
|
|
|
|
commands:
|
2024-05-23 00:17:55 +02:00
|
|
|
- . .drone/update-deb-packages.sh
|
2023-09-20 01:42:25 +02:00
|
|
|
|
2024-05-26 22:38:22 +02:00
|
|
|
###
|
|
|
|
### Update the Ubuntu (latest) packages
|
|
|
|
###
|
|
|
|
|
|
|
|
- name: update-ubuntu-packages
|
|
|
|
image: ubuntu:latest
|
|
|
|
volumes:
|
|
|
|
- name: repos
|
|
|
|
path: /repos
|
|
|
|
|
|
|
|
environment:
|
|
|
|
DEB_VERSION: ubuntu
|
|
|
|
WORKDIR: /tmp/workdir
|
|
|
|
APT_ROOT: /repos/apt
|
|
|
|
PKG_NAME: platypush
|
|
|
|
|
|
|
|
when:
|
|
|
|
branch:
|
|
|
|
- master
|
|
|
|
event:
|
|
|
|
- push
|
|
|
|
|
|
|
|
depends_on:
|
|
|
|
- update-components-cache
|
|
|
|
|
|
|
|
commands:
|
|
|
|
- . .drone/update-deb-packages.sh
|
|
|
|
|
2023-09-19 00:36:16 +02:00
|
|
|
###
|
|
|
|
### Updates the APT repository after new packages have been pushed
|
|
|
|
###
|
|
|
|
|
|
|
|
- name: update-apt-repo
|
|
|
|
image: debian:stable
|
2023-10-19 21:48:59 +02:00
|
|
|
volumes:
|
|
|
|
- name: repos
|
|
|
|
path: /repos
|
|
|
|
|
2023-09-19 00:36:16 +02:00
|
|
|
environment:
|
2023-10-19 21:48:59 +02:00
|
|
|
REPOS_ROOT: /repos
|
|
|
|
APT_ROOT: /repos/apt
|
2023-09-20 00:03:49 +02:00
|
|
|
PGP_PUBKEY:
|
|
|
|
from_secret: apt_pgp_pub_key
|
|
|
|
PGP_PRIVKEY:
|
|
|
|
from_secret: apt_pgp_priv_key
|
2023-09-19 00:36:16 +02:00
|
|
|
|
|
|
|
when:
|
|
|
|
branch:
|
|
|
|
- master
|
|
|
|
event:
|
|
|
|
- push
|
|
|
|
|
|
|
|
depends_on:
|
|
|
|
- update-debian-stable-packages
|
|
|
|
- update-debian-oldstable-packages
|
2024-05-26 22:38:22 +02:00
|
|
|
- update-ubuntu-packages
|
2023-09-19 00:36:16 +02:00
|
|
|
|
|
|
|
commands:
|
2024-05-23 00:17:55 +02:00
|
|
|
- . .drone/update-apt-repo.sh
|
2023-10-23 21:40:09 +02:00
|
|
|
|
2023-09-23 16:21:00 +02:00
|
|
|
###
|
|
|
|
### Update the RPM (stable) packages
|
|
|
|
###
|
|
|
|
|
|
|
|
- name: update-rpm-repo
|
|
|
|
image: fedora
|
2023-10-19 21:48:59 +02:00
|
|
|
volumes:
|
|
|
|
- name: repos
|
|
|
|
path: /repos
|
|
|
|
|
2023-09-23 16:21:00 +02:00
|
|
|
environment:
|
|
|
|
RPM_VERSION: stable
|
2023-10-19 21:48:59 +02:00
|
|
|
REPOS_ROOT: /repos
|
|
|
|
RPM_ROOT: /repos/rpm
|
2023-09-23 16:21:00 +02:00
|
|
|
WORKDIR: /tmp/workdir
|
|
|
|
PKG_NAME: platypush
|
|
|
|
PGP_PUBKEY:
|
|
|
|
from_secret: rpm_pgp_pub_key
|
|
|
|
PGP_PRIVKEY:
|
|
|
|
from_secret: rpm_pgp_priv_key
|
|
|
|
|
|
|
|
when:
|
|
|
|
branch:
|
|
|
|
- master
|
|
|
|
event:
|
|
|
|
- push
|
|
|
|
|
|
|
|
depends_on:
|
2024-01-06 22:21:59 +01:00
|
|
|
- update-components-cache
|
2023-09-23 16:21:00 +02:00
|
|
|
|
|
|
|
commands:
|
2024-05-23 00:17:55 +02:00
|
|
|
- . .drone/update-rpm-repo.sh
|
2023-09-23 16:21:00 +02:00
|
|
|
|
2023-09-19 00:36:16 +02:00
|
|
|
###
|
|
|
|
### Updates the pip package upon new releases
|
|
|
|
###
|
2023-09-18 11:00:46 +02:00
|
|
|
|
2023-08-06 10:49:44 +02:00
|
|
|
- name: update-pip-package
|
[CI/CD] Use a base Alpine image instead of `python:3.11-alpine`.
Weird errors seem to happen on Twine on that image:
```
Traceback (most recent call last):
File "/usr/bin/twine", line 5, in <module>
from twine.__main__ import main
File "/usr/lib/python3.11/site-packages/twine/__init__.py", line 32, in <module>
import importlib.metadata
File "/usr/lib/python3.11/importlib/metadata/__init__.py", line 17, in <module>
from . import _adapters, _meta
File "/usr/lib/python3.11/importlib/metadata/_adapters.py", line 3, in <module>
import email.message
File "/usr/lib/python3.11/email/message.py", line 15, in <module>
from email import utils
File "/usr/lib/python3.11/email/utils.py", line 28, in <module>
import random
File "/usr/lib/python3.11/random.py", line 49, in <module>
from math import log as _log, exp as _exp, pi as _pi, e as _e, ceil as _ceil
ImportError: Error relocating /usr/lib/python3.11/lib-dynload/math.cpython-311-x86_64-linux-musl.so: _PyModule_Add: symbol not found
```
2024-05-26 03:31:25 +02:00
|
|
|
image: alpine
|
2023-08-06 10:49:44 +02:00
|
|
|
environment:
|
|
|
|
TWINE_USERNAME:
|
|
|
|
from_secret: pypi_user
|
|
|
|
TWINE_PASSWORD:
|
|
|
|
from_secret: pypi_pass
|
|
|
|
|
|
|
|
when:
|
|
|
|
event:
|
|
|
|
- tag
|
|
|
|
|
|
|
|
depends_on:
|
|
|
|
- tests
|
|
|
|
- docs
|
|
|
|
|
|
|
|
commands:
|
2024-05-23 00:17:55 +02:00
|
|
|
- . .drone/update-pip-package.sh
|
2023-08-06 11:08:01 +02:00
|
|
|
|
2023-09-19 00:36:16 +02:00
|
|
|
###
|
|
|
|
### Checkpoint step that waits for all the package update
|
|
|
|
### steps to complete before proceeding to the next steps.
|
|
|
|
###
|
|
|
|
|
2023-09-18 14:15:29 +02:00
|
|
|
- name: wait-pkg-update
|
|
|
|
image: alpine
|
|
|
|
|
|
|
|
when:
|
|
|
|
branch:
|
|
|
|
- master
|
|
|
|
event:
|
|
|
|
- push
|
|
|
|
|
|
|
|
depends_on:
|
|
|
|
- update-arch-packages
|
2023-09-23 16:20:28 +02:00
|
|
|
- update-rpm-repo
|
2023-09-19 00:36:16 +02:00
|
|
|
- update-apt-repo
|
2023-09-18 14:15:29 +02:00
|
|
|
|
|
|
|
commands:
|
|
|
|
- echo "All packages have been successfully updated"
|
|
|
|
|
2023-09-19 00:36:16 +02:00
|
|
|
###
|
|
|
|
### Notifies about a new release
|
|
|
|
###
|
|
|
|
|
2023-08-06 11:08:01 +02:00
|
|
|
- name: notify-release
|
|
|
|
image: python:3.11-alpine
|
|
|
|
environment:
|
|
|
|
WORKER_RPC_SECRET:
|
|
|
|
from_secret: worker_rpc_secret
|
|
|
|
|
|
|
|
when:
|
|
|
|
event:
|
|
|
|
- tag
|
|
|
|
|
|
|
|
depends_on:
|
|
|
|
- update-pip-package
|
|
|
|
|
|
|
|
commands:
|
|
|
|
- apk add --update --no-cache curl
|
|
|
|
- |
|
|
|
|
curl --silent -XPOST \
|
|
|
|
-H "X-Token: $WORKER_RPC_SECRET" \
|
|
|
|
"https://worker.ci-cd.platypush.tech/hook/notify-platypush-release?version=$(python setup.py --version)"
|
2023-08-06 11:14:12 +02:00
|
|
|
|
2023-09-19 00:36:16 +02:00
|
|
|
###
|
|
|
|
### Notifies about a change in the CI/CD build status
|
|
|
|
###
|
|
|
|
|
2023-08-06 11:14:12 +02:00
|
|
|
- name: notify-build-status
|
|
|
|
image: alpine
|
|
|
|
environment:
|
|
|
|
WORKER_RPC_SECRET:
|
|
|
|
from_secret: worker_rpc_secret
|
|
|
|
|
|
|
|
when:
|
|
|
|
branch:
|
|
|
|
- master
|
|
|
|
event:
|
|
|
|
- push
|
2023-08-07 00:05:13 +02:00
|
|
|
status:
|
|
|
|
- success
|
|
|
|
- failure
|
2023-08-06 11:14:12 +02:00
|
|
|
|
|
|
|
depends_on:
|
2023-09-18 14:15:29 +02:00
|
|
|
- wait-pkg-update
|
2023-08-06 11:14:12 +02:00
|
|
|
|
|
|
|
commands:
|
|
|
|
- apk add --update --no-cache curl
|
|
|
|
- |
|
|
|
|
curl --silent -XPOST \
|
|
|
|
-H "X-Token: $WORKER_RPC_SECRET" \
|
|
|
|
"https://worker.ci-cd.platypush.tech/hook/notify-platypush-build?status=$DRONE_BUILD_STATUS"
|