This repository has been archived by the owner on Oct 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
66 lines (64 loc) · 1.79 KB
/
.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
58
59
60
61
62
63
64
65
66
# You can override the included template(s) by including variable overrides
# SAST customization: https://docs.gitlab.com/ee/user/application_security/sast/#customizing-the-sast-settings
# Secret Detection customization: https://docs.gitlab.com/ee/user/application_security/secret_detection/#customizing-settings
# Dependency Scanning customization: https://docs.gitlab.com/ee/user/application_security/dependency_scanning/#customizing-the-dependency-scanning-settings
# Note that environment variables can be set in several places
# See https://docs.gitlab.com/ee/ci/variables/#cicd-variable-precedence
stages:
- build
- docker
- test
variables:
server_image: "$CI_REGISTRY/zerosrealm/tergum/tergum:latest"
agent_image: "$CI_REGISTRY/zerosrealm/tergum/tergum-agent:latest"
build-ui:
stage: build
image: node:17-alpine
only:
- main
script:
# - export ROLLUP_WATCH=false
- cd ui/
- npm install
- npm run build
artifacts:
paths:
- ui/public
build-go:
stage: build
image: golang:1.17-bullseye
only:
- main
script:
- rm www/ -rf
- cp ui/public www/ -r
- go build -trimpath ./cmd/agent
- go build -trimpath ./cmd/server
artifacts:
paths:
- agent
- server
agent:
stage: docker
only:
- main
script:
- export DOCKER_BUILDKIT=1
- docker logout $CI_REGISTRY
- docker login -u $CI_DEPLOY_USER -p $CI_DEPLOY_PASSWORD $CI_REGISTRY
- docker build -f dockerfiles/agent -t $agent_image .
- docker image push $agent_image
server:
stage: docker
only:
- main
script:
- export DOCKER_BUILDKIT=1
- docker logout $CI_REGISTRY
- docker login -u $CI_DEPLOY_USER -p $CI_DEPLOY_PASSWORD $CI_REGISTRY
- docker build -f dockerfiles/server -t $server_image .
- docker image push $server_image
sast:
stage: test
include:
- template: Security/SAST.gitlab-ci.yml