- R2Devops Co-Founder
- CI/CD Endurer
We will made our demo with Golang & GitLab, because we love Gophers & Tanukis.
But all we explain in this talk can be applied to other programming languages and adapted to other platforms (Github, …)
Speaker
stages:
- test
- build
[...]
go_dependency_scanning:
stage: test
image:
name: aquasec/trivy:0.55.2
entrypoint: [""]
script:
- trivy fs --exit-code 1 --severity "MEDIUM,HIGH,CRITICAL" ./
go_sast:
stage: test
image: securego/gosec:2.21.3
script:
- gosec ./...
build_container_image:
stage: build
image:
name: gcr.io/kaniko-project/executor:v1.23.2-debug
entrypoint: ['']
script:
[...]
A quick sample
spec:
inputs:
stage:
default: test
---
go_lint:
stage: $[[ inputs.stage ]]
image: golangci/golangci-lint:v1.61-alpine
script:
- golangci-lint run --timeout 5m -v
From 57 lines to 14 🤯
stages:
- test
- build
include:
- component: gitlab.com/yodamad-workshops/[...]/go_lint@0.1.1
inputs:
stage: build
- component: gitlab.com/yodamad-workshops/[...]/dockerfile_lint@0.1.0
- component: gitlab.com/yodamad-workshops/[...]/go_unit-tests@0.1.0
- component: gitlab.com/yodamad-workshops/[...]/secret_detection@0.1.0
- component: gitlab.com/yodamad-workshops/[...]/go_dependency_scanning@0.1.0
- component: gitlab.com/yodamad-workshops/[...]/go_sast@0.1.0
- component: gitlab.com/yodamad-workshops/[...]/build_container_image@0.1.0