Newer
Older
image: golang:1.19
stages:
- build
- test
- lint
- release
before_script:
- mkdir -p .cache
- export GOPATH=${CI_PROJECT_DIR}/.cache
test:
stage: test
script:
- go test -v ./...
test_race:
stage: test
script:
- go test -race -v ./...
- go install honnef.co/go/tools/cmd/staticcheck@latest
vet:
stage: lint
script:
- go vet ./...
build_server:
script:
- go build github.com/oidc-mytoken/server/cmd/mytoken-server
build_setup:
stage: build
script:
- go build github.com/oidc-mytoken/server/cmd/mytoken-server/mytoken-setup
build_migratedb:
stage: build
script:
- go build github.com/oidc-mytoken/server/cmd/mytoken-server/mytoken-migratedb
prerelease:
stage: release
image:
name: docker:stable
services:
- docker:dind
only:
- if [ -z "$CI_COMMIT_TAG" ]; then docker run --rm -v $PWD:/tmp/mytoken -w /tmp/mytoken bitnami/git .gitlab-ci-scripts/set-prerel-version.sh; fi;
- .gitlab-ci-scripts/goreleaser.sh
- .gitlab-ci-scripts/upload.sh
- docker run --rm curlimages/curl -d "repo=github.com/oidc-mytoken/server" https://goreportcard.com/checks
before_script:
- mkdir -p /root/.ssh
- cp $KNOWN_HOSTS /root/.ssh/known_hosts
- cp $DEPLOYMENT_SSH_KEY /root/.ssh/id_ed25519 && chmod 0600 /root/.ssh/id_ed25519
script:
- ssh mytoken-dev.vm.fedcloud.eu