Fixed docker steps to use local nexus properly #89
10
.drone.yml
10
.drone.yml
@@ -21,7 +21,7 @@ steps:
|
|||||||
image: plugins/docker
|
image: plugins/docker
|
||||||
settings:
|
settings:
|
||||||
registry: nexus.khongisa.co.za
|
registry: nexus.khongisa.co.za
|
||||||
repo: nexus.khongisa.co.za/mngomalab/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
|
||||||
@@ -40,13 +40,13 @@ steps:
|
|||||||
TRIVY_PASSWORD:
|
TRIVY_PASSWORD:
|
||||||
from_secret: docker_password
|
from_secret: docker_password
|
||||||
commands:
|
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
|
- name: docker-push
|
||||||
image: plugins/docker
|
image: plugins/docker
|
||||||
settings:
|
settings:
|
||||||
registry: nexus.khongisa.co.za
|
registry: nexus.khongisa.co.za
|
||||||
repo: nexus.khongisa.co.za/mngomalab/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
|
||||||
@@ -66,11 +66,11 @@ steps:
|
|||||||
script:
|
script:
|
||||||
# Login to Nexus on the remote server
|
# Login to Nexus on the remote server
|
||||||
- echo $DOCKER_PASSWORD | docker login nexus.khongisa.co.za -u $DOCKER_USERNAME --password-stdin
|
- 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
|
# Standard Linux cleanup
|
||||||
- docker stop webapi 2>/dev/null || true
|
- docker stop webapi 2>/dev/null || true
|
||||||
- docker rm 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:
|
environment:
|
||||||
DOCKER_USERNAME:
|
DOCKER_USERNAME:
|
||||||
from_secret: docker_username
|
from_secret: docker_username
|
||||||
|
|||||||
Reference in New Issue
Block a user