Save one of the last spots in our Shell + Git + GitLab introdoctury course on Friday and Monday next week. 👉 Register here.

Commit d479c3f3 authored by Thomas Beermann's avatar Thomas Beermann
Browse files

unite the two separate frontend repos into one

parent 58745285
Pipeline #87021 passed with stages
in 15 minutes and 53 seconds
......@@ -7,9 +7,14 @@
## Ignore maven-generated directories and their contents.
target
node
node_modules
src/main/frontend/target
src/main/frontend/node
src/main/frontend/node_modules
coverage
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/java/**
!**/src/main/resources/**
!**/src/test/**
## Ignore Eclipse-generated files and directories
## The globbed version does not work on Mac OS X.9.
......@@ -19,3 +24,24 @@ coverage
.project
.classpath
.settings/
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
### VS Code ###
.vscode/
/.mvn/wrapper/maven-wrapper.jar
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
\ No newline at end of file
......@@ -2,19 +2,19 @@ stages:
- build
- test
- code_quality_analysis
- deploy
- trigger_marketplace_server
- package
- docker
variables:
MAVEN_CLI_OPTS: "-s .m2/ci_settings.xml --batch-mode"
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository"
WEBAPP_PROJECT_VERSION: "0.0.2-SNAPSHOT"
WEBAPP_PROJECT_BRANCH: ""
DOCKER_REGISTRY: registry.hzdr.de
DOCKER_IMAGE_BASE: registry.hzdr.de/hifis-technical-platform/helmholtz-marketplace-webapp
cache:
key: "$CI_COMMIT_REF_NAME"
paths:
- ".m2/repository"
- .m2/repository
- target/
include:
- local: .gitlab/ci/ci.yml
image: atlassianlabs/docker-node-jdk-chrome-firefox
image: registry.hzdr.de/hifis-technical-platform/helmholtz-marketplace-webapp/build:latest
build:
only:
......@@ -28,33 +28,44 @@ code_anaylsis:
script: "mvn -P sonar clean verify sonar:sonar"
allow_failure: true
deploy:
package:
only:
- master
- merge_requests
- tags
stage: deploy
stage: package
script:
- |
if [[ -n $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME ]]; then
WEBAPP_PROJECT_BRANCH=".$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME"
echo "WEBAPP_PROJECT_BRANCH=$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME" >> build.env
elif [[ -n "$CI_COMMIT_TAG" ]]; then
WEBAPP_PROJECT_VERSION=$CI_COMMIT_TAG
fi
echo "WEBAPP_PROJECT_VERSION=$WEBAPP_PROJECT_VERSION" >> build.env
- mvn $MAVEN_CLI_OPTS deploy
- mvn -DskipTests clean install
artifacts:
reports:
dotenv: build.env
paths:
- "target/*.tar"
expire_in: 3600 seconds
tags:
- "docker"
trigger:
docker_build_push:
only:
- master
- merge_requests
- tags
variables:
WEBAPP_VERSION: $WEBAPP_PROJECT_VERSION
WEBAPP_BRANCH: $WEBAPP_PROJECT_BRANCH
stage: trigger_marketplace_server
trigger: hifis-technical-platform/helmholtz-marketplace-server
- merge_requests
stage: docker
image: docker:19.03.11
services:
- name: docker:19.03.11-dind
alias: docker
before_script:
- docker info
script:
- docker login -u $GITLAB_DOCKER_USERNAME -p $GITLAB_DOCKER_PASSWORD $DOCKER_REGISTRY
- |-
if [[ "$CI_COMMIT_BRANCH" == "master" ]]; then
docker build -t $DOCKER_IMAGE_BASE:latest .
docker push $DOCKER_IMAGE_BASE:latest
else
docker build -t $DOCKER_IMAGE_BASE:$CI_COMMIT_REF_NAME .
docker push $DOCKER_IMAGE_BASE:$CI_COMMIT_REF_NAME
fi
dependencies:
- package
tags:
- "docker"
FROM buildpack-deps:focal-scm
ENV LANG en_US.UTF-8
RUN set -x \
&& apt-get update \
&& apt-get install --no-install-recommends -y \
locales \
&& locale-gen $LANG \
&& rm -rf /var/lib/apt/lists/*
# Install dependencies to run browsers, cypress, and selenium.
RUN set -x \
&& apt-get update \
&& apt-get install --no-install-recommends -y \
bzip2 \
libgtk2.0-0 \
libgtk-3-0 \
libgbm-dev \
libnotify-dev \
libgconf-2-4 \
libnss3 \
libxss1 \
libasound2 \
libxtst6 \
libxss1 \
xauth \
xvfb \
zip \
&& rm -rf /var/lib/apt/lists/*
# Install Java 11
ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64/
RUN set -x \
&& apt-get update \
&& apt-get install --no-install-recommends -y \
ca-certificates-java \
openjdk-11-jre-headless \
openjdk-11-jre \
openjdk-11-jdk-headless \
openjdk-11-jdk \
&& export JAVA_HOME \
&& rm -rf /var/lib/apt/lists/*
# Install maven
ENV MAVEN_VERSION 3.8.1
ENV MAVEN_HOME /usr/share/maven
RUN mkdir -p $MAVEN_HOME \
&& curl -fsSL http://apache.osuosl.org/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz \
| tar -xzC $MAVEN_HOME --strip-components=1 \
&& ln -s $MAVEN_HOME/bin/mvn /usr/bin/mvn
VOLUME /root/.m2
# Install node 14
RUN set -x \
&& curl -sL https://deb.nodesource.com/setup_14.x | bash - \
&& apt-get update \
&& apt-get install --no-install-recommends -y \
nodejs \
&& npm install -g npm@latest \
# Make 'node' available
&& touch ~/.bashrc \
&& echo 'alias nodejs=node' > ~/.bashrc \
&& rm -rf /var/lib/apt/lists/*
# Install yarn 1.7+
RUN set -x \
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo 'deb https://dl.yarnpkg.com/debian/ stable main' > /etc/apt/sources.list.d/yarn.list \
&& apt-get update \
&& apt-get install --no-install-recommends -y \
yarn \
&& rm -rf /var/lib/apt/lists/* /etc/apt/sources.list.d/yarn.list
# Install Chrome
ENV CHROME_BIN /usr/bin/google-chrome
RUN set -x \
&& curl -sS https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& echo 'deb http://dl.google.com/linux/chrome/deb/ stable main' > /etc/apt/sources.list.d/chrome.list \
&& apt-get update \
&& apt-get install --no-install-recommends -y \
google-chrome-stable \
&& rm -rf /var/lib/apt/lists/* /etc/apt/sources.list.d/chrome.list
# Install firefox
ENV FIREFOX_BIN /usr/bin/firefox
RUN set -x \
&& apt-get update \
&& apt-get install --no-install-recommends -y \
pkg-mozilla-archive-keyring \
firefox \
&& rm -rf /var/lib/apt/lists/*
<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
<servers>
<server>
<id>gitlab-maven</id>
<configuration>
<httpHeaders>
<property>
<name>Job-Token</name>
<value>${env.CI_JOB_TOKEN}</value>
</property>
</httpHeaders>
</configuration>
</server>
</servers>
</settings>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>hifis.snapshot.repository</id>
<username>${env.NEXUS_REPO_USER}</username>
<password>${env.NEXUS_REPO_PASS}</password>
</server>
</servers>
</settings>
\ No newline at end of file
/*
* Copyright 2007-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.net.*;
import java.io.*;
import java.nio.channels.*;
import java.util.Properties;
public class MavenWrapperDownloader {
private static final String WRAPPER_VERSION = "0.5.6";
/**
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
*/
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
/**
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
* use instead of the default one.
*/
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
".mvn/wrapper/maven-wrapper.properties";
/**
* Path where the maven-wrapper.jar will be saved to.
*/
private static final String MAVEN_WRAPPER_JAR_PATH =
".mvn/wrapper/maven-wrapper.jar";
/**
* Name of the property which should be used to override the default download url for the wrapper.
*/
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
public static void main(String args[]) {
System.out.println("- Downloader started");
File baseDirectory = new File(args[0]);
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
// If the maven-wrapper.properties exists, read it and check if it contains a custom
// wrapperUrl parameter.
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
String url = DEFAULT_DOWNLOAD_URL;
if(mavenWrapperPropertyFile.exists()) {
FileInputStream mavenWrapperPropertyFileInputStream = null;
try {
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
Properties mavenWrapperProperties = new Properties();
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
} catch (IOException e) {
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
} finally {
try {
if(mavenWrapperPropertyFileInputStream != null) {
mavenWrapperPropertyFileInputStream.close();
}
} catch (IOException e) {
// Ignore ...
}
}
}
System.out.println("- Downloading from: " + url);
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
if(!outputFile.getParentFile().exists()) {
if(!outputFile.getParentFile().mkdirs()) {
System.out.println(
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
}
}
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
try {
downloadFileFromURL(url, outputFile);
System.out.println("Done");
System.exit(0);
} catch (Throwable e) {
System.out.println("- Error downloading");
e.printStackTrace();
System.exit(1);
}
}
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
String username = System.getenv("MVNW_USERNAME");
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
}
URL website = new URL(urlString);
ReadableByteChannel rbc;
rbc = Channels.newChannel(website.openStream());
FileOutputStream fos = new FileOutputStream(destination);
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
fos.close();
rbc.close();
}
}
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
FROM adoptopenjdk:11-jre-hotspot
ENV CLIENT_SECRET nopass
COPY target/hm-server-package.tar hms.tar
EXPOSE 8080
CMD tar -xvf hms.tar -C ./ && cd ./hm-server/bin && ./start.sh -s $CLIENT_SECRET -a dev
<?xml version="1.0" encoding="UTF-8"?>
<suppressions xmlns="https://jeremylong.github.io/DependencyCheck/dependency-suppression.1.3.xsd">
<suppress>
<notes><![CDATA[
file name: spring-security-core-5.3.2.RELEASE.jar
]]></notes>
<sha1>83fed9c3ee4a014b6a6cacfc7042eb325dca6766</sha1>
<cpe>cpe:/a:pivotal_software:spring_security</cpe>
</suppress>
<suppress>
<notes><![CDATA[
file name: spring-security-oauth2-core-5.3.2.RELEASE.jar
]]></notes>
<sha1>42e8581002bdeef63f9352a9b45bcdb98e3bc09f</sha1>
<cpe>cpe:/a:pivotal:spring_security_oauth</cpe>
<cpe>cpe:/a:pivotal_software:spring_security</cpe>
<cpe>cpe:/a:pivotal_software:spring_security_oauth</cpe>
</suppress>
<suppress>
<notes><![CDATA[
file name: tomcat-embed-core-9.0.35.jar
]]></notes>
<sha1>8a99064fce4b152a7dc9bea1798ba828a2cecf0f</sha1>
<cpe>cpe:/a:apache:tomcat</cpe>
<cpe>cpe:/a:apache_software_foundation:tomcat</cpe>
<cpe>cpe:/a:apache_tomcat:apache_tomcat</cpe>
</suppress>
<suppress>
<notes><![CDATA[
file name: spring-security-oauth2-jose-5.3.2.RELEASE.jar
]]></notes>
<sha1>e510e9b163651fff85670045e8be2c549c51b3b7</sha1>
<cpe>cpe:/a:pivotal:spring_security_oauth</cpe>
<cpe>cpe:/a:pivotal_software:spring_security</cpe>
<cpe>cpe:/a:pivotal_software:spring_security_oauth</cpe>
</suppress>
<suppress>
<notes><![CDATA[
file name: spring-security-web-5.3.2.RELEASE.jar
]]></notes>
<sha1>c2459ad6f4c56754d4938a71ffd2426dea46d4e1</sha1>
<cpe>cpe:/a:pivotal_software:spring_security</cpe>
</suppress>
<suppress>
<notes><![CDATA[
file name: tomcat-embed-websocket-9.0.35.jar
]]></notes>
<sha1>62ab2d7d7d029ea728ea8f8d3151ba93882b52ca</sha1>
<cpe>cpe:/a:apache:tomcat</cpe>
<cpe>cpe:/a:apache_software_foundation:tomcat</cpe>
<cpe>cpe:/a:apache_tomcat:apache_tomcat</cpe>
</suppress>
<suppress>
<notes><![CDATA[
file name: spring-security-config-5.3.2.RELEASE.jar
]]></notes>
<sha1>88b84564a3db5c39e2a8c171520022d2d1a67607</sha1>
<cpe>cpe:/a:pivotal_software:spring_security</cpe>
</suppress>
<suppress>
<notes><![CDATA[
file name: spring-security-oauth2-client-5.3.2.RELEASE.jar
]]></notes>
<sha1>a215800d7d52bee5fca23df7077d0e606eee5105</sha1>
<cpe>cpe:/a:pivotal:spring_security_oauth</cpe>
<cpe>cpe:/a:pivotal_software:spring_security</cpe>
<cpe>cpe:/a:pivotal_software:spring_security_oauth</cpe>
</suppress>
<suppress>
<notes><![CDATA[
file name: jakarta.websocket-api-1.1.2.jar
]]></notes>
<packageUrl regex="true">^pkg:maven/jakarta\.websocket/jakarta\.websocket\-api@.*$</packageUrl>
<cve>CVE-2020-11050</cve>
</suppress>
<suppress>
<notes><![CDATA[
file name: javax-websocket-server-impl-9.4.28.v20200408.jar
]]></notes>
<packageUrl regex="true">^pkg:maven/org\.eclipse\.jetty\.websocket/javax\-websocket\-server\-impl@.*$</packageUrl>
<cve>CVE-2019-17638</cve>
</suppress>
<suppress>
<notes><![CDATA[
file name: jetty-server-9.4.28.v20200408.jar
]]></notes>
<packageUrl regex="true">^pkg:maven/org\.eclipse\.jetty/jetty\-server@.*$</packageUrl>
<cve>CVE-2019-17638</cve>
</suppress>
<suppress>
<notes><![CDATA[
file name: spring-core-5.2.6.RELEASE.jar
]]></notes>
<packageUrl regex="true">^pkg:maven/org\.springframework/spring\-core@.*$</packageUrl>
<cve>CVE-2020-5421</cve>
</suppress>
<suppress>
<notes><![CDATA[
file name: websocket-server-9.4.28.v20200408.jar
]]></notes>
<packageUrl regex="true">^pkg:maven/org\.eclipse\.jetty\.websocket/websocket\-server@.*$</packageUrl>
<cve>CVE-2019-17638</cve>
</suppress>
<suppress>
<notes><![CDATA[
file name: javax-websocket-client-impl-9.4.28.v20200408.jar
]]></notes>
<packageUrl regex="true">^pkg:maven/org\.eclipse\.jetty\.websocket/javax\-websocket\-client\-impl@.*$</packageUrl>
<cve>CVE-2019-17638</cve>
</suppress>
<suppress>
<notes><![CDATA[
file name: jetty-xml-9.4.28.v20200408.jar
]]></notes>
<packageUrl regex="true">^pkg:maven/org\.eclipse\.jetty/jetty\-xml@.*$</packageUrl>
<cve>CVE-2019-17638</cve>
</suppress>
<suppress>
<notes><![CDATA[
file name: spring-aop-5.2.6.RELEASE.jar
]]></notes>
<packageUrl regex="true">^pkg:maven/org\.springframework/spring\-aop@.*$</packageUrl>
<cve>CVE-2020-5421</cve>
</suppress>
<suppress>
<notes><![CDATA[
file name: websocket-common-9.4.28.v20200408.jar
]]></notes>
<packageUrl regex="true">^pkg:maven/org\.eclipse\.jetty\.websocket/websocket\-common@.*$</packageUrl>
<cve>CVE-2019-17638</cve>
</suppress>
<suppress>
<notes><![CDATA[
file name: jetty-http-9.4.28.v20200408.jar
]]></notes>
<packageUrl regex="true">^pkg:maven/org\.eclipse\.jetty/jetty\-http@.*$</packageUrl>
<cve>CVE-2019-17638</cve>
</suppress>
<suppress>
<notes><![CDATA[
file name: spring-web-5.2.6.RELEASE.jar
]]></notes>
<packageUrl regex="true">^pkg:maven/org\.springframework/spring\-web@.*$</packageUrl>
<cve>CVE-2020-5421</cve>
</suppress>
<suppress>
<notes><![CDATA[
file name: websocket-client-9.4.28.v20200408.jar
]]></notes>
<packageUrl regex="true">^pkg:maven/org\.eclipse\.jetty\.websocket/websocket\-client@.*$</packageUrl>
<cve>CVE-2019-17638</cve>
</suppress>
<suppress>
<notes><![CDATA[
file name: jetty-util-9.4.28.v20200408.jar
]]></notes>
<packageUrl regex="true">^pkg:maven/org\.eclipse\.jetty/jetty\-util@.*$</packageUrl>
<cve>CVE-2019-17638</cve>
</suppress>
<suppress>
<notes><![CDATA[
file name: spring-jcl-5.2.6.RELEASE.jar
]]></notes>
<packageUrl regex="true">^pkg:maven/org\.springframework/spring\-jcl@.*$</packageUrl>
<cve>CVE-2020-5421</cve>
</suppress>
<suppress>
<notes><![CDATA[
file name: websocket-servlet-9.4.28.v20200408.jar
]]></notes>
<packageUrl regex="true">^pkg:maven/org\.eclipse\.jetty\.websocket/websocket\-servlet@.*$</packageUrl>
<cve>CVE-2019-17638</cve>
</suppress>
<suppress>
<notes><![CDATA[
file name: jetty-plus-9.4.28.v20200408.jar
]]></notes>
<packageUrl regex="true">^pkg:maven/org\.eclipse\.jetty/jetty\-plus@.*$</packageUrl>
<cve>CVE-2019-17638</cve>
</suppress>
<suppress>
<notes><![CDATA[
file name: spring-beans-5.2.6.RELEASE.jar
]]></notes>
<packageUrl regex="true">^pkg:maven/org\.springframework/spring\-beans@.*$</packageUrl>
<cve>CVE-2020-5421</cve>
</suppress>
<suppress>
<notes><![CDATA[
file name: jetty-jndi-9.4.28.v20200408.jar
]]></notes>
<packageUrl regex="true">^pkg:maven/org\.eclipse\.jetty/jetty\-jndi@.*$</packageUrl>
<cve>CVE-2019-17638</cve>
</suppress>
<suppress>
<notes><![CDATA[
file name: spring-webmvc-5.2.6.RELEASE.jar
]]></notes>
<packageUrl regex="true">^pkg:maven/org\.springframework/spring\-webmvc@.*$</packageUrl>
<cve>CVE-2020-5421</cve>
</suppress>
<suppress>
<notes><![CDATA[
file name: jetty-webapp-9.4.28.v20200408.jar
]]></notes>
<packageUrl regex="true">^pkg:maven/org\.eclipse\.jetty/jetty\-webapp@.*$</packageUrl>
<cve>CVE-2019-17638</cve>
</suppress>
<suppress>
<notes><![CDATA[
file name: spring-context-5.2.6.RELEASE.jar
]]></notes>
<packageUrl regex="true">^pkg:maven/org\.springframework/spring\-context@.*$</packageUrl>
<cve>CVE-2020-5421</cve>
</suppress>
<suppress>
<notes><![CDATA[
file name: jetty-client-9.4.28.v20200408.jar