Compare commits

...

33 Commits

Author SHA1 Message Date
31333ea168 Merge pull request 'Removed pull event from build stage' (#106) from test into main
All checks were successful
continuous-integration/drone Build is passing
continuous-integration/drone/promote/staging Build is passing
Reviewed-on: #106
2026-04-04 16:39:53 +02:00
e26c79a9d7 Removed pull event from build stage 2026-04-04 16:39:31 +02:00
200789e832 Merge pull request 'test' (#105) from test into main
Reviewed-on: #105
2026-04-04 16:38:53 +02:00
ae1440fce3 Refactored uat to staging 2026-04-04 16:38:30 +02:00
b58b5777fd Refactored triggers 2026-04-04 16:38:02 +02:00
3e84af9bb5 Merge pull request 'test' (#104) from test into main
Some checks failed
continuous-integration/drone Build was killed
Reviewed-on: #104
2026-04-04 16:36:26 +02:00
83dfdc2cc3 Removed promotion trigger 2026-04-04 16:35:19 +02:00
bbdb27b116 Removed promotion trigger 2026-04-04 16:34:41 +02:00
31f2439033 Merge pull request 'Removed build stage dependency' (#103) from test into main
All checks were successful
continuous-integration/drone Build is passing
continuous-integration/drone/promote/uat Build is passing
Reviewed-on: #103
2026-04-04 16:30:09 +02:00
1da1328870 Removed build stage dependency 2026-04-04 16:29:17 +02:00
15a2ad0b89 Merge pull request 'Removed triggers on build stage' (#102) from test into main
Some checks failed
continuous-integration/drone Build is passing
continuous-integration/drone/promote/uat Build was killed
Reviewed-on: #102
2026-04-04 16:25:35 +02:00
3b5ca4f5b0 Removed triggers on build stage 2026-04-04 16:25:09 +02:00
d179d2d79d Merge pull request 'Light refactor' (#101) from test into main
Reviewed-on: #101
2026-04-04 16:24:35 +02:00
1526648d9a Light refactor 2026-04-04 16:24:12 +02:00
b6813057a4 Merge pull request 'Added pull_request trigger in build stage' (#100) from test into main
Reviewed-on: #100
2026-04-04 16:23:22 +02:00
d1f723c135 Added pull_request trigger in build stage 2026-04-04 16:22:59 +02:00
7882b380b5 Merge pull request 'Removed push trigger from build branch' (#99) from test into main
All checks were successful
continuous-integration/drone Build is passing
Reviewed-on: #99
2026-04-04 16:20:05 +02:00
423281d071 Removed push trigger from build branch 2026-04-04 16:19:44 +02:00
75ecf71370 Merge pull request 'Enhanced triggers' (#98) from test into main
Reviewed-on: #98
2026-04-04 16:18:08 +02:00
44fbc613a3 Enhanced triggers 2026-04-04 16:17:40 +02:00
5fa7d49bcd Merge pull request 'Fixed pipeline stage naming' (#97) from test into main
Reviewed-on: #97
2026-04-04 16:13:32 +02:00
a922531f50 Fixed pipeline stage naming 2026-04-04 16:13:03 +02:00
f356ecdcc0 Merge pull request 'Split deployment from main pipeline' (#96) from test into main
Some checks failed
continuous-integration/drone Build encountered an error
Reviewed-on: #96
2026-04-04 16:11:55 +02:00
9acebb67fe Split deployment from main pipeline 2026-04-04 16:11:17 +02:00
7d32a83af2 Merge pull request 'test' (#95) from test into main
All checks were successful
continuous-integration/drone Build is passing
Reviewed-on: #95
2026-04-04 15:59:25 +02:00
e140319a05 Removed comments 2026-04-04 15:58:58 +02:00
3752da6ebe fixed dotnet step image 2026-04-04 15:58:12 +02:00
a4766c3d48 Merge pull request 'Restored drone image detection' (#94) from test into main
Some checks failed
continuous-integration/drone Build encountered an error
Reviewed-on: #94
2026-04-04 15:57:17 +02:00
1937d2eaa1 Restored drone image detection 2026-04-04 15:56:51 +02:00
14c2205a8d Merge pull request 'removed tags' (#93) from test into main
Some checks failed
continuous-integration/drone Build is failing
Reviewed-on: #93
2026-04-04 15:54:52 +02:00
c2a8b5c797 removed tags 2026-04-04 15:54:19 +02:00
e5b37e9e60 Merge pull request 'Applied nexus to all docker references including docker image' (#92) from test into main
Some checks failed
continuous-integration/drone Build is failing
Reviewed-on: #92
2026-04-04 15:52:22 +02:00
c584d39270 Applied nexus to all docker references including docker image 2026-04-04 15:51:52 +02:00
2 changed files with 35 additions and 50 deletions

View File

@@ -1,10 +1,7 @@
---
kind: pipeline
type: docker
name: cicd-pipeline
# Let Drone handle the clone automatically; it's faster and cleaner.
clone:
depth: 1
name: build-and-package
steps:
- name: build-test-publish
@@ -15,69 +12,57 @@ steps:
- dotnet test --configuration Release --no-build
- dotnet publish --configuration Release --no-build
# --- PACKAGE STAGE ---
# We build the image locally first so we can scan it BEFORE pushing
- name: docker-build
- name: docker-build-and-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
# This builds the image and loads it into the local cache for scanning
dry_run: true
# Set to false once you verify the scan passes, or see the step below
- 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
username: { from_secret: docker_username }
password: { from_secret: docker_password }
- name: vulnerability-scan
image: nexus.khongisa.co.za/trivy:latest
image: aquasec/trivy:0.50.1
environment:
# Trivy needs these to pull the image from your Nexus to scan it
TRIVY_USERNAME:
from_secret: docker_username
TRIVY_PASSWORD:
from_secret: docker_password
TRIVY_USERNAME: { from_secret: docker_username }
TRIVY_PASSWORD: { from_secret: docker_password }
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}
# --- DEPLOY STAGE ---
- name: deploy-uat
trigger:
branch:
- main
event:
exclude:
- promote
---
kind: pipeline
type: docker
name: deploy-to-uat
depends_on:
- build-and-package
steps:
- name: uat-deployment
image: appleboy/drone-ssh
settings:
host:
from_secret: ssh_host
username:
from_secret: ssh_user
password:
from_secret: ssh_password
host: { from_secret: ssh_host }
username: { from_secret: ssh_user }
password: { from_secret: ssh_password }
script:
# Login to Nexus on the remote server
- echo $DOCKER_PASSWORD | docker login nexus.khongisa.co.za -u $DOCKER_USERNAME --password-stdin
- docker pull nexus.khongisa.co.za/webapitest:latest
# Standard Linux cleanup
- docker stop webapi 2>/dev/null || true
- docker rm webapi 2>/dev/null || true
- docker run -d --name webapi --restart unless-stopped -e ASPNETCORE_ENVIRONMENT=Development -p 4000:8081 nexus.khongisa.co.za/webapitest:latest
environment:
DOCKER_USERNAME:
from_secret: docker_username
DOCKER_PASSWORD:
from_secret: docker_password
DOCKER_USERNAME: { from_secret: docker_username }
DOCKER_PASSWORD: { from_secret: docker_password }
trigger:
event:
exclude:
- promote
target:
- staging

View File

@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS final
FROM nexus.khongisa.co.za/aspnet:10.0 AS final
WORKDIR /app
USER app