Merge pull request 'Fixed docker steps to use local nexus properly' (#89) from test into main
Some checks failed
continuous-integration/drone Build is failing

Reviewed-on: #89
This commit was merged in pull request #89.
This commit is contained in:
2026-04-04 15:24:33 +02:00

View File

@@ -21,7 +21,7 @@ steps:
image: plugins/docker
settings:
registry: nexus.khongisa.co.za
repo: nexus.khongisa.co.za/mngomalab/webapitest
repo: nexus.khongisa.co.za/webapitest
tags: [ "${DRONE_BUILD_NUMBER}", "latest" ]
username:
from_secret: docker_username
@@ -40,13 +40,13 @@ steps:
TRIVY_PASSWORD:
from_secret: docker_password
commands:
- trivy image --exit-code 1 --severity CRITICAL nexus.khongisa.co.za/mngomalab/webapitest:${DRONE_BUILD_NUMBER}
- trivy image --exit-code 1 --severity CRITICAL nexus.khongisa.co.za/webapitest:${DRONE_BUILD_NUMBER}
- name: docker-push
image: plugins/docker
settings:
registry: nexus.khongisa.co.za
repo: nexus.khongisa.co.za/mngomalab/webapitest
repo: nexus.khongisa.co.za/webapitest
tags: [ "${DRONE_BUILD_NUMBER}", "latest" ]
username:
from_secret: docker_username
@@ -66,11 +66,11 @@ steps:
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/mngomalab/webapitest:latest
- 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/mngomalab/webapitest:latest
- 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