In order to mitigate against the brute force attacks against Gitlab accounts, we are moving to all edu-ID Logins. We would like to remind you to link your account with your edu-id. Login will be possible only by edu-ID after November 30, 2021. Here you can find the instructions for linking your account.

If you don't have a SWITCH edu-ID, you can create one with this guide here

kind regards

Unverified Commit d166360a authored by Sebastian Schüpbach's avatar Sebastian Schüpbach
Browse files

add ci workflow

parent 84cbe9dc
Pipeline #10349 failed with stages
in 17 seconds
stages:
- test
- publish
variables:
DOCKER_TLS_CERTDIR: ""
PKG_PATH: gitlab.switch.ch/memoriav/memobase-2020/services/histogram/cmd/webservice
default:
image: golang:1.14
.test_setup: &test_setup
- mkdir -p /go/src/github.com/je4
- ln -s $CI_PROJECT_DIR /go/src/gitlab.switch.ch/memoriav/memobase-2020/services/histogram
- cd /go/src/gitlab.switch.ch/memoriav/memobase-2020/services/histogram
indexer:lint:
stage: test
tags: [mbr]
before_script:
- *test_setup
- go get -u golang.org/x/lint/golint
script:
- golint -set_exit_status $PKG_PATH
allow_failure: true
indexer:unit:
stage: test
tags: [mbr]
before_script: [*test_setup]
script:
- go test -short $PKG_PATH
allow_failure: true
indexer:race:
stage: test
tags: [mbr]
before_script: [*test_setup]
script:
- go test -race -short $PKG_PATH
allow_failure: true
#indexer:msan:
# stage: test
# tags: [mbr]
# before_script: [*test_setup]
# script:
# - go test -msan -short $PKG_PATH
# allow_failure: true
indexer:build:
stage: test
tags: [mbr]
before_script: [*test_setup]
script:
- go build $PKG_PATH
.build-image:
stage: publish
image: docker:stable
services:
- docker:dind
before_script:
- apk update && apk add curl
script:
- 'curl --location --output ffprobe --header "PRIVATE-TOKEN: $API_ACCESS_TOKEN" "https://gitlab.switch.ch/api/v4/projects/937/jobs/artifacts/master/raw/ffmpeg_build/bin/ffprobe?job=snapshot"'
- 'curl --location --output convert --header "PRIVATE-TOKEN: $API_ACCESS_TOKEN" "https://gitlab.switch.ch/api/v4/projects/939/jobs/artifacts/master/raw/im_build/bin/convert?job=v6_9_11"'
- 'curl --location --output identify --header "PRIVATE-TOKEN: $API_ACCESS_TOKEN" "https://gitlab.switch.ch/api/v4/projects/939/jobs/artifacts/master/raw/im_build/bin/identify?job=v6_9_11"'
- docker login -u "$REGISTRY_USER" -p "$REGISTRY_PASSWORD" "$REGISTRY"
- docker build --pull -t "$IMAGE_TAG" -f "$DOCKERFILE" .
- docker push "$IMAGE_TAG"
- docker logout
indexer:build-tagged-image:
extends: .build-image
variables:
IMAGE_TAG: "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG"
REGISTRY_PASSWORD: "$CI_REGISTRY_PASSWORD"
REGISTRY_USER: "$CI_REGISTRY_USER"
REGISTRY: "$CI_REGISTRY"
DOCKERFILE: "Dockerfile"
only:
- tags
indexer:build-latest-image:
extends: .build-image
variables:
IMAGE_TAG: "$CI_REGISTRY_IMAGE:latest"
REGISTRY_PASSWORD: "$CI_REGISTRY_PASSWORD"
REGISTRY_USER: "$CI_REGISTRY_USER"
REGISTRY: "$CI_REGISTRY"
DOCKERFILE: "Dockerfile"
only:
- master
indexer:build-feature-branch-image:
extends: .build-image
variables:
IMAGE_TAG: "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME"
REGISTRY_PASSWORD: "$CI_REGISTRY_PASSWORD"
REGISTRY_USER: "$CI_REGISTRY_USER"
REGISTRY: "$CI_REGISTRY"
DOCKERFILE: "Dockerfile.small"
except:
- master
- tags
FROM golang:1.14 as builder
RUN adduser --system appuser
WORKDIR $GOPATH/src/gitlab.switch.ch/memoriav/memobase-2020/services/histogram
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o bin/app -a gitlab.switch.ch/memoriav/memobase-2020/services/histogram/cmd/webservice
FROM perl:5.30-slim-buster
WORKDIR /app
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /go/src/github.com/je4/indexer/bin/app /app
COPY --from=builder /etc/passwd /etc/passwd
RUN apt-get update && \
apt-get install -y exiftool && \
apt-get autoremove -y && \
apt-get clean
ADD ffprobe /usr/bin/
ADD convert /usr/bin/
ADD identify /usr/bin/
USER appuser
ADD web/static/ /app/static
ADD web/template /app/web/template
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