Commit f9b8fd0f authored by Nogweii's avatar Nogweii
Browse files

initial gitlab CI!

parent d657563a
image: golang:latest
variables:
# this must be the same value as the first line of go.mod
REPO_NAME: nogweii.net/go/my-certificate-alert
# The problem is that to be able to use go get, one needs to put
# the repository in the $GOPATH. Making a symbolic link to the
# go module name (from go.mod) allows this.
before_script:
- mkdir -p $GOPATH/src/$(dirname $REPO_NAME)
- ln -svf $CI_PROJECT_DIR $GOPATH/src/$REPO_NAME
- cd $GOPATH/src/$REPO_NAME
stages:
- test
- build
- deploy
format:
stage: test
script:
- go fmt src/
- go vet src/
#- go test -race src/ # TODO: get unit tests
lint:
image: golangci/golangci-lint:v1.42.0
stage: test
script:
- apt update -q
- apt install -q -y jq
- golangci-lint run --issues-exit-code 0 --out-format code-climate | tee gl-code-quality-report.json | jq -r '.[] | "\(.location.path):\(.location.lines.begin) \(.description)"'
artifacts:
reports:
codequality: gl-code-quality-report.json
paths:
- gl-code-quality-report.json
compile:
stage: build
script:
- go build -race -o $CI_PROJECT_DIR/my-certificate-alert
artifacts:
paths:
- my-certificate-alert
manpage:
image:
name: pandoc/core:2.14.1
entrypoint: ["/bin/sh", "-c"]
stage: build
before_script: []
script:
- pandoc --standalone --to man $CI_PROJECT_DIR/my-certificate-alert.1.md -o $CI_PROJECT_DIR/my-certificate-alert.1
artifacts:
paths:
- my-certificate-alert.1
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment