Commit 00d480cb authored by Simon Reis's avatar Simon Reis
Browse files

Merge branch 'master' of...

Merge branch 'master' of gitlab.eclipse.org:eclipse/openk-coremodules/org.eclipse.openk-coremodules.authandauth
parents 7920d790 0bf33783
Loading
Loading
Loading
Loading

.gitlab-ci.yml

0 → 100644
+74 −0
Original line number Diff line number Diff line
variables:
    FF_USE_FASTZIP: "true" # enable fastzip - a faster zip implementation that also supports level configuration.
    ARTIFACT_COMPRESSION_LEVEL: default 
    CACHE_COMPRESSION_LEVEL: default 
    TRANSFER_METER_FREQUENCY: 5s # will display transfer progress every 5 seconds for artifacts and remote caches.   
    MAVEN_OPTS: "-Djava.awt.headless=true -Dmaven.repo.local=${CI_PROJECT_DIR}/.m2/repository/"
    MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version"
    SONAR_USER_HOME: ${CI_PROJECT_DIR}/.sonar  # Defines the location of the analysis task cache
    GIT_DEPTH: 0  # Tells git to fetch all the branches of the project, required by the analysis task

cache:
  key: ${CI_COMMIT_REF_SLUG}
  paths:
    - ${CI_PROJECT_DIR}/.m2/repository/

stages:
  - build
  - test
  - sonarqube
  - test-build
  - dockerimage-ext-job

stage-build:
  image: maven:3.6-jdk-8
  stage: build
  cache:
    paths:
      - ${CI_PROJECT_DIR}/.m2/repository/
  script:
    - mvn clean package -DskipTests=true
  artifacts:
    paths:
      - ./deploy/conf/*
      - ./Dockerfile
      - target/*.war

stage-test:
  stage: test
  cache:
    paths:
      - ${CI_PROJECT_DIR}/.m2/repository/
  image: maven:3.6-jdk-8
  script:
    - mvn test -Dskip.asciidoc=true
  artifacts:
     paths:
       - target/     
       - src/     
     reports:
      junit:
       - target/surefire-reports/TEST-*.xml


sonarqube-check:
  stage: sonarqube
  image:
    name: sonarsource/sonar-scanner-cli:4.6
    entrypoint: [""]
  cache:
    key: ${CI_JOB_NAME}
    paths:
      - ${CI_PROJECT_DIR}/.sonar/cache
  script:
    - sonar-scanner -Dsonar.qualitygate.wait=true
  allow_failure: true
  dependencies:
    - stage-test

staging-external:
  stage: dockerimage-ext-job
  trigger: openkonsequenz/coremodules/portal/portal-build-job
  variables:
    ARTIFACTS_DOWNLOAD_REF: $CI_COMMIT_BRANCH
    CI_COMMIT_SHORT_SHA_CHILD: $CI_COMMIT_SHORT_SHA
+4 −0
Original line number Diff line number Diff line
@@ -3,6 +3,10 @@ FROM tomcat:9.0-jdk8-adoptopenjdk-openj9
LABEL authors="dimitrios.chalepakis@pta.de, simon.reis@pta.de" 

COPY deploy/conf/contextExternalConfig.xml /usr/local/tomcat/conf/context.xml
COPY deploy/conf/web.xml /usr/local/tomcat/conf/web.xml

RUN mkdir /usr/local/tomcat/webapps/ROOT
COPY deploy/conf/index.jsp /usr/local/tomcat/webapps/ROOT/index.jsp

COPY portal.war /usr/local/tomcat/webapps/portal.war

deploy/conf/index.jsp

0 → 100644
+1 −0
Original line number Diff line number Diff line
<% response.sendRedirect("/portalFE/"); %>
 No newline at end of file

deploy/conf/web.xml

0 → 100644
+4742 −0

File added.

Preview size limit exceeded, changes collapsed.

+10 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@
package org.eclipse.openk.portal.common;

import org.eclipse.openk.portal.common.util.ResourceLoaderBase;
import org.apache.log4j.Logger;

public class BackendConfig {
    private static String configFileName = "backendConfigDevLocal.json";
@@ -26,11 +27,18 @@ public class BackendConfig {

    private static BackendConfig instance;

    private static final Logger LOGGER = Logger.getLogger(BackendConfig.class.getName());

    private BackendConfig() {}

    public static synchronized BackendConfig getInstance() {
        if (instance == null) {
            String jsonConfig = loadJsonConfig();
            if (jsonConfig == null || jsonConfig.isEmpty()) {
                LOGGER.error("FileNotFound: jsonConfig is empty or NULL");
            } else {
                LOGGER.info("backendConfigFile " + configFileName + " successfully loaded.");
            }
            instance = JsonGeneratorBase.getGson().fromJson(jsonConfig, BackendConfig.class);
        }

@@ -39,8 +47,10 @@ public class BackendConfig {

    private static String loadJsonConfig() {
        ResourceLoaderBase resourceLoaderBase = new ResourceLoaderBase();
        LOGGER.info("backendConfigFile is: " + configFileName);
        String jsonConfig = resourceLoaderBase.loadStringFromResource(configFileName);
        if (jsonConfig == null || jsonConfig.isEmpty()) {
            LOGGER.info("backendConfigFile not found in resources, loading from external path now...");
            jsonConfig = resourceLoaderBase.loadFromPath(configFileName);
        }
        return jsonConfig;
Loading