Files
docker-deluge-openvpn/.drone.yml
Beatrice Dellacà be642e2c4d
Some checks reported errors
continuous-integration/drone/push Build encountered an error
fix pipe
2025-03-29 18:26:16 +01:00

126 lines
3.4 KiB
YAML

---
kind: pipeline
type: kubernetes
name: amd64-main
node_selector: # Ensure this runs on an amd64 runner
arch: amd64
trigger: # Only run on pushes to the main branch
event: [ push ]
branch: [ main ]
steps:
- name: build_push_amd64_latest
image: plugins/docker # Use Docker plugin to build and push image
settings:
repo: bottledpills/deluge-openvpn
tags:
- latest-linux-amd64 # Tag for amd64 variant (main branch → "latest")
username:
from_secret: docker_username # Docker registry credentials (secret)
password:
from_secret: docker_password
---
kind: pipeline
type: kubernetes
name: arm64-main
node_selector: # Ensure this runs on an arm64 runner
arch: arm64
trigger: # Only run on pushes to the main branch
event: [ push ]
branch: [ main ]
steps:
- name: build_push_arm64_latest
image: plugins/docker
settings:
repo: bottledpills/deluge-openvpn
tags:
- latest-linux-arm64 # Tag for arm64 variant (main branch → "latest")
username:
from_secret: docker_username
password:
from_secret: docker_password
---
kind: pipeline
type: kubernetes
name: amd64-tag
node_selector:
arch: amd64
trigger: # Only run on creation of Git tags (releases)
event: [ tag ]
steps:
- name: build_push_amd64_version
image: plugins/docker
settings:
repo: bottledpills/deluge-openvpn
# Use Drone env substitution to strip the leading "v" from the tag [oai_citation_attribution:0‡docs.drone.io](https://docs.drone.io/pipeline/environment/substitution/#:~:text=,0)
tags:
- ${DRONE_TAG##v}-linux-amd64 # e.g. "v2.0.1" → "2.0.1-linux-amd64"
username:
from_secret: docker_username
password:
from_secret: docker_password
---
kind: pipeline
type: kubernetes
name: arm64-tag
node_selector:
arch: arm64
trigger: # Only run on creation of Git tags (releases)
event: [ tag ]
steps:
- name: build_push_arm64_version
image: plugins/docker
settings:
repo: bottledpills/deluge-openvpn
tags:
- ${DRONE_TAG##v}-linux-arm64 # e.g. "v2.0.1" → "2.0.1-linux-arm64"
username:
from_secret: docker_username
password:
from_secret: docker_password
---
kind: pipeline
type: kubernetes
name: manifest-main
# The manifest step can run on either architecture; we'll use amd64 for consistency
node_selector:
arch: amd64
trigger: # Run on main branch pushes (to create "latest" manifest)
event: [ push ]
branch: [ main ]
depends_on: # Wait for both arch images to be built and pushed
- amd64-main
- arm64-main
steps:
- name: push_manifest_latest
image: plugins/manifest # Drone manifest plugin to create multi-arch manifest
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
spec: docker/manifest.tmpl # Use external manifest template for tags and images
---
kind: pipeline
type: kubernetes
name: manifest-tag
node_selector:
arch: amd64
trigger: # Run on tag events (to create versioned manifest)
event: [ tag ]
depends_on:
- amd64-tag
- arm64-tag
steps:
- name: push_manifest_version
image: plugins/manifest
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
spec: docker/manifest.tmpl # Same template handles both latest and version tags