Verified Commit 443a77a4 authored by Sebastian Schüpbach's avatar Sebastian Schüpbach
Browse files

provide ci-workflow


Signed-off-by: Sebastian Schüpbach's avatarSebastian Schüpbach <sebastian.schuepbach@unibas.ch>
parent b942951b
stages:
- test
- 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"
cache:
key: "$CI_BUILD_REF_NAME"
paths:
- "sbt-cache/ivy/cache"
- "sbt-cache/boot"
- "sbt-cache/sbtboot"
- "sbt-cache/target"
test:
stage: test
# TODO: Change to mbr
tags: [mbr4]
script:
- sbt test
assembly:
stage: build
# TODO: Change to mbr
tags: [mbr4]
script:
- sbt assembly
artifacts:
paths:
- target/scala-2.12/app.jar
.build-image:
stage: publish
image: docker:stable
services:
- docker:dind
script:
- 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
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
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
FROM openjdk:8-jre-alpine
ADD src/main/resources/config.properties /app/config/config.properties
ADD target/scala-2.12/app.jar /app/app.jar
CMD java -jar /app/app.jar
\ No newline at end of file
/*
* Extracts media files from Fedora repository
* Copyright (C) 2020 Memoriav
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package org.memobase
object App extends scala.App {
println("Hello world!")
}
Supports Markdown
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