Skip to content

Commit

Permalink
Merge pull request #55 from virtual-imaging-platform/develop
Browse files Browse the repository at this point in the history
Release 3.10
  • Loading branch information
axlbonnet authored Mar 11, 2024
2 parents 953e274 + 68e31d8 commit bfd5911
Show file tree
Hide file tree
Showing 7 changed files with 190 additions and 90 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Java CI with Maven

on:
push:
branches: [ develop, master ]
paths-ignore:
- 'README.md'
pull_request:
branches: develop
env: # beware env value are of string type, not boolean. Need to use fromJSON to convert them to boolean
isProduction: ${{ github.event_name == 'push' && github.ref_name == 'master' }}
prepareRelease: ${{ github.event_name == 'push' && github.ref_name == 'develop' && contains(github.event.head_commit.message, 'prepare release') }}

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: maven
server-id: ${{ (fromJSON(env.isProduction) && 'creatis-releases') || 'creatis-snapshots' }}
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Build with Maven
# deploy only for pushes on develop and master, et verify for PRs
run: mvn -B clean ${{ env.mavenTarget }}
env:
MAVEN_USERNAME: github
MAVEN_PASSWORD: ${{ secrets.NEXUS_PSW }}
mavenTarget: ${{ github.event_name == 'push' && ! fromJSON(env.prepareRelease) && 'deploy' || 'verify' }}
- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
with:
commit: ${{github.event.workflow_run.head_sha}}
report_paths: '**/target/*-reports/TEST-*.xml'
detailed_summary: true
include_passed: true

# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
- name: Update dependency graph
uses: advanced-security/[email protected]
if: github.event_name != 'pull_request'
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>fr.insalyon.creatis</groupId>
<artifactId>gasw-dirac-plugin</artifactId>
<version>3.9.1</version>
<version>3.10.0</version>
<packaging>jar</packaging>

<name>GASW-Dirac-Plugin</name>
Expand All @@ -14,7 +14,7 @@
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>

<gasw-version>3.8.0</gasw-version>
<gasw-version>3.10.0</gasw-version>
</properties>

<licenses>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public class DiracConfiguration {
private boolean notificationEnabled;
private int notificationPort;
private boolean balanceEnabled;
private boolean dynamicBanEnabled;
private List<Object> bannedSites;
private List<Object> siteNamesToIgnore;

Expand All @@ -79,6 +80,7 @@ public static void setConfiguration(
boolean notificationEnabled,
int notificationPort,
boolean balanceEnabled,
boolean dynamicBanEnabled,
List<Object> bannedSites,
List<Object> namesToIgnore) {

Expand All @@ -92,6 +94,7 @@ public static void setConfiguration(
notificationEnabled,
notificationPort,
balanceEnabled,
dynamicBanEnabled,
bannedSites,
namesToIgnore);
}
Expand All @@ -106,6 +109,7 @@ private DiracConfiguration(
boolean notificationEnabled,
int notificationPort,
boolean balanceEnabled,
boolean dynamicBanEnabled,
List<Object> bannedSites,
List<Object> namesToIgnore) {

Expand All @@ -118,6 +122,7 @@ private DiracConfiguration(
this.notificationEnabled = notificationEnabled;
this.notificationPort = notificationPort;
this.balanceEnabled = balanceEnabled;
this.dynamicBanEnabled = dynamicBanEnabled;
this.bannedSites = bannedSites;
this.siteNamesToIgnore = namesToIgnore;
}
Expand All @@ -136,6 +141,7 @@ private DiracConfiguration() throws GaswException {
notificationEnabled = config.getBoolean(DiracConstants.LAB_NOTIFICATION_ENABLED, false);
notificationPort = config.getInt(DiracConstants.LAB_NOTIFICATION_PORT, 50009);
balanceEnabled = config.getBoolean(DiracConstants.LAB_BALANCE_ENABLED, false);
dynamicBanEnabled = config.getBoolean(DiracConstants.LAB_CONF_DYNAMIC_BAN_ENABLED, true);
bannedSites = config.getList(DiracConstants.LAB_CONF_BANNED_SITES, new ArrayList());
siteNamesToIgnore = config.getList(DiracConstants.LAB_CONF_SITE_NAMES_TO_IGNORE, Arrays.asList("Any", "Multiple"));

Expand All @@ -148,6 +154,7 @@ private DiracConfiguration() throws GaswException {
config.setProperty(DiracConstants.LAB_NOTIFICATION_ENABLED, notificationEnabled);
config.setProperty(DiracConstants.LAB_NOTIFICATION_PORT, notificationPort);
config.setProperty(DiracConstants.LAB_BALANCE_ENABLED, balanceEnabled);
config.setProperty(DiracConstants.LAB_CONF_DYNAMIC_BAN_ENABLED, dynamicBanEnabled);
config.setProperty(DiracConstants.LAB_CONF_BANNED_SITES, bannedSites);
config.setProperty(DiracConstants.LAB_CONF_SITE_NAMES_TO_IGNORE, siteNamesToIgnore);

Expand Down Expand Up @@ -194,6 +201,10 @@ public int getNotificationPort() {
return notificationPort;
}

public boolean isDynamicBanEnabled() {
return dynamicBanEnabled;
}

public String[] getBannedSites() {
return bannedSites.toArray(new String[]{});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public class DiracConstants {
public static final String LAB_NOTIFICATION_ENABLED = "plugin.dirac.notification.enabled";
public static final String LAB_NOTIFICATION_PORT = "plugin.dirac.notification.port";
public static final String LAB_CONF_BANNED_SITES = "plugin.dirac.conf.sites.banned";
public static final String LAB_CONF_DYNAMIC_BAN_ENABLED = "plugin.dirac.conf.sites.dynamic-ban.enabled";
public static final String LAB_CONF_SITE_NAMES_TO_IGNORE = "plugin.dirac.conf.sites.ignored";
// Environment Variables
public static final String ENV_BANNED_SITE = "diracBannedSite";
Expand Down
Loading

0 comments on commit bfd5911

Please sign in to comment.