Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
memoriav
Memobase 2020
services
ExternalAPIs
OAI
Commits
bbd86588
Commit
bbd86588
authored
Jun 17, 2020
by
Günter Hipler
Browse files
added first ci functionality
parent
73727084
Pipeline
#10224
failed with stages
in 19 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
0 → 100644
View file @
bbd86588
stages
:
-
test-build
-
publish-image
test
:
stage
:
test-build
except
:
-
master
-
tags
#image: hseeberger/scala-sbt:8u252_1.3.12_2.12.11
image
:
hseeberger/scala-sbt:8u252_1.3.12_2.13.1
script
:
-
sbt test compile
.build-image
:
stage
:
publish-image
image
:
docker:stable
services
:
-
docker:dind
script
:
#- docker login -u '$CI_REGISTRY_USER' -p '$CI_REGISTRY_PASSWORD' '$REGISTRY'
-
docker login -u '$CI_REGISTRY_USER' -p '$CI_REGISTRY_PASSWORD' registry.gitlab.com
-
docker build --pull -t "$IMAGE_TAG" .
-
docker push "$IMAGE_TAG"
-
docker logout
build-tagged-image
:
extends
:
.build-image
variables
:
IMAGE_TAG
:
"
$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG"
only
:
-
tags
build-latest-image
:
extends
:
.build-image
variables
:
IMAGE_TAG
:
"
$CI_REGISTRY_IMAGE:latest"
only
:
-
master
build-develop-image
:
extends
:
.build-image
variables
:
IMAGE_TAG
:
"
$CI_REGISTRY_IMAGE:develop"
only
:
-
develop
\ No newline at end of file
Dockerfile
View file @
bbd86588
...
...
@@ -5,8 +5,6 @@ WORKDIR /
RUN
sbt clean
RUN
sbt stage
# Build deployable Docker image
FROM
openjdk:8-jre-alpine
COPY
--from=build target/universal/stage /app/
...
...
@@ -14,19 +12,14 @@ COPY --from=build target/universal/stage /app/
RUN
apk update
RUN
apk upgrade
RUN
apk add bash
#see https://github.com/docker-library/openjdk/issues/289
RUN
apk add
--no-cache
nss
#VOLUME /updateDir
#VOLUME /deleteDir
#VOLUME /base
#RUN chown -R 497:497 /app
#USER 497:497
RUN
chown
-R
497:497 /app
USER
497:497
WORKDIR
/app
CMD
./start.process.sh
build.sbt
View file @
bbd86588
import
sbt.Keys._
import
Dependencies._
//import play.sbt.PlaySettings
name
:=
"""oaiServiceMemobase"""
organization
:=
"ch.memobase"
version
:=
"1.0-SNAPSHOT"
resolvers
++=
Seq
(
"Typesafe"
at
"https://repo.typesafe.com/typesafe/releases/"
,
//"cql java" at "http://maven.indexdata.com"
)
PlayKeys
.
devSettings
:=
Seq
(
"play.server.http.port"
->
"9000"
)
//don't compile javadoc
//sources in (Compile, doc) := Seq.empty
//publishArtifact in (Compile, packageDoc) := false
ThisBuild
/
scalaVersion
:=
"2.13.1"
ThisBuild
/
organization
:=
"ch.memobase"
ThisBuild
/
organizationName
:=
"memobase"
ThisBuild
/
git
.
gitTagToVersionNumber
:=
{
tag
:
String
=>
if
(
tag
matches
"[0-9]+\\..*"
)
Some
(
tag
)
else
None
}
lazy
val
root
=
(
project
in
file
(
"."
))
.
enablePlugins
(
PlayService
,
PlayLayoutPlugin
,
Common
)
.
enablePlugins
(
GitVersioning
,
PlayService
,
PlayLayoutPlugin
,
Common
)
.
settings
(
//name := "oai-play",
scalaVersion
:=
"2.13.1"
,
name
:=
"oaiServiceMemobase"
,
//assemblyJarName in assembly := "app.jar",
//test in assembly := {},
//mainClass in assembly := Some("Main"),
resolvers
++=
Seq
(
//"Memobase Utils" at "https://dl.bintray.com/jonas-waeber/memobase"
"Typesafe"
at
"https://repo.typesafe.com/typesafe/releases/"
,
Resolver
.
mavenLocal
),
libraryDependencies
++=
Seq
(
guice
,
"org.joda"
%
"joda-convert"
%
"2.2.1"
,
"net.logstash.logback"
%
"logstash-logback-encoder"
%
"6.2"
,
"io.lemonlabs"
%%
"scala-uri"
%
"1.5.1"
,
"net.codingwell"
%%
"scala-guice"
%
"4.2.6"
,
//"org.apache.solr" % "solr-solrj" % "7.3.1",
//"com.fasterxml.jackson.core" % "jackson-databind" % "2.10.1",
//"org.marc4j" % "marc4j" % "2.9.1",
//"org.z3950.zing" % "cql-java" % "1.12",
"org.scalatestplus.play"
%%
"scalatestplus-play"
%
"5.0.0"
%
Test
,
"org.elasticsearch.client"
%
"elasticsearch-rest-high-level-client"
%
"7.7.0"
joda
,
lemonlabs
,
codingwell
,
scalatestplusplay
%
Test
,
elasticsearch
,
logging
),
scalacOptions
++=
Seq
(
"-feature"
,
"-deprecation"
,
"-Xfatal-warnings"
)
)
PlayKeys
.
devSettings
:=
Seq
(
"play.server.http.port"
->
"9000"
)
import
com.typesafe.sbt.packager.MappingsHelper._
mappings
in
Universal
++=
directory
(
baseDirectory
.
value
/
"resources"
)
project/Dependencies.scala
0 → 100644
View file @
bbd86588
/*
* OAI Server Interface
* 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/>.
*/
import
sbt._
object
Dependencies
{
lazy
val
joda
=
"org.joda"
%
"joda-convert"
%
"2.2.1"
lazy
val
logging
=
"net.logstash.logback"
%
"logstash-logback-encoder"
%
"6.2"
lazy
val
lemonlabs
=
"io.lemonlabs"
%%
"scala-uri"
%
"1.5.1"
lazy
val
codingwell
=
"net.codingwell"
%%
"scala-guice"
%
"4.2.6"
//"org.apache.solr" % "solr-solrj" % "7.3.1",
//"com.fasterxml.jackson.core" % "jackson-databind" % "2.10.1",
//"org.marc4j" % "marc4j" % "2.9.1",
//"org.z3950.zing" % "cql-java" % "1.12",
lazy
val
scalatestplusplay
=
"org.scalatestplus.play"
%%
"scalatestplus-play"
%
"5.0.0"
lazy
val
elasticsearch
=
"org.elasticsearch.client"
%
"elasticsearch-rest-high-level-client"
%
"7.7.0"
}
project/plugins.sbt
View file @
bbd86588
...
...
@@ -10,3 +10,6 @@ addSbtPlugin("com.lightbend.paradox" % "sbt-paradox" % "0.4.4")
// Scala formatting: "sbt scalafmt"
addSbtPlugin
(
"com.lucidchart"
%
"sbt-scalafmt"
%
"1.15"
)
addSbtPlugin
(
"com.eed3si9n"
%
"sbt-assembly"
%
"0.14.10"
)
addSbtPlugin
(
"com.typesafe.sbt"
%
"sbt-git"
%
"1.0.0"
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment