Files
webapitest/.drone.yml
2025-10-18 14:24:58 +02:00

82 lines
1.7 KiB
YAML

---
kind: pipeline
type: kubernetes
name: build
clone:
disable: false
steps:
- name: dotnet restore
image: mcr.microsoft.com/dotnet/sdk:8.0
commands:
- dotnet restore
- name: dotnet build
image: mcr.microsoft.com/dotnet/sdk:8.0
commands:
- dotnet build --configuration Release
- ls ./SampleApi/bin/Release/net8.0/
- name: dotnet test
image: mcr.microsoft.com/dotnet/sdk:8.0
commands:
- dotnet test --configuration Release
---
kind: pipeline
type: kubernetes
name: package
depends_on:
- build
clone:
disable: true
steps:
- name: dotnet publish
image: mcr.microsoft.com/dotnet/sdk:8.0
commands:
- dotnet publish --configuration Release
- ls ./SampleApi/bin/Release/net8.0/publish/
- name: docker build and push
image: plugins/docker
settings:
repo: registry-server.registry.svc.cluster.local:5000/sampleapi
auto_tag: true
registry: registry-server.registry.svc.cluster.local:5000
insecure: true
username:
from_secret: registry-username
password:
from_secret: registry-password
dockerfile: Dockerfile
context: ./SampleApi/bin/Release/net8.0/publish/
---
kind: pipeline
type: kubernetes
name: deploy
depends_on:
- package
clone:
disable: true
steps:
- name: deploy via SSH
image: appleboy/drone-ssh
settings:
host: lead.mngoma.lab
username:
from_secret: host-username
password:
from_secret: host-password
port: 22
script:
- set -euo pipefail
- echo "Applying Kubernetes manifest via SSH..."
- cat ./manifests/deploy.yml | kubectl apply -f -
- echo "Manifest applied successfully."