Skip to content

Commit

Permalink
Merge pull request #16 from assimbly/develop
Browse files Browse the repository at this point in the history
Release 4.0.1
  • Loading branch information
skin27 authored Jun 12, 2023
2 parents 8edbc5f + 5d9950e commit 0890178
Show file tree
Hide file tree
Showing 52 changed files with 350 additions and 397 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/new-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: New Release Workflow

on:

release:
types: [ released ]

jobs:

publish_prod_packages:

name: Publish Snapshot Packages
runs-on: ubuntu-latest
steps:

- name: Checkout code
uses: actions/checkout@v3
with:
ref: 'main'

- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'

- name: Update to snapshot version
env:
VERSION: ${{ github.ref_name }}
run: |
echo "Updating to version: ${VERSION}"
mvn versions:set -DgenerateBackupPoms=false -DnewVersion=${VERSION}
mvn versions:set-property -Dproperty=assimbly.version -DnewVersion=${VERSION}
- name: Publish package
run: mvn --batch-mode deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish_snapshot_packages:

name: Publish Snapshot Packages
runs-on: ubuntu-latest
steps:

- name: Checkout code
uses: actions/checkout@v3
with:
ref: 'develop'

- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'

- name: Update to snapshot version
env:
SNAPSHOT_VERSION: ${{ github.ref_name }}-SNAPSHOT
run: |
echo "Updating to version: ${SNAPSHOT_VERSION}"
mvn versions:set -DgenerateBackupPoms=false -DnewVersion=${SNAPSHOT_VERSION}
mvn versions:set-property -Dproperty=assimbly.version -DnewVersion=${SNAPSHOT_VERSION}
- name: Publish package
run: mvn --batch-mode deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


2 changes: 1 addition & 1 deletion aggregate/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>4.0.0</version>
<version>4.0.1</version>
</parent>

<artifactId>aggregate</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion aleris/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>4.0.0</version>
<version>4.0.1</version>
</parent>

<artifactId>aleris</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion amazon/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>4.0.0</version>
<version>4.0.1</version>
</parent>

<artifactId>amazon</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion archive/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>4.0.0</version>
<version>4.0.1</version>
</parent>

<artifactId>archive</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion auth/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>4.0.0</version>
<version>4.0.1</version>
</parent>

<artifactId>auth</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion cookies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>4.0.0</version>
<version>4.0.1</version>
</parent>

<artifactId>cookies</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion csvtoxml/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>4.0.0</version>
<version>4.0.1</version>
</parent>

<artifactId>csvtoxml</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion docconverter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>4.0.0</version>
<version>4.0.1</version>
</parent>

<artifactId>docconverter</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion edi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>4.0.0</version>
<version>4.0.1</version>
</parent>


Expand Down
2 changes: 1 addition & 1 deletion edifact/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>4.0.0</version>
<version>4.0.1</version>
</parent>


Expand Down
2 changes: 1 addition & 1 deletion edifactcommon/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>4.0.0</version>
<version>4.0.1</version>
</parent>


Expand Down
2 changes: 1 addition & 1 deletion edifactdotweb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>4.0.0</version>
<version>4.0.1</version>
</parent>

<artifactId>edifactdotweb</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion edifactstandards/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>4.0.0</version>
<version>4.0.1</version>
</parent>

<artifactId>edifactstandards</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion encoder/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>4.0.0</version>
<version>4.0.1</version>
</parent>

<artifactId>encoder</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion enrich/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>4.0.0</version>
<version>4.0.1</version>
</parent>

<artifactId>enrich</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion exceltoxml/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>4.0.0</version>
<version>4.0.1</version>
</parent>

<artifactId>exceltoxml</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion flv/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>4.0.0</version>
<version>4.0.1</version>
</parent>

<artifactId>flv</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion fmuta/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>4.0.0</version>
<version>4.0.1</version>
</parent>

<artifactId>fmuta</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion formtoxml/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>4.0.0</version>
<version>4.0.1</version>
</parent>

<artifactId>formtoxml</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion globalvariables/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>4.0.0</version>
<version>4.0.1</version>
</parent>

<artifactId>globalvariables</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import org.assimbly.globalvariables.domain.EnvironmentValue;
import org.assimbly.globalvariables.domain.GlobalEnvironmentVariable;
import org.assimbly.globalvariables.mongo.MongoDao;
import org.assimbly.globalvariables.mongo.MongoDaoImpl;

import java.util.Objects;
import java.util.Optional;
Expand Down Expand Up @@ -73,15 +72,13 @@ public String encrypt(String value) {
}

private void getGlobalVariable(Exchange exchange) {
MongoDao mongoDao = new MongoDaoImpl();

String name = endpoint.getConfiguration().getName();
String tenant = (endpoint.getConfiguration().getTenant()!=null ? endpoint.getConfiguration().getTenant() : TENANT_DEFAULT);
String environment = (endpoint.getConfiguration().getEnvironment()!=null ? endpoint.getConfiguration().getEnvironment() : getEnvironment());

name = interpolateVar(name, exchange, false);

GlobalEnvironmentVariable gVariable = mongoDao.findVariableByName(name, tenant);
GlobalEnvironmentVariable gVariable = MongoDao.findVariableByName(name, tenant);

if(gVariable == null)
throw new GlobalVariableNotFoundException("The Global Variable \"" + name + "\" was not found in the database.");
Expand All @@ -99,8 +96,6 @@ private void getGlobalVariable(Exchange exchange) {
}

private void setGlobalVariable(Exchange exchange) {
MongoDao mongoDao = new MongoDaoImpl();

String expressionType = endpoint.getConfiguration().getExpressionType();
String value = endpoint.getConfiguration().getValue();
String name = endpoint.getConfiguration().getName();
Expand All @@ -113,7 +108,7 @@ private void setGlobalVariable(Exchange exchange) {

value = interpolateVar(Base64Helper.unmarshal(value, UTF_8), exchange, expressionType);

GlobalEnvironmentVariable gVariable = mongoDao.findVariableByName(name, tenant);
GlobalEnvironmentVariable gVariable = MongoDao.findVariableByName(name, tenant);

if(Objects.isNull(gVariable)) {
gVariable = new GlobalEnvironmentVariable(name);
Expand Down Expand Up @@ -144,24 +139,22 @@ private void setGlobalVariable(Exchange exchange) {
variable.setUpdatedAt(modifyDate);
variable.setUpdatedBy(modifier);

mongoDao.updateVariable(gVariable, tenant);
MongoDao.updateVariable(gVariable, tenant);
}

private void deleteGlobalVariable(Exchange exchange) {
MongoDao mongoDao = new MongoDaoImpl();

String name = endpoint.getConfiguration().getName();
String tenant = (endpoint.getConfiguration().getTenant()!=null ? endpoint.getConfiguration().getTenant() : TENANT_DEFAULT);

if(ExchangeHelper.hasVariables(name))
name = ExchangeHelper.interpolate(name, exchange);

GlobalEnvironmentVariable variable = mongoDao.findVariableByName(name, tenant);
GlobalEnvironmentVariable variable = MongoDao.findVariableByName(name, tenant);

if(variable == null)
throw new GlobalVariableNotFoundException("The Global Variable \"" + name + "\" was not found in the database.");

mongoDao.deleteVariable(variable, tenant);
MongoDao.deleteVariable(variable, tenant);
}

private String interpolateVar(String varValue, Exchange exchange, boolean bodyFlag) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package org.assimbly.globalvariables.exception;

public class EnvironmentValueNotFoundException extends RuntimeException {
public EnvironmentValueNotFoundException(String s) {
super(s);
}
}
Loading

0 comments on commit 0890178

Please sign in to comment.