diff --git a/.drone.yml b/.drone.yml index 1965f14..b42cec9 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,10 +1,8 @@ +--- kind: pipeline type: docker name: build-and-package -clone: - depth: 1 - steps: - name: build-test-publish image: nexus.khongisa.co.za/sdk:10.0 @@ -14,41 +12,28 @@ steps: - dotnet test --configuration Release --no-build - dotnet publish --configuration Release --no-build - - 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 - 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 + username: { from_secret: docker_username } + password: { from_secret: docker_password } - name: vulnerability-scan image: aquasec/trivy:0.50.1 environment: - 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} + trigger: event: - push + branch: + - main --- kind: pipeline @@ -77,6 +62,6 @@ steps: trigger: event: - - promote + - promote target: - uat \ No newline at end of file