-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
38 lines (36 loc) · 1.1 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
stages:
- tests
- build
sonarqube:
image:
name: sonarsource/sonar-scanner-cli:latest
variables:
SONAR_TOKEN: $SONAR_TOKEN_GIT
SONAR_HOST_URL: $SONAR_URL_GIT
SONAR_USER_HOME: $CI_PROJECT_DIR"/.sonar" # Defines the location of the analysis task cache
GIT_DEPTH: 0 # Tells git to fetch all the branches of the project, required by the analysis task
cache:
key: $CI_JOB_NAME
paths:
- .sonar/cache
stage: tests
script:
- sonar-scanner -Dsonar.projectKey=goverwatch -Dsonar.login=$SONAR_LOGIN_GIT -Dsonar.password=$SONAR_PW_GIT
allow_failure: true
only:
- merge_requests
- master
build_binary_with_release_tag:
stage: build
image: golang:buster
rules:
- if: $CI_COMMIT_TAG
before_script:
- apt update && apt upgrade -y
- apt install libpcap-dev curl gcc-mingw-w64-x86-64 file -y
- go get
- export GOOS=windows
- export GOARCH=amd64
script:
- go build -o goverwatch_$CI_COMMIT_TAG.exe main.go
- curl --location --request POST 'https://cdn.aptinstall.de/upload' --form 'file=@goverwatch_'$CI_COMMIT_TAG'.exe' --form 'key='$API_KEY