Skip to content

Commit 0e8d307

Browse files
authored
Merge pull request #58 from querqy/refactoring_2020
Refactoring 2020
2 parents c6cfcdb + 2f5d9ae commit 0e8d307

File tree

202 files changed

+8296
-4655
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

202 files changed

+8296
-4655
lines changed

.dockerignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
docs
2+
frontend/node_modules
3+
public
4+
target
5+
test
6+
testData.sql
7+
*.md
8+
.git

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ target
55
tmp
66
.history
77
dist
8-
/.idea
8+
.idea
99
/*.iml
1010
/out
1111
/.idea_modules
@@ -24,3 +24,6 @@ smui2solr-dev.sh
2424
var/test.db
2525
node_modules/
2626
package-lock.json
27+
/public
28+
e2e/cypress/videos
29+
e2e/cypress/screenshots

Dockerfile

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# syntax = docker/dockerfile:1.0-experimental
2+
FROM openjdk:11-buster as builder
3+
4+
ARG NODE_VERSION=10
5+
6+
RUN echo "deb https://dl.bintray.com/sbt/debian /" > /etc/apt/sources.list.d/sbt.list \
7+
&& curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | apt-key add \
8+
&& apt-get update \
9+
&& apt-get install -y sbt
10+
11+
RUN apt-get install -y lsb-release \
12+
&& export DISTRO="$(lsb_release -s -c)" \
13+
&& echo "deb https://deb.nodesource.com/node_$NODE_VERSION.x $DISTRO main" > /etc/apt/sources.list.d/nodesource.list \
14+
&& echo "deb-src https://deb.nodesource.com/node_$NODE_VERSION.x $DISTRO main" >> /etc/apt/sources.list.d/nodesource.list \
15+
&& curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \
16+
&& apt-get update \
17+
&& apt-get install -y nodejs
18+
19+
COPY . /smui
20+
WORKDIR /smui
21+
22+
RUN --mount=target=/root/.ivy2,type=cache sbt "set test in assembly := {}" clean assembly
23+
24+
FROM openjdk:11-jre-slim-buster
25+
26+
RUN apt-get update \
27+
&& apt-get install -y --no-install-recommends openssh-client sshpass bash curl git \
28+
&& rm -rf /var/lib/apt/lists/*
29+
30+
ARG VERSION
31+
ENV SMUI_VERSION=$VERSION
32+
33+
# PID file should be /dev/null in docker containers, as SMUI is the only process in the container, anyway
34+
# and present PID files from previous runs prevent startup
35+
ENV SMUI_CONF_PID_PATH=/dev/null
36+
ENV SMUI_CONF_HTTP_PORT=9000
37+
ENV SMUI_CONF_LOGBACK_XML_PATH=/smui/logback.xml
38+
39+
EXPOSE $SMUI_CONF_HTTP_PORT
40+
41+
# create non-root smui user & group (security)
42+
RUN addgroup --gid 1024 smui \
43+
&& adduser --uid 1024 --ingroup smui smui --disabled-password --quiet
44+
45+
WORKDIR /smui
46+
47+
RUN mkdir /tmp/smui-git-repo /home/smui/.ssh \
48+
&& chown -R smui:smui /smui /tmp/smui-git-repo /home/smui/.ssh
49+
50+
USER smui
51+
52+
COPY --chown=smui:smui conf/logback.xml .
53+
COPY --chown=smui:smui conf/smui2solr.sh conf/smui2git.sh conf/
54+
COPY --from=builder --chown=smui:smui /smui/target/scala-*/search-management-ui-assembly-$VERSION.jar .
55+
56+
CMD java \
57+
-Dpidfile.path=$SMUI_CONF_PID_PATH \
58+
-Dlogback.configurationFile=$SMUI_CONF_LOGBACK_XML_PATH \
59+
-Dhttp.port=$SMUI_CONF_HTTP_PORT \
60+
-jar /smui/search-management-ui-assembly-$SMUI_VERSION.jar

Makefile

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,16 @@
1+
all:
12

2-
IMAGE = querqy/smui
3-
VERSION = $(shell grep -E '^version' build.sbt | cut -d'"' -f2)
4-
SCALA_VERSION = $(shell grep -E '^scalaVersion' build.sbt | cut -d'"' -f2 | cut -d. -f1-2)
5-
6-
all: docker-build-only
3+
serve:
4+
@sbt run
75

86
docker-build-only:
9-
env DOCKER_BUILDKIT=1 docker build --build-arg VERSION=$(VERSION) \
10-
--build-arg SCALA_VERSION=$(SCALA_VERSION) -t $(IMAGE):$(VERSION) -f build/Dockerfile .
11-
12-
docker-run:
13-
mkdir -p var
14-
docker run -v`pwd`/var:/var/smui -p9000:9000 --rm -it --name smui \
15-
-eSMUI_DB_URL=jdbc:sqlite:/var/smui/test.db -eSMUI_DB_JDBC_DRIVER=org.sqlite.JDBC \
16-
$(IMAGE):$(VERSION)
7+
DOCKER_BUILDKIT=1 sbt docker
178

18-
docker-push: docker-push-version docker-push-latest
9+
docker-push:
10+
DOCKER_BUILDKIT=1 sbt dockerPush
1911

20-
docker-push-version:
21-
docker push $(IMAGE):$(VERSION)
12+
docker-build-and-push:
13+
DOCKER_BUILDKIT=1 sbt dockerBuildAndPush
2214

23-
docker-push-latest:
24-
docker tag $(IMAGE):$(VERSION) $(IMAGE):latest
25-
docker push $(IMAGE):latest
15+
docker-run:
16+
@docker-compose up

app/assets/app/app.module.ts

Lines changed: 0 additions & 107 deletions
This file was deleted.

app/assets/app/components/app.component.html

Lines changed: 0 additions & 31 deletions
This file was deleted.

app/assets/app/components/app.component.ts

Lines changed: 0 additions & 45 deletions
This file was deleted.

app/assets/app/components/details/activity-log/activity-log.component.css

Lines changed: 0 additions & 38 deletions
This file was deleted.

app/assets/app/components/details/activity-log/activity-log.component.html

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)