run basic ci-workflow

parent e304797d
Pipeline #9110 passed with stages
in 3 minutes and 40 seconds
include:
- project: 'memoriav/memobase-2020/utilities/ci-templates'
file: 'docker-image.yml'
variables:
DOCKER_TLS_CERTDIR: ""
default:
image: golang:1.14
stages:
- test
- publish
.test_setup: &test_setup
- mkdir -p /go/src/gitlab.switch.ch/${CI_PROJECT_NAMESPACE}
- ln -s $CI_PROJECT_DIR /go/src/gitlab.switch.ch/memoriav/memobase-2020/services/url-checker
- cd /go/src/gitlab.switch.ch/memoriav/memobase-2020/services/url-checker
lint:
stage: test
tags: [mbr]
before_script:
- *test_setup
- go get -u golang.org/x/lint/golint
script:
- golint -set_exit_status gitlab.switch.ch/memoriav/memobase-2020/services/url-checker/cmd/main
allow_failure: true
unit:
stage: test
tags: [mbr]
before_script: [*test_setup]
script:
- go test -short gitlab.switch.ch/memoriav/memobase-2020/services/url-checker/cmd/main
allow_failure: true
race:
stage: test
tags: [mbr]
before_script: [*test_setup]
script:
- go test -race -short gitlab.switch.ch/memoriav/memobase-2020/services/url-checker/cmd/main
allow_failure: true
msan:
stage: test
tags: [mbr]
before_script: [*test_setup]
script:
- go test -msan -short gitlab.switch.ch/memoriav/memobase-2020/services/url-checker/cmd/main
allow_failure: true
build:
stage: test
tags: [mbr]
before_script: [*test_setup]
script:
- go build gitlab.switch.ch/memoriav/memobase-2020/services/url-checker/cmd/main
FROM golang:1.14 as builder
RUN adduser --system appuser
WORKDIR $GOPATH/src/gitlab.switch.ch/memoriav/memobase-2020/services/url-checker
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o bin/app -a gitlab.switch.ch/memoriav/memobase-2020/services/url-checker/cmd/main
FROM scratch
WORKDIR /app
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /go/src/gitlab.switch.ch/memoriav/memobase-2020/services/url-checker/bin/app /app
COPY --from=builder /etc/passwd /etc/passwd
USER appuser
EXPOSE 81
ENTRYPOINT ["/app/app"]
Markdown is supported
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