From a203557dc20c7c7b88a3e69d894f12a6a38518d5 Mon Sep 17 00:00:00 2001
From: ThanKarab <tkarabatsis@hotmail.com>
Date: Thu, 23 Jan 2020 15:10:49 +0200
Subject: [PATCH] Minor changes.

---
 build.sh                                      |  6 ++-
 src/main/java/eu/hbp/mip/MIPApplication.java  |  1 -
 .../PersistenceConfiguration.java             |  1 -
 .../eu/hbp/mip/helpers/GenParameters.java     | 38 ++-----------------
 4 files changed, 8 insertions(+), 38 deletions(-)

diff --git a/build.sh b/build.sh
index 2727a21a3..4ee3ccfc1 100755
--- a/build.sh
+++ b/build.sh
@@ -26,7 +26,7 @@ else
   DOCKER="sudo docker"
 fi
 
-IMAGE="kkech/portal_backend"
+IMAGE="thanasulas/portal_backend"
 VCS_REF=$(git describe --tags --dirty)
 VERSION=$(git describe --tags --dirty)
 
@@ -34,9 +34,11 @@ docker build --build-arg BUILD_DATE=$(date -Iseconds) \
     --build-arg VCS_REF=$VCS_REF \
     --build-arg VERSION=$VERSION \
     --tag "$IMAGE:latest" \
-    --tag "$IMAGE:$VERSION" \
     .
 
+docker push thanasulas/portal_backend:latest
+
+
 BUGSNAG_KEY=""
 eval $(grep -e "^\\s*BUGSNAG_KEY" Dockerfile | tr '\\' ' ')
 
diff --git a/src/main/java/eu/hbp/mip/MIPApplication.java b/src/main/java/eu/hbp/mip/MIPApplication.java
index befb16ec9..e6ccd8e1e 100644
--- a/src/main/java/eu/hbp/mip/MIPApplication.java
+++ b/src/main/java/eu/hbp/mip/MIPApplication.java
@@ -9,7 +9,6 @@ import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Value;
 
 @SpringBootApplication
 public class MIPApplication {
diff --git a/src/main/java/eu/hbp/mip/configuration/PersistenceConfiguration.java b/src/main/java/eu/hbp/mip/configuration/PersistenceConfiguration.java
index 5c03ec4eb..6b973dc65 100644
--- a/src/main/java/eu/hbp/mip/configuration/PersistenceConfiguration.java
+++ b/src/main/java/eu/hbp/mip/configuration/PersistenceConfiguration.java
@@ -46,5 +46,4 @@ public class PersistenceConfiguration {
         flyway.setDataSource(portalDataSource());
         return flyway;
     }
-
 }
diff --git a/src/main/java/eu/hbp/mip/helpers/GenParameters.java b/src/main/java/eu/hbp/mip/helpers/GenParameters.java
index 92de05524..696a90b55 100644
--- a/src/main/java/eu/hbp/mip/helpers/GenParameters.java
+++ b/src/main/java/eu/hbp/mip/helpers/GenParameters.java
@@ -7,13 +7,6 @@ package eu.hbp.mip.helpers;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.core.io.ClassPathResource;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Properties;
 
 public class GenParameters {
 
@@ -33,7 +26,7 @@ public class GenParameters {
 
     private String galaxyReverseProxyPassword;
 
-    private GenParameters(){
+    private GenParameters() {
 
     }
 
@@ -49,31 +42,8 @@ public class GenParameters {
             genParams.setGalaxyReverseProxyUsername(System.getenv("GALAXY_REVERSE_PROXY_USERNAME"));
             genParams.setGalaxyReverseProxyPassword(System.getenv("GALAXY_REVERSE_PROXY_PASSWORD"));
 
-
-            //If environment variable not exists read from file.
-            if (genParams.getJwtSecret() == null){
-                throw new RuntimeException("Cannot find Enviroment Variables");
-//                logger.info("->>>>>>>Reading from file");
-//
-//                File file = null;
-//                try {
-//                    file = new ClassPathResource("config.properties").getFile();
-//                    InputStream input = new FileInputStream(file);
-//                    Properties prop = new Properties();
-//
-//                    // load a properties file
-//                    prop.load(input);
-//
-//                    // get the property value and print it out
-//                    genParams.setJwtSecret(prop.getProperty("jwtSecret"));
-//                    genParams.setJwtIssuer(prop.getProperty("jwtIssuer"));
-//                    genParams.setGalaxyURL(prop.getProperty("galaxyURL"));
-//                    genParams.setGalaxyApiKey(prop.getProperty("galaxyApiKey"));
-//                    genParams.setGalaxyReverseProxyUsername(prop.getProperty("galaxyReverseProxyUsername"));
-//                    genParams.setGalaxyReverseProxyPassword(prop.getProperty("galaxyReverseProxyPassword"));
-//                } catch (IOException e) {
-//                    logger.error("Cannot initialize GenParameters from config file", e);
-//                }
+            if (genParams.getJwtSecret() == null) {
+                throw new RuntimeException("Cannot find Environment Variables");
             }
         }
         return genParams;
@@ -88,7 +58,7 @@ public class GenParameters {
     }
 
     public String getJwtIssuer() {
-        return  jwtIssuer;
+        return jwtIssuer;
     }
 
     private void setJwtIssuer(String jwtIssuer) {
-- 
GitLab