2023-02-09 17:06:27 +01:00
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: build
|
|
|
|
|
|
|
|
steps:
|
2023-02-23 21:04:26 +01:00
|
|
|
- name: Build Go app
|
|
|
|
image: registry.cuzo.dev/library/golang
|
|
|
|
volumes:
|
|
|
|
- name: deps
|
|
|
|
path: /go
|
|
|
|
commands:
|
2023-03-15 20:38:50 +01:00
|
|
|
- go mod tidy
|
2023-02-23 21:04:26 +01:00
|
|
|
- GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o bin/ cmd/drone-ntfy/main.go
|
|
|
|
|
2023-02-09 17:06:27 +01:00
|
|
|
- name: Build docker image
|
|
|
|
image: registry.cuzo.dev/plugins/docker
|
2023-02-23 21:04:26 +01:00
|
|
|
depends_on:
|
|
|
|
- Build Go app
|
|
|
|
when:
|
|
|
|
ref:
|
|
|
|
include:
|
|
|
|
- refs/heads/main
|
|
|
|
- refs/tags/**
|
2023-02-09 17:06:27 +01:00
|
|
|
privileged: true
|
|
|
|
volumes:
|
|
|
|
- name: manifest
|
|
|
|
path: docker
|
|
|
|
settings:
|
|
|
|
repo: parrazam/drone-ntfy
|
|
|
|
auto_tag: true
|
2023-02-09 17:11:55 +01:00
|
|
|
auto_tag_suffix: linux-amd64
|
2023-02-09 17:06:27 +01:00
|
|
|
mirror: https://registry.cuzo.dev
|
|
|
|
username:
|
|
|
|
from_secret: docker_hub_user
|
|
|
|
password:
|
|
|
|
from_secret: docker_hub_pass
|
|
|
|
|
|
|
|
- name: Upload manifest
|
|
|
|
image: registry.cuzo.dev/plugins/manifest
|
|
|
|
privileged: true
|
2023-02-23 21:04:26 +01:00
|
|
|
depends_on:
|
|
|
|
- Build docker image
|
|
|
|
when:
|
|
|
|
ref:
|
|
|
|
include:
|
|
|
|
- refs/heads/main
|
|
|
|
- refs/tags/**
|
2023-02-09 17:06:27 +01:00
|
|
|
volumes:
|
|
|
|
- name: manifest
|
|
|
|
path: docker
|
|
|
|
settings:
|
|
|
|
target: parrazam/drone-ntfy
|
2023-02-09 17:11:55 +01:00
|
|
|
template: parrazam/drone-ntfy:OS-ARCH
|
2023-02-09 17:06:27 +01:00
|
|
|
auto_tag: true
|
|
|
|
ignore_missing: true
|
|
|
|
username:
|
|
|
|
from_secret: docker_hub_user
|
|
|
|
password:
|
|
|
|
from_secret: docker_hub_pass
|
2023-02-09 17:11:55 +01:00
|
|
|
platforms:
|
|
|
|
- linux/amd64
|
2023-02-09 17:06:27 +01:00
|
|
|
|
|
|
|
image_pull_secrets:
|
|
|
|
- custom_mirror_registry
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
event:
|
|
|
|
- push
|
|
|
|
- tag
|
|
|
|
exclude:
|
|
|
|
- pull_request
|
|
|
|
|
2023-02-23 21:04:26 +01:00
|
|
|
|
2023-02-09 17:06:27 +01:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: release
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: release
|
|
|
|
image: registry.cuzo.dev/plugins/gitea-release
|
|
|
|
settings:
|
|
|
|
api_key:
|
|
|
|
from_secret: drone_api_key
|
|
|
|
base_url: https://git.parravidales.es
|
2023-02-23 21:04:26 +01:00
|
|
|
|
|
|
|
depends_on:
|
|
|
|
- build
|
|
|
|
|
|
|
|
image_pull_secrets:
|
|
|
|
- custom_mirror_registry
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
event:
|
|
|
|
- tag
|
|
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: notify
|
|
|
|
|
|
|
|
steps:
|
2023-02-09 17:06:27 +01:00
|
|
|
- name: send ntfy notification
|
|
|
|
image: registry.cuzo.dev/parrazam/drone-ntfy
|
|
|
|
settings:
|
|
|
|
url: https://ntfy.parravidales.es
|
|
|
|
topic: pipelines
|
|
|
|
priority: low
|
2023-02-23 21:04:26 +01:00
|
|
|
token:
|
|
|
|
from_secret: ntfy_token
|
2023-02-09 17:06:27 +01:00
|
|
|
|
|
|
|
image_pull_secrets:
|
|
|
|
- custom_mirror_registry
|
|
|
|
|
2023-02-23 21:04:26 +01:00
|
|
|
depends_on:
|
|
|
|
- build
|
|
|
|
- release
|