Files
webapitest/.drone.yml

108 lines
2.3 KiB
YAML

---
kind: pipeline
type: kubernetes
name: build
clone:
disable: true
steps:
# git clone code base
- name: git clone
image: drone/git
commands:
# - git clone https://gitea.apps.mngoma.lab/mngomalab/sampleapi.git .
- git clone http://gitea-server.gitea.svc.cluster.local/mngomalab/sampleapi.git .
- git checkout $DRONE_COMMIT
# dotnet restore
- name: dotnet restore
image: mcr.microsoft.com/dotnet/sdk:8.0
commands:
- dotnet restore
# dotnet build
- name: dotnet build
image: mcr.microsoft.com/dotnet/sdk:8.0
commands:
- dotnet build --configuration Release
- ls ./SampleApi/bin/Release/net8.0/
# dotnet test
- 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:
# git clone code base
- name: git clone
image: drone/git
settings:
skip_verify: true
commands:
# - git clone https://gitea.apps.mngoma.lab/mngomalab/sampleapi.git .
- git clone http://gitea-server.gitea.svc.cluster.local/mngomalab/sampleapi.git .
- git checkout $DRONE_COMMIT
# dotnet publish
- name: dotnet publish
image: mcr.microsoft.com/dotnet/sdk:8.0
commands:
- dotnet publish --configuration Release
- ls ./SampleApi/bin/Release/net8.0/publish/
# build and push docker image to in-cluster registry
- name: docker build and push
image: plugins/docker
settings:
repo: registry.registry.svc.cluster.local:5000/experiments/sampleapi
auto_tag: 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:
# git clone code base
- name: git clone
image: drone/git
settings:
skip_verify: true
commands:
# - git clone https://gitea.apps.mngoma.lab/mngomalab/sampleapi.git .
- git clone http://gitea-server.gitea.svc.cluster.local/mngomalab/sampleapi.git .
- git checkout $DRONE_COMMIT
- name: deploy
image: danielgormly/drone-plugin-kube:0.0.1
settings:
template: ./manifests/deploy-app.yml
ca:
from_secret: kube_ca_cert
server: https://lead:6443
token:
from_secret: k3s_token