manga-dlp/.drone.yml

221 lines
4 KiB
YAML
Raw Normal View History

2021-12-19 17:22:41 +01:00
---
######################
# sonarqube analysis #
######################
kind: pipeline
type: docker
name: sonarqube-analysis
platform:
os: linux
arch: amd64
trigger:
event:
- push
2021-12-19 17:22:41 +01:00
2022-05-10 16:38:14 +02:00
# steps
2021-12-19 17:22:41 +01:00
steps:
2022-05-10 16:38:14 +02:00
# test python code
- name: 'test code and generate coverage report'
image: 'cr.44net.ch/drone-plugins/test'
pull: if-not-exists
2022-05-10 22:03:52 +02:00
group: test
2022-05-10 16:38:14 +02:00
commands:
2022-05-10 16:43:01 +02:00
- pip install -r requirements.txt
2022-05-10 16:38:14 +02:00
- coverage erase
2022-05-10 16:58:01 +02:00
- coverage run -m pytest --verbose
2022-05-10 16:38:14 +02:00
- coverage xml -i
# upload analysis to sonarqube
- name: 'sonarqube: analyse code'
image: 'cr.44net.ch/drone-plugins/sonarqube'
pull: if-not-exists
group: test
settings:
sonar_host: 'https://sonarqube.44net.ch'
sonar_token:
2022-05-10 22:07:35 +02:00
from_secret: sq_44net_token
2022-05-10 17:31:03 +02:00
usingProperties: true
2021-12-24 16:30:50 +01:00
---
################
# docker build #
################
kind: pipeline
type: docker
name: docker-build-arm64
platform:
os: linux
arch: arm64
trigger:
event:
- tag
2021-12-24 16:30:50 +01:00
# build steps arm64
steps:
- name: 'build and publish docker image'
image: plugins/docker
pull: if-not-exists
group: build
settings:
repo: olofvndrhr/manga-dlp
context: docker
dockerfile: docker/Dockerfile.arm64
auto_tag: true
auto_tag_suffix: linux-arm64
username:
2022-05-10 22:07:35 +02:00
from_secret: cr-dhub-username
password:
2022-05-10 22:07:35 +02:00
from_secret: cr-dhub-key
2021-12-24 16:30:50 +01:00
---
kind: pipeline
type: docker
name: docker-build-amd64
platform:
os: linux
arch: amd64
trigger:
event:
- tag
2021-12-24 16:30:50 +01:00
# build steps amd64
steps:
- name: 'build and publish docker image'
image: plugins/docker
pull: if-not-exists
group: build
settings:
repo: olofvndrhr/manga-dlp
context: docker
dockerfile: docker/Dockerfile.amd64
auto_tag: true
auto_tag_suffix: linux-amd64
username:
2022-05-10 22:07:35 +02:00
from_secret: cr-dhub-username
password:
2022-05-10 22:07:35 +02:00
from_secret: cr-dhub-key
2021-12-24 16:30:50 +01:00
---
kind: pipeline
type: docker
name: docker-publish-manifest
platform:
os: linux
arch: amd64
trigger:
event:
- tag
2021-12-24 16:30:50 +01:00
# build steps
steps:
- name: 'publish manifest'
image: plugins/manifest
settings:
spec: docker/manifest.tmpl
auto_tag: true
ignore_missing: true
username:
2022-05-10 22:07:35 +02:00
from_secret: cr-dhub-username
password:
2022-05-10 22:07:35 +02:00
from_secret: cr-dhub-key
2021-12-24 16:30:50 +01:00
depends_on:
- docker-build-amd64
- docker-build-arm64
2022-05-10 16:38:14 +02:00
---
###############
# git release #
###############
2022-05-10 16:38:14 +02:00
kind: pipeline
type: docker
2022-05-10 22:07:35 +02:00
name: git-release
2022-05-10 16:38:14 +02:00
platform:
os: linux
arch: amd64
trigger:
event:
- tag
# publish release on gitea and github
2022-05-10 16:38:14 +02:00
steps:
2022-05-10 18:28:09 +02:00
- name: 'create release tar'
image: 'cr.44net.ch/baseimages/debian-base'
pull: if-not-exists
group: publish
2022-05-10 18:27:19 +02:00
commands:
- tar -czf manga-dlp-${DRONE_TAG}.tar.gz --files-from=release-files.txt
2022-05-10 18:05:28 +02:00
- name: 'publish gitea release'
image: plugins/gitea-release
pull: if-not-exists
group: publish
2022-05-10 16:38:14 +02:00
settings:
api_key:
2022-05-10 22:07:35 +02:00
from_secret: gitea-token
2022-05-10 16:38:14 +02:00
base_url: https://git.44net.ch
2022-05-10 18:27:19 +02:00
files: manga-dlp-${DRONE_TAG}.tar.gz
2022-05-10 16:38:14 +02:00
title: 'manga-dlp release: ${DRONE_TAG}'
note: CHANGELOG.md
2022-05-10 18:05:28 +02:00
- name: 'publish github release'
image: plugins/github-release
pull: if-not-exists
group: publish
settings:
api_key:
2022-05-10 22:07:35 +02:00
from_secret: github-token
files: manga-dlp-${DRONE_TAG}.tar.gz
title: 'manga-dlp release: ${DRONE_TAG}'
note: CHANGELOG.md
2022-05-10 16:38:14 +02:00
#---
#################
## publish pypi #
#################
#kind: pipeline
#type: docker
#name: publish-pypi-package
#
#platform:
# os: linux
2022-05-10 16:38:14 +02:00
# arch: amd64
#
#trigger:
# event:
# - tag
#
## anchors
#pypi_secrets: &pypi_secrets
# username:
# from_secret: pypi-username
# password:
# from_secret: pypi-token
#
#pypi_plugin: &pypi_plugin
# image: plugins/pypi
# pull: if-not-exists
2022-05-10 16:38:14 +02:00
# group: publish
#
2022-05-10 16:38:14 +02:00
## publish package on pypi
#steps:
# - name: 'publish or update pypi package'
# <<: *pypi_plugin
# settings:
# # repository:
# setupfile: setup.py
# <<: *pypi_secrets