forked from platypush/platypush
Fabio Manganiello
96f265a4a2
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 ```
357 lines
5.5 KiB
YAML
357 lines
5.5 KiB
YAML
---
|
|
kind: pipeline
|
|
type: docker
|
|
name: default
|
|
|
|
volumes:
|
|
- name: docs
|
|
host:
|
|
path: /opt/docs/platypush
|
|
|
|
- name: repos
|
|
host:
|
|
path: /opt/repos/platypush
|
|
|
|
steps:
|
|
|
|
###
|
|
### Mirror the current repository state to Github
|
|
###
|
|
|
|
- name: github-mirror
|
|
image: alpine
|
|
environment:
|
|
SSH_PUBKEY:
|
|
from_secret: ssh_pubkey
|
|
SSH_PRIVKEY:
|
|
from_secret: ssh_privkey
|
|
|
|
commands:
|
|
- . .drone/github-mirror.sh
|
|
|
|
###
|
|
### Rebuild the docs
|
|
###
|
|
|
|
- name: docs
|
|
image: alpine
|
|
volumes:
|
|
- name: docs
|
|
path: /docs
|
|
|
|
commands:
|
|
- . .drone/rebuild-docs.sh
|
|
|
|
when:
|
|
event:
|
|
- tag
|
|
|
|
###
|
|
### Run the tests
|
|
###
|
|
|
|
- name: tests
|
|
image: alpine
|
|
commands:
|
|
- . .drone/run-tests.sh
|
|
|
|
###
|
|
### Rebuild the UI files
|
|
###
|
|
|
|
- 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:
|
|
- . .drone/build-ui.sh
|
|
|
|
###
|
|
### 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:
|
|
- . .drone/update-components-cache.sh
|
|
|
|
###
|
|
### Update the Arch packages
|
|
###
|
|
|
|
- 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
|
|
event:
|
|
- push
|
|
|
|
depends_on:
|
|
- update-components-cache
|
|
|
|
commands:
|
|
- . .drone/update-arch-packages.sh
|
|
|
|
###
|
|
### Update the Debian (stable) packages
|
|
###
|
|
|
|
- name: update-debian-stable-packages
|
|
image: debian:stable
|
|
volumes:
|
|
- name: repos
|
|
path: /repos
|
|
|
|
environment:
|
|
DEB_VERSION: stable
|
|
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
|
|
|
|
###
|
|
### Update the Debian (oldstable) packages
|
|
###
|
|
|
|
- name: update-debian-oldstable-packages
|
|
image: debian:oldstable
|
|
volumes:
|
|
- name: repos
|
|
path: /repos
|
|
|
|
environment:
|
|
DEB_VERSION: oldstable
|
|
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
|
|
|
|
###
|
|
### Updates the APT repository after new packages have been pushed
|
|
###
|
|
|
|
- name: update-apt-repo
|
|
image: debian:stable
|
|
volumes:
|
|
- name: repos
|
|
path: /repos
|
|
|
|
environment:
|
|
REPOS_ROOT: /repos
|
|
APT_ROOT: /repos/apt
|
|
PGP_PUBKEY:
|
|
from_secret: apt_pgp_pub_key
|
|
PGP_PRIVKEY:
|
|
from_secret: apt_pgp_priv_key
|
|
|
|
when:
|
|
branch:
|
|
- master
|
|
event:
|
|
- push
|
|
|
|
depends_on:
|
|
- update-debian-stable-packages
|
|
- update-debian-oldstable-packages
|
|
|
|
commands:
|
|
- . .drone/update-apt-repo.sh
|
|
|
|
###
|
|
### Update the RPM (stable) packages
|
|
###
|
|
|
|
- name: update-rpm-repo
|
|
image: fedora
|
|
volumes:
|
|
- name: repos
|
|
path: /repos
|
|
|
|
environment:
|
|
RPM_VERSION: stable
|
|
REPOS_ROOT: /repos
|
|
RPM_ROOT: /repos/rpm
|
|
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:
|
|
- update-components-cache
|
|
|
|
commands:
|
|
- . .drone/update-rpm-repo.sh
|
|
|
|
###
|
|
### Updates the pip package upon new releases
|
|
###
|
|
|
|
- name: update-pip-package
|
|
image: alpine
|
|
environment:
|
|
TWINE_USERNAME:
|
|
from_secret: pypi_user
|
|
TWINE_PASSWORD:
|
|
from_secret: pypi_pass
|
|
|
|
when:
|
|
event:
|
|
- tag
|
|
|
|
depends_on:
|
|
- tests
|
|
- docs
|
|
|
|
commands:
|
|
- . .drone/update-pip-package.sh
|
|
|
|
###
|
|
### Checkpoint step that waits for all the package update
|
|
### steps to complete before proceeding to the next steps.
|
|
###
|
|
|
|
- name: wait-pkg-update
|
|
image: alpine
|
|
|
|
when:
|
|
branch:
|
|
- master
|
|
event:
|
|
- push
|
|
|
|
depends_on:
|
|
- update-arch-packages
|
|
- update-rpm-repo
|
|
- update-apt-repo
|
|
|
|
commands:
|
|
- echo "All packages have been successfully updated"
|
|
|
|
###
|
|
### Notifies about a new release
|
|
###
|
|
|
|
- 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)"
|
|
|
|
###
|
|
### Notifies about a change in the CI/CD build status
|
|
###
|
|
|
|
- name: notify-build-status
|
|
image: alpine
|
|
environment:
|
|
WORKER_RPC_SECRET:
|
|
from_secret: worker_rpc_secret
|
|
|
|
when:
|
|
branch:
|
|
- master
|
|
event:
|
|
- push
|
|
status:
|
|
- success
|
|
- failure
|
|
|
|
depends_on:
|
|
- wait-pkg-update
|
|
|
|
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"
|