ansible/.drone.yml
Tobias Trabelsi 66b678830e
All checks were successful
continuous-integration/drone/push Build is passing
refactored pipeline to use anchores
2022-04-23 18:25:53 +02:00

595 lines
10 KiB
YAML

---
kind: pipeline
type: kubernetes
name: build-debian
platform:
os: linux
arch: amd64
when_ressource: &WHEN_TEMPLATE_DEV
when:
event:
- push
- pull_request
- cron
resources:
limits:
cpu: 200
memory: 1024MiB
settings_template: &SETTINGS_TEMPLATE
password:
from_secret: docker_password
username:
from_secret: docker_username
repo: lerentis/ansible
steps:
- name: build-ubuntu-22
image: plugins/kaniko
settings:
dockerfile: ubuntu-22.04/Dockerfile
<<: *SETTINGS_TEMPLATE
tags:
- ubuntu-22.04-dev
<<: *WHEN_TEMPLATE_DEV
- name: build-ubuntu-20
image: plugins/kaniko
settings:
dockerfile: ubuntu-20.04/Dockerfile
<<: *SETTINGS_TEMPLATE
tags:
- ubuntu-20.04-dev
<<: *WHEN_TEMPLATE_DEV
- name: build-ubuntu-18
image: plugins/kaniko
settings:
dockerfile: ubuntu-18.04/Dockerfile
<<: *SETTINGS_TEMPLATE
tags:
- ubuntu-18.04-dev
<<: *WHEN_TEMPLATE_DEV
- name: build-ubuntu-16
image: plugins/kaniko
settings:
dockerfile: ubuntu-16.04/Dockerfile
<<: *SETTINGS_TEMPLATE
tags:
- ubuntu-16.04-dev
<<: *WHEN_TEMPLATE_DEV
- name: build-ubuntu-14
image: plugins/kaniko
settings:
dockerfile: ubuntu-14.04/Dockerfile
<<: *SETTINGS_TEMPLATE
tags:
- ubuntu-14.04-dev
<<: *WHEN_TEMPLATE_DEV
- name: build-debian-8
image: plugins/kaniko
settings:
dockerfile: debian-8/Dockerfile
<<: *SETTINGS_TEMPLATE
tags:
- debian-8-dev
<<: *WHEN_TEMPLATE_DEV
- name: build-debian-9
image: plugins/kaniko
settings:
dockerfile: debian-9/Dockerfile
<<: *SETTINGS_TEMPLATE
tags:
- debian-9-dev
<<: *WHEN_TEMPLATE_DEV
- name: build-debian-10
image: plugins/kaniko
settings:
dockerfile: debian-10/Dockerfile
<<: *SETTINGS_TEMPLATE
tags:
- debian-10-dev
<<: *WHEN_TEMPLATE_DEV
---
kind: pipeline
type: kubernetes
name: build-rhel
platform:
os: linux
arch: amd64
when_ressource: &WHEN_TEMPLATE_DEV
when:
event:
- push
- pull_request
- cron
resources:
limits:
cpu: 200
memory: 1024MiB
settings_template: &SETTINGS_TEMPLATE
password:
from_secret: docker_password
username:
from_secret: docker_username
repo: lerentis/ansible
steps:
- name: build-fedora-34
image: plugins/kaniko
settings:
dockerfile: fedora-34/Dockerfile
<<: *SETTINGS_TEMPLATE
tags:
- fedora-34-dev
<<: *WHEN_TEMPLATE_DEV
- name: build-fedora-35
image: plugins/kaniko
settings:
dockerfile: fedora-35/Dockerfile
<<: *SETTINGS_TEMPLATE
tags:
- fedora-35-dev
<<: *WHEN_TEMPLATE_DEV
- name: build-fedora-36
image: plugins/kaniko
settings:
dockerfile: fedora-36/Dockerfile
<<: *SETTINGS_TEMPLATE
tags:
- fedora-36-dev
<<: *WHEN_TEMPLATE_DEV
- name: build-fedora-37
image: plugins/kaniko
settings:
dockerfile: fedora-37/Dockerfile
<<: *SETTINGS_TEMPLATE
tags:
- fedora-37-dev
<<: *WHEN_TEMPLATE_DEV
- name: build-almalinux-8
image: plugins/kaniko
settings:
dockerfile: almalinux-8/Dockerfile
<<: *SETTINGS_TEMPLATE
tags:
- almalinux-8-dev
<<: *WHEN_TEMPLATE_DEV
- name: build-centos-7
image: plugins/kaniko
settings:
dockerfile: centos-7/Dockerfile
<<: *SETTINGS_TEMPLATE
tags:
- centos-7-dev
<<: *WHEN_TEMPLATE_DEV
---
kind: pipeline
type: kubernetes
name: build-alpine
platform:
os: linux
arch: amd64
when_ressource: &WHEN_TEMPLATE_DEV
when:
event:
- push
- pull_request
- cron
resources:
limits:
cpu: 200
memory: 1024MiB
settings_template: &SETTINGS_TEMPLATE
password:
from_secret: docker_password
username:
from_secret: docker_username
repo: lerentis/ansible
steps:
- name: build-alpine-3-14
image: plugins/kaniko
settings:
dockerfile: alpine-3.14/Dockerfile
<<: *SETTINGS_TEMPLATE
tags:
- alpine-3.14-dev
<<: *WHEN_TEMPLATE_DEV
- name: build-alpine-3-15
image: plugins/kaniko
settings:
dockerfile: alpine-3.15/Dockerfile
<<: *SETTINGS_TEMPLATE
tags:
- alpine-3.15-dev
<<: *WHEN_TEMPLATE_DEV
---
kind: pipeline
type: kubernetes
name: build-arch
platform:
os: linux
arch: amd64
when_ressource: &WHEN_TEMPLATE_DEV
when:
event:
- push
- pull_request
- cron
resources:
limits:
cpu: 200
memory: 1024MiB
settings_template: &SETTINGS_TEMPLATE
password:
from_secret: docker_password
username:
from_secret: docker_username
repo: lerentis/ansible
steps:
- name: build-arch
image: plugins/kaniko
settings:
dockerfile: arch/Dockerfile
<<: *SETTINGS_TEMPLATE
tags:
- arch-dev
<<: *WHEN_TEMPLATE_DEV
---
kind: pipeline
type: kubernetes
name: release-debian
platform:
os: linux
arch: amd64
when_ressource_tag: &WHEN_TEMPLATE_TAG
when:
event:
- tag
resources:
limits:
cpu: 200
memory: 1024MiB
settings_template: &SETTINGS_TEMPLATE
password:
from_secret: docker_password
username:
from_secret: docker_username
repo: lerentis/ansible
steps:
- name: build-ubuntu-22-release
image: plugins/kaniko
settings:
dockerfile: ubuntu-22.04/Dockerfile
<<: *SETTINGS_TEMPLATE
tags:
- ubuntu-22.04
<<: *WHEN_TEMPLATE_TAG
- name: build-ubuntu-20-release
image: plugins/kaniko
settings:
dockerfile: ubuntu-20.04/Dockerfile
<<: *SETTINGS_TEMPLATE
tags:
- ubuntu-20.04
<<: *WHEN_TEMPLATE_TAG
- name: build-ubuntu-18-release
image: plugins/kaniko
settings:
dockerfile: ubuntu-18.04/Dockerfile
<<: *SETTINGS_TEMPLATE
tags:
- ubuntu-18.04
<<: *WHEN_TEMPLATE_TAG
- name: build-ubuntu-16-release
image: plugins/kaniko
settings:
dockerfile: ubuntu-16.04/Dockerfile
<<: *SETTINGS_TEMPLATE
tags:
- ubuntu-16.04
<<: *WHEN_TEMPLATE_TAG
- name: build-ubuntu-14-release
image: plugins/kaniko
settings:
dockerfile: ubuntu-14.04/Dockerfile
<<: *SETTINGS_TEMPLATE
tags:
- ubuntu-14.04
<<: *WHEN_TEMPLATE_TAG
- name: build-debian-8-release
image: plugins/kaniko
settings:
dockerfile: debian-8/Dockerfile
<<: *SETTINGS_TEMPLATE
tags:
- debian-8
<<: *WHEN_TEMPLATE_TAG
- name: build-debian-9-release
image: plugins/kaniko
settings:
dockerfile: debian-9/Dockerfile
<<: *SETTINGS_TEMPLATE
tags:
- debian-9
<<: *WHEN_TEMPLATE_TAG
- name: build-debian-10-release
image: plugins/kaniko
settings:
dockerfile: debian-10/Dockerfile
<<: *SETTINGS_TEMPLATE
tags:
- debian-10
<<: *WHEN_TEMPLATE_TAG
---
kind: pipeline
type: kubernetes
name: release-rhel
platform:
os: linux
arch: amd64
when_ressource_tag: &WHEN_TEMPLATE_TAG
when:
event:
- tag
resources:
limits:
cpu: 200
memory: 1024MiB
settings_template: &SETTINGS_TEMPLATE
password:
from_secret: docker_password
username:
from_secret: docker_username
repo: lerentis/ansible
steps:
- name: build-fedora-34-release
image: plugins/kaniko
settings:
dockerfile: fedora-34/Dockerfile
<<: *SETTINGS_TEMPLATE
tags:
- fedora-34
<<: *WHEN_TEMPLATE_TAG
- name: build-fedora-35-release
image: plugins/kaniko
settings:
dockerfile: fedora-35/Dockerfile
<<: *SETTINGS_TEMPLATE
tags:
- fedora-35
<<: *WHEN_TEMPLATE_TAG
- name: build-fedora-36-release
image: plugins/kaniko
settings:
dockerfile: fedora-36/Dockerfile
<<: *SETTINGS_TEMPLATE
tags:
- fedora-36
<<: *WHEN_TEMPLATE_TAG
- name: build-fedora-37-release
image: plugins/kaniko
settings:
dockerfile: fedora-37/Dockerfile
<<: *SETTINGS_TEMPLATE
tags:
- fedora-37
<<: *WHEN_TEMPLATE_TAG
- name: build-almalinux-8-release
image: plugins/kaniko
settings:
dockerfile: almalinux-8/Dockerfile
<<: *SETTINGS_TEMPLATE
tags:
- almalinux-8
<<: *WHEN_TEMPLATE_TAG
- name: build-centos-7-release
image: plugins/kaniko
settings:
dockerfile: centos-7/Dockerfile
<<: *SETTINGS_TEMPLATE
tags:
- centos-7
<<: *WHEN_TEMPLATE_TAG
---
kind: pipeline
type: kubernetes
name: release-alpine
platform:
os: linux
arch: amd64
when_ressource_tag: &WHEN_TEMPLATE_TAG
when:
event:
- tag
resources:
limits:
cpu: 200
memory: 1024MiB
settings_template: &SETTINGS_TEMPLATE
password:
from_secret: docker_password
username:
from_secret: docker_username
repo: lerentis/ansible
steps:
- name: build-alpine-3.14-release
image: plugins/kaniko
settings:
dockerfile: alpine-3.14/Dockerfile
<<: *SETTINGS_TEMPLATE
tags:
- alpine-3.14
<<: *WHEN_TEMPLATE_TAG
- name: build-alpine-3.15-release
image: plugins/kaniko
settings:
dockerfile: alpine-3.15/Dockerfile
<<: *SETTINGS_TEMPLATE
tags:
- alpine-3.15
<<: *WHEN_TEMPLATE_TAG
---
kind: pipeline
type: kubernetes
name: release-arch
when_ressource_tag: &WHEN_TEMPLATE_TAG
when:
event:
- tag
resources:
limits:
cpu: 200
memory: 1024MiB
settings_template: &SETTINGS_TEMPLATE
password:
from_secret: docker_password
username:
from_secret: docker_username
repo: lerentis/ansible
platform:
os: linux
arch: amd64
steps:
- name: build-arch-release
image: plugins/kaniko
settings:
dockerfile: arch/Dockerfile
<<: *SETTINGS_TEMPLATE
tags:
- arch
<<: *WHEN_TEMPLATE_TAG
---
kind: pipeline
type: kubernetes
name: notify-build
platform:
os: linux
arch: amd64
steps:
- name: notify
image: appleboy/drone-telegram
settings:
message: "Commit {{ commit.message }} ran with build {{ build.number }} and finished with status {{ build.status }}."
to:
from_secret: telegram_userid
token:
from_secret: telegram_secret
when:
status:
- failure
- success
event:
- push
- pull_request
- cron
depends_on:
- build-arch
- build-alpine
- build-debian
- build-rhel
---
kind: pipeline
type: kubernetes
name: notify-release
platform:
os: linux
arch: amd64
steps:
- name: notify
image: appleboy/drone-telegram
settings:
message: "Release {{ build.tag }} ran with build {{ build.number }} and finished with status {{ build.status }}."
to:
from_secret: telegram_userid
token:
from_secret: telegram_secret
when:
status:
- failure
- success
event:
- tag
depends_on:
- release-arch
- release-alpine
- release-debian
- release-rhel