-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #106 from de4a-wp5/iteration2-dev
Iteration2 dev
- Loading branch information
Showing
11 changed files
with
284 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,6 +62,7 @@ pipeline { | |
} | ||
} | ||
sh 'docker system prune -f' | ||
sh 'docker network create docker-ci_default' | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,4 +17,4 @@ goto end | |
:error | ||
pause | ||
|
||
:end | ||
:end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,25 @@ | ||
FROM tomcat:9-jdk11 | ||
# Part 1: | ||
|
||
FROM ubuntu:latest as build | ||
|
||
# Install unzip | ||
RUN apt-get update \ | ||
&& apt-get upgrade -y \ | ||
&& apt-get install -y unzip \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
COPY target/de4a-connector.war ./connector.war | ||
|
||
RUN unzip connector.war -d /smp && \ | ||
rm /smp/WEB-INF/classes/*.p12 | ||
|
||
# Part 2: | ||
|
||
FROM tomcat:9-jdk11 | ||
|
||
ENV CATALINA_OPTS="$CATALINA_OPTS -Djava.security.egd=file:/dev/urandom" | ||
|
||
WORKDIR $CATALINA_HOME/webapps | ||
RUN rm -rf manager host-manager docs examples ROOT | ||
|
||
COPY target/de4a-connector.war ./connector.war | ||
|
||
RUN rm -rf manager host-manager docs examples ROOT && \ | ||
unzip connector.war -d ROOT && \ | ||
rm -f connector.war | ||
COPY --from=build /smp $CATALINA_HOME/webapps/ROOT |
60 changes: 60 additions & 0 deletions
60
de4a-connector/src/main/java/eu/de4a/connector/EDE4ARuntimeEnvironment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package eu.de4a.connector; | ||
|
||
import javax.annotation.Nonnull; | ||
import javax.annotation.Nullable; | ||
|
||
import com.helger.commons.annotation.Nonempty; | ||
import com.helger.commons.id.IHasID; | ||
import com.helger.commons.lang.EnumHelper; | ||
import com.helger.commons.regex.RegExHelper; | ||
import com.helger.peppolid.IParticipantIdentifier; | ||
|
||
public enum EDE4ARuntimeEnvironment implements IHasID <String> | ||
{ | ||
PLAYGROUND ("playground") { | ||
@Override | ||
public boolean isAllowedParticipantID (@Nonnull final IParticipantIdentifier aPI) | ||
{ | ||
final String sValue = aPI.getValue (); | ||
return RegExHelper.stringMatchesPattern ("9999:.+-mock-it2", sValue); | ||
} | ||
}, | ||
TEST ("test") { | ||
@Override | ||
public boolean isAllowedParticipantID (@Nonnull final IParticipantIdentifier aPI) | ||
{ | ||
final String sValue = aPI.getValue (); | ||
return RegExHelper.stringMatchesPattern ("99\\d\\d:.+-test-it2", sValue); | ||
} | ||
}, | ||
PILOT ("pilot") { | ||
@Override | ||
public boolean isAllowedParticipantID (@Nonnull final IParticipantIdentifier aPI) | ||
{ | ||
// The ones that are neither playground nor test are pilot ones :) | ||
return !PLAYGROUND.isAllowedParticipantID (aPI) && !TEST.isAllowedParticipantID (aPI); | ||
} | ||
}; | ||
|
||
private final String m_sID; | ||
|
||
EDE4ARuntimeEnvironment (@Nonnull @Nonempty final String sID) | ||
{ | ||
m_sID = sID; | ||
} | ||
|
||
@Nonnull | ||
@Nonempty | ||
public String getID () | ||
{ | ||
return m_sID; | ||
} | ||
|
||
public abstract boolean isAllowedParticipantID (@Nonnull IParticipantIdentifier aPI); | ||
|
||
@Nullable | ||
public static EDE4ARuntimeEnvironment getFromIDOrNull (@Nullable final String sID) | ||
{ | ||
return EnumHelper.getFromIDOrNull (EDE4ARuntimeEnvironment.class, sID); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.