Skip to content

Commit

Permalink
feat: map EXHORT additional environment variables (#10)
Browse files Browse the repository at this point in the history
* feat: map EXHORT_DEBUG + PYTHON pip new env variables
to java properties

Signed-off-by: Zvi Grinberg <[email protected]>

* fix: add EXHORT_DEV_MODE flag to enable testing staging env

Signed-off-by: Zvi Grinberg <[email protected]>

* chore: bump exhort-java-api version to Release 0.0.5

Signed-off-by: Zvi Grinberg <[email protected]>

---------

Signed-off-by: Zvi Grinberg <[email protected]>
  • Loading branch information
zvigrinberg authored Feb 6, 2024
1 parent c358a43 commit 76f0613
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
<dependency>
<groupId>com.redhat.exhort</groupId>
<artifactId>exhort-java-api</artifactId>
<version>0.0.4</version>
<version>0.0.5</version>
</dependency>
</dependencies>

Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.redhat.exhort</groupId>
<artifactId>exhort-java-api</artifactId>
<version>0.0.4</version>
<version>0.0.5</version>
<name>Exhort Java API</name>
<description>Exhort Java API</description>
<url>https://github.com/RHEcosystemAppEng/exhort-java-api#readme</url>
Expand All @@ -28,7 +28,7 @@
<scm>
<connection>scm:git:[email protected]:RHEcosystemAppEng/exhort-java-api.git</connection>
<developerConnection>scm:git:[email protected]:RHEcosystemAppEng/exhort-java-api.git</developerConnection>
<tag>v0.0.4</tag>
<tag>v0.0.5</tag>
<url>https://github.com/RHEcosystemAppEng/exhort-java-api</url>
</scm>
<dependencies>
Expand Down
26 changes: 25 additions & 1 deletion src/main/java/redhat/jenkins/plugins/rhda/step/CRDAStep.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.stream.Collectors;

public final class CRDAStep extends Step {
private String file;
Expand Down Expand Up @@ -99,7 +100,6 @@ protected Execution(CRDAStep step, StepContext context) {
try {
EnvVars envVars = context.get(EnvVars.class);
jenkinsPath = envVars.get("PATH");

// setting system properties to pass to java-api
if(envVars.get("EXHORT_MVN_PATH") != null ){
System.setProperty("EXHORT_MVN_PATH", envVars.get("EXHORT_MVN_PATH"));
Expand Down Expand Up @@ -128,6 +128,12 @@ protected Execution(CRDAStep step, StepContext context) {
else{
System.clearProperty("EXHORT_URL");
}
if(envVars.get("EXHORT_DEV_MODE") != null ){
System.setProperty("EXHORT_DEV_MODE", envVars.get("EXHORT_DEV_MODE"));
}
else{
System.clearProperty("EXHORT_DEV_MODE");
}

if(envVars.get("EXHORT_SNYK_TOKEN") != null ){
System.setProperty("EXHORT_SNYK_TOKEN", envVars.get("EXHORT_SNYK_TOKEN"));
Expand Down Expand Up @@ -177,6 +183,24 @@ protected Execution(CRDAStep step, StepContext context) {
else{
System.clearProperty("EXHORT_OSS_INDEX_TOKEN");
}
if(envVars.get("EXHORT_PIP_SHOW") != null ){
System.setProperty("EXHORT_PIP_SHOW", envVars.get("EXHORT_PIP_SHOW"));
}
else{
System.clearProperty("EXHORT_PIP_SHOW");
}
if(envVars.get("EXHORT_PIP_FREEZE") != null ){
System.setProperty("EXHORT_PIP_FREEZE", envVars.get("EXHORT_PIP_FREEZE"));
}
else{
System.clearProperty("EXHORT_PIP_FREEZE");
}
if(envVars.get("EXHORT_DEBUG") != null ){
System.setProperty("EXHORT_DEBUG", envVars.get("EXHORT_DEBUG"));
}
else{
System.clearProperty("EXHORT_DEBUG");
}

String crdaUuid;
RHDAGlobalConfig globalConfig = RHDAGlobalConfig.get();
Expand Down

0 comments on commit 76f0613

Please sign in to comment.