my-devops-client/.gitlab-ci.yml

26 lines
893 B
YAML

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:
- docker pull nginxdemos/hello:plain-text
# FIXED: Now pointing to the local path inside the repository root
- docker compose -f ./stacks/hello-world/docker-compose.yml up -d