Commit df3cc923 authored by Jürgen Enge's avatar Jürgen Enge
Browse files

Merge branch 'master' of gitlab.switch.ch:memoriav/memobase-2020/services/histogram

parents 4a0d6cef 15686f2d
Pipeline #10357 failed with stages
in 24 seconds
stages:
- test
- publish
variables:
DOCKER_TLS_CERTDIR: ""
default:
image: golang:1.14
.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/histogram
- cd /go/src/gitlab.switch.ch/memoriav/memobase-2020/services/histogram
- go get
.test:lint:
stage: test
tags: [mbr]
before_script:
- *test_setup
- go get -u golang.org/x/lint/golint
script:
- golint -set_exit_status $BIN_PATH
allow_failure: true
.test:unit:
stage: test
tags: [mbr]
before_script: [*test_setup]
script:
- go test -short $BIN_PATH
allow_failure: true
.test:race:
stage: test
tags: [mbr]
before_script: [*test_setup]
script:
- go test -race -short $BIN_PATH
allow_failure: true
#test:msan:
# stage: test
# tags: [mbr]
# before_script: [*test_setup]
# script:
# - go test -msan -short $BIN_PATH
# allow_failure: true
.test:build:
stage: test
tags: [mbr]
before_script: [*test_setup]
script:
- go build $BIN_PATH
histogram:test:lint:
extends: .test:lint
variables:
BIN_PATH: gitlab.switch.ch/memoriav/memobase-2020/services/histogram/cmd/histogram
histogram:test:unit:
extends: .test:unit
variables:
BIN_PATH: gitlab.switch.ch/memoriav/memobase-2020/services/histogram/cmd/histogram
histogram:test:race:
extends: .test:race
variables:
BIN_PATH: gitlab.switch.ch/memoriav/memobase-2020/services/histogram/cmd/histogram
histogram:test:build:
extends: .test:build
variables:
BIN_PATH: gitlab.switch.ch/memoriav/memobase-2020/services/histogram/cmd/histogram
webservice:test:lint:
extends: .test:lint
variables:
BIN_PATH: gitlab.switch.ch/memoriav/memobase-2020/services/histogram/cmd/webservice
webservice:test:unit:
extends: .test:unit
variables:
BIN_PATH: gitlab.switch.ch/memoriav/memobase-2020/services/histogram/cmd/webservice
webservice:test:race:
extends: .test:race
variables:
BIN_PATH: gitlab.switch.ch/memoriav/memobase-2020/services/histogram/cmd/webservice
webservice:test:build:
extends: .test:build
variables:
BIN_PATH: gitlab.switch.ch/memoriav/memobase-2020/services/histogram/cmd/webservice
.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
indexerhelper: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
indexerhelper: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
indexerhelper: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 golang:1.14 as histogram_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/histogram -a gitlab.switch.ch/memoriav/memobase-2020/services/histogram/cmd/histogram
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/gitlab.switch.ch/memoriav/memobase-2020/services/histogram/bin/app /app
COPY --from=builder /etc/passwd /etc/passwd
COPY --from=histogram_builder /go/src/gitlab.switch.ch/memoriav/memobase-2020/services/histogram/bin/app /usr/bin
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