Refactored pipeline to use docker

This commit is contained in:
2026-03-07 11:12:49 +02:00
parent 8a11987b8e
commit 26ee7e85ff
3 changed files with 6 additions and 254 deletions

View File

@@ -1,28 +1,3 @@
---
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
@@ -44,43 +19,12 @@ steps:
- 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
repo: gitea.khongisa.co.za/khwezi/sampleapi
registry: gitea.khongisa.co.za
insecure: false
username:
from_secret: registry-username
from_secret: gitea-username
password:
from_secret: registry-password
from_secret: gitea-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..."
# Apply the manifest remotely via kubectl on the host
- ssh -o StrictHostKeyChecking=no $DRONE_REMOTE_USER@lead.mngoma.lab 'kubectl apply -f -' <<'EOF'
$(cat ./manifests/deploy.yml)
EOF
- echo "Manifest applied successfully."
context: ./SampleApi/bin/Release/net8.0/publish/