Files
yml/jobs/golang.yml

24 lines
864 B
YAML

.golang-build-api:
variables:
#GOPROXY: https://nexus.durp.info/repository/go/
image: registry.internal.durp.info/golang:${GO_VERSION}
script:
# Begin of golang-build-api.sh
- "#Build golang api\nexport GOPATH=/go\nexport PATH=$PATH:$GOPATH/bin\nmkdir output\ngo install \ngo install github.com/swaggo/swag/cmd/swag@v1.8.12 \nswag init\nCGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o ./output/main .\n"
# End of golang-build-api.sh
artifacts:
expire_in: 1 hour
paths:
- $CI_PROJECT_DIR/output
.golang-lint:
variables:
#GOPROXY: https://nexus.durp.info/repository/go/
CGO_ENABLED: 0
image: registry.internal.durp.info/golangci/golangci-lint:${GOLANGCI_LINT_VERISON}
script:
# Begin of golang-lint.sh
- |
#run linter
golangci-lint run ./... --timeout 5m0s
# End of golang-lint.sh