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

use CI templates

parent 412382ef
......@@ -3,12 +3,17 @@ stages:
- build
- publish
default:
image: hseeberger/scala-sbt:8u252_1.3.10_2.12.11
variables:
SBT_OPTS: "-Dsbt.global.base=sbt-cache/sbtboot -Dsbt.boot.directory=sbt-cache/boot -Dsbt.ivy.home=sbt-cache/ivy"
DOCKER_TLS_CERTDIR: ""
include:
- project: 'memoriav/memobase-2020/utilities/ci-templates'
branch: modular
file: 'sbt/base.yml'
- project: 'memoriav/memobase-2020/utilities/ci-templates'
branch: modular
file: 'docker/base.yml'
.install_kakadu: &install_kakadu
- wget https://kakadusoftware.com/wp-content/uploads/2020/06/KDU805_Demo_Apps_for_Linux-x86-64_200602.zip
- unzip KDU805_Demo_Apps_for_Linux-x86-64_200602.zip && cd KDU805_Demo_Apps_for_Linux-x86-64_200602/ && mv kdu_compress libkdu_v80R.so ../ && cd ..
cache:
key: "$CI_BUILD_REF_NAME"
......@@ -18,73 +23,29 @@ cache:
- "sbt-cache/sbtboot"
- "sbt-cache/target"
test:
stage: test
tags: [mbr]
test-sbt:
extends: .test-sbt
before_script:
- apt-get update && apt-get install -y ffmpeg imagemagick
- wget https://kakadusoftware.com/wp-content/uploads/2020/06/KDU805_Demo_Apps_for_Linux-x86-64_200602.zip
- unzip KDU805_Demo_Apps_for_Linux-x86-64_200602.zip && cd KDU805_Demo_Apps_for_Linux-x86-64_200602/ && mv kdu_compress libkdu_v80R.so ../ && cd ..
- export PATH=$PATH:`pwd`
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`
script:
- sbt test
assembly:
stage: build
tags: [mbr]
script:
- sbt assembly
artifacts:
paths:
- target/scala-2.12/app.jar
expire_in: 60 min
assembly-sbt:
extends: .assembly-sbt
.build-image:
stage: publish
image: docker:stable
services:
- docker:dind
script:
- wget https://kakadusoftware.com/wp-content/uploads/2020/06/KDU805_Demo_Apps_for_Linux-x86-64_200602.zip
- unzip KDU805_Demo_Apps_for_Linux-x86-64_200602.zip && cd KDU805_Demo_Apps_for_Linux-x86-64_200602/ && mv kdu_compress libkdu_v80R.so ../ && cd ..
- docker login -u "$REGISTRY_USER" -p "$REGISTRY_PASSWORD" "$REGISTRY"
- docker build --pull -t "$IMAGE_TAG" .
- docker push "$IMAGE_TAG"
- docker logout
cache:
paths: []
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"
only:
- tags
build-tagged-image:
extends: .build-tagged-image
before_script:
- *install_kakadu
master-branch-image:
extends: .build-image
variables:
IMAGE_TAG: "$CI_REGISTRY_IMAGE:latest"
REGISTRY_PASSWORD: "$CI_REGISTRY_PASSWORD"
REGISTRY_USER: "$CI_REGISTRY_USER"
REGISTRY: "$CI_REGISTRY"
only:
- master
build-latest-image:
extends: .build-latest-image
before_script:
- *install_kakadu
feature-branch-image:
extends: .build-image
variables:
IMAGE_TAG: "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
REGISTRY_PASSWORD: "$CI_REGISTRY_PASSWORD"
REGISTRY_USER: "$CI_REGISTRY_USER"
REGISTRY: "$CI_REGISTRY"
except:
- master
- tags
build-feature-branch-image:
extends: .build-feature-branch-image
before_script:
- *install_kakadu
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