2022-04-22 10:44:10 +02:00
|
|
|
---
|
|
|
|
kind: 'pipeline'
|
2023-05-24 10:21:58 +02:00
|
|
|
name: 'build'
|
|
|
|
type: 'kubernetes'
|
2022-04-22 10:44:10 +02:00
|
|
|
|
|
|
|
steps:
|
|
|
|
|
2023-05-24 10:21:58 +02:00
|
|
|
# build and publish
|
|
|
|
- image: 'docker.io/plugins/docker'
|
|
|
|
name: 'publish'
|
|
|
|
pull: 'always'
|
2023-12-29 19:51:15 +01:00
|
|
|
when:
|
|
|
|
branch:
|
|
|
|
- 'master'
|
2024-05-03 16:15:52 +02:00
|
|
|
event:
|
|
|
|
- 'push'
|
2023-12-29 19:51:15 +01:00
|
|
|
|
2023-05-24 10:21:58 +02:00
|
|
|
settings:
|
|
|
|
|
|
|
|
# registery and repos
|
2023-05-24 18:08:08 +02:00
|
|
|
registry: 'cr.simoncor.net'
|
2024-05-03 16:15:52 +02:00
|
|
|
repo: 'cr.simoncor.net/siempie/start-simoncor-net'
|
2023-05-24 10:21:58 +02:00
|
|
|
mtu: '1440'
|
|
|
|
|
|
|
|
# build stuff
|
|
|
|
dockerfile: 'Dockerfile.linux.amd64'
|
|
|
|
daemon_off: 'false'
|
|
|
|
|
|
|
|
# authentication
|
|
|
|
username:
|
|
|
|
from_secret: 'docker_username'
|
|
|
|
password:
|
|
|
|
from_secret: 'docker_password'
|
|
|
|
|
|
|
|
# tags
|
|
|
|
tags:
|
2024-05-03 16:15:52 +02:00
|
|
|
- 'v1.1'
|
2023-05-24 10:21:58 +02:00
|
|
|
- 'latest'
|
2023-05-24 11:29:43 +02:00
|
|
|
|
|
|
|
|
2024-05-03 16:15:52 +02:00
|
|
|
# kubernetes deployment
|
|
|
|
---
|
|
|
|
kind: 'pipeline'
|
|
|
|
name: 'deployment'
|
|
|
|
type: 'kubernetes'
|
|
|
|
|
|
|
|
depends_on:
|
|
|
|
- 'build'
|
|
|
|
|
|
|
|
# disable clone
|
|
|
|
clone:
|
|
|
|
disable: true
|
|
|
|
|
|
|
|
# deployment step
|
|
|
|
steps:
|
|
|
|
|
|
|
|
# kubernetes deployment
|
|
|
|
- name: 'kubernetes deployment'
|
|
|
|
image: 'docker.io/appleboy/drone-ssh:1'
|
|
|
|
when:
|
|
|
|
branch:
|
|
|
|
- 'master'
|
|
|
|
event:
|
|
|
|
- 'push'
|
|
|
|
|
|
|
|
settings:
|
|
|
|
|
|
|
|
# bastion
|
|
|
|
proxy_host: 'siempie.com'
|
|
|
|
proxy_port: '22'
|
|
|
|
proxy_user:
|
|
|
|
from_secret: 'drone_user'
|
|
|
|
proxy_key:
|
|
|
|
from_secret: 'drone_ssh_key'
|
2023-05-24 11:29:43 +02:00
|
|
|
|
2024-05-03 16:15:52 +02:00
|
|
|
# k9s
|
|
|
|
host: 'k9s.siempie.internal'
|
|
|
|
port: '22'
|
|
|
|
user:
|
|
|
|
from_secret: 'drone_user'
|
|
|
|
key:
|
|
|
|
from_secret: 'drone_ssh_key'
|
|
|
|
script:
|
2023-05-24 11:29:43 +02:00
|
|
|
|
2024-05-03 16:15:52 +02:00
|
|
|
# kubernetes deployment
|
|
|
|
- 'kubectl -n simoncor-net rollout restart deployment simoncor-net'
|