Enhanced triggers

This commit is contained in:
2026-04-04 16:17:40 +02:00
parent a922531f50
commit 44fbc613a3

View File

@@ -1,10 +1,8 @@
---
kind: pipeline kind: pipeline
type: docker type: docker
name: build-and-package name: build-and-package
clone:
depth: 1
steps: steps:
- name: build-test-publish - name: build-test-publish
image: nexus.khongisa.co.za/sdk:10.0 image: nexus.khongisa.co.za/sdk:10.0
@@ -14,41 +12,28 @@ steps:
- dotnet test --configuration Release --no-build - dotnet test --configuration Release --no-build
- dotnet publish --configuration Release --no-build - dotnet publish --configuration Release --no-build
- name: docker-build - name: docker-build-and-push
image: plugins/docker image: plugins/docker
settings: settings:
registry: nexus.khongisa.co.za registry: nexus.khongisa.co.za
repo: nexus.khongisa.co.za/webapitest repo: nexus.khongisa.co.za/webapitest
tags: [ "${DRONE_BUILD_NUMBER}", "latest" ] tags: [ "${DRONE_BUILD_NUMBER}", "latest" ]
username: username: { from_secret: docker_username }
from_secret: docker_username password: { from_secret: docker_password }
password:
from_secret: docker_password
dry_run: true
- name: docker-push
image: plugins/docker
settings:
registry: nexus.khongisa.co.za
repo: nexus.khongisa.co.za/webapitest
tags: [ "${DRONE_BUILD_NUMBER}", "latest" ]
username:
from_secret: docker_username
password:
from_secret: docker_password
- name: vulnerability-scan - name: vulnerability-scan
image: aquasec/trivy:0.50.1 image: aquasec/trivy:0.50.1
environment: environment:
TRIVY_USERNAME: TRIVY_USERNAME: { from_secret: docker_username }
from_secret: docker_username TRIVY_PASSWORD: { from_secret: docker_password }
TRIVY_PASSWORD:
from_secret: docker_password
commands: commands:
- trivy image --exit-code 1 --severity CRITICAL nexus.khongisa.co.za/webapitest:${DRONE_BUILD_NUMBER} - trivy image --image-src remote --exit-code 1 --severity CRITICAL nexus.khongisa.co.za/webapitest:${DRONE_BUILD_NUMBER}
trigger: trigger:
event: event:
- push - push
branch:
- main
--- ---
kind: pipeline kind: pipeline
@@ -77,6 +62,6 @@ steps:
trigger: trigger:
event: event:
- promote - promote
target: target:
- uat - uat