-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
57 lines (51 loc) · 929 Bytes
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# .gitlab-ci.yml
stages:
- build
- test
- lint
- security
- deploy
variables:
GOSAST_VERSION: v1.0.0
# Build Stage
build:
stage: build
image: golang:1.20-alpine
script:
- go build -o gosast ./cmd/gosast
artifacts:
paths:
- gosast
only:
- branches
# Test Stage
test:
stage: test
image: golang:1.20-alpine
script:
- go test ./...
only:
- branches
# Security Analysis Stage
gosast_linter:
stage: security
image: registry.example.com/your-repo/gosast:${GOSAST_VERSION}
script:
- ./gosast --config ./config/.gosast.yml --format json --output sast-report.json
artifacts:
reports:
sast: sast-report.json
paths:
- sast-report.json
allow_failure: false
only:
- branches
# Deployment Stage
deploy:
stage: deploy
image: alpine:latest
script:
- ./deploy.sh # Replace with your deployment script
only:
- main
when: manual