ci: add devsecops scan and automated deployment pipeline
This commit is contained in:
parent
8137b9c61f
commit
d4724a8e0d
|
|
@ -0,0 +1,27 @@
|
||||||
|
stages:
|
||||||
|
- test
|
||||||
|
- deploy
|
||||||
|
|
||||||
|
# -----------------------------------------------------------------
|
||||||
|
# Stage 1: DevSecOps Vulnerability Scanning
|
||||||
|
# -----------------------------------------------------------------
|
||||||
|
security_scan:
|
||||||
|
stage: test
|
||||||
|
image:
|
||||||
|
name: aquasec/trivy:0.49.1
|
||||||
|
entrypoint: [""]
|
||||||
|
script:
|
||||||
|
# Scan the application docker image for High and Critical vulnerabilities
|
||||||
|
- trivy image --severity HIGH,CRITICAL nginxdemos/hello:plain-text
|
||||||
|
|
||||||
|
# -----------------------------------------------------------------
|
||||||
|
# Stage 2: Automated GitOps Deployment
|
||||||
|
# -----------------------------------------------------------------
|
||||||
|
deploy_application:
|
||||||
|
stage: deploy
|
||||||
|
image: docker:24.0.7-cli
|
||||||
|
script:
|
||||||
|
# FIXED: Added the missing hyphen below to make it a proper list item
|
||||||
|
- docker pull nginxdemos/hello:plain-text
|
||||||
|
# Deploy the stack directly onto the host using the shared docker.sock
|
||||||
|
- docker compose -f ../../stacks/applications/hello-world/docker-compose.yml up -d
|
||||||
Loading…
Reference in New Issue