Skip to content

Commit

Permalink
style: lint files
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentin-Guillemin committed Oct 10, 2024
1 parent bf538f8 commit bbfb85d
Show file tree
Hide file tree
Showing 21 changed files with 56 additions and 59 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ jobs:
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'
- name: Prepare project
run: cp build.properties.sample build.properties
- name: Run tasks
run: ./gradlew tomcatInstall && ./gradlew tomcatDeploy
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- name: Prepare project
run: cp build.properties.sample build.properties
- name: Run tasks
run: ./gradlew tomcatInstall && ./gradlew tomcatDeploy
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# apps-deployer

gradle-war-deployer for esup-publisher
embed deployed app on tomcat, like the tomcat-manager, psi-probe
9 changes: 5 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import org.gradle.internal.os.OperatingSystem

/*
* This file was generated by the Gradle 'init' task.
*
Expand Down Expand Up @@ -28,14 +29,14 @@ ext {
* Unfortunately, several of the uPortal CLI tasks need to do
* significantly different things on different operating systems.
*/
isWindows = OperatingSystem.current().isWindows()
isWindows = OperatingSystem.current().isWindows()
}


eclipse {
classpath {
downloadSources = true
downloadJavadoc = true
downloadSources = true
downloadJavadoc = true
}
}

Expand All @@ -55,7 +56,7 @@ apply from: rootProject.file('gradle/tasks/tomcat.gradle')
*/
File customTasks = rootProject.file('gradle/tasks/custom.gradle')

if(customTasks.isFile()) {
if (customTasks.isFile()) {
apply from: customTasks
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class GradleCustomTasksPlugin implements Plugin<Project> {
logger.lifecycle("Check if shared cache directory already exist, else will create it !");
String cacheDir = project.rootProject.ext['buildProperties'].getProperty('server.sharedCacheDir')
logger.lifecycle("Shared Cache Directory properties defined on path '${cacheDir}'");
File dir = new File((String)cacheDir);
File dir = new File((String) cacheDir);
if (!dir.exists()) {
logger.lifecycle("Shared cache directory not already existing, will create it '${cacheDir}'");
dir.mkdir();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class GradleTomcatDeployPlugin implements Plugin<Project> {

doFirst {
File serverWebapps = project.rootProject.file(project.rootProject.ext['buildProperties'].getProperty('server.webapps'))
File deployDir = new File (serverWebapps, "${project.name}")
File deployDir = new File(serverWebapps, "${project.name}")
logger.lifecycle("Removing deployed application from servlet container at location: ${deployDir}")
delete deployDir
}
Expand All @@ -28,7 +28,7 @@ class GradleTomcatDeployPlugin implements Plugin<Project> {

doFirst {
File serverWebapps = project.rootProject.file(project.rootProject.ext['buildProperties'].getProperty('server.webapps'))
File deployDir = new File (serverWebapps, "${project.name}")
File deployDir = new File(serverWebapps, "${project.name}")
logger.lifecycle("Deploying assembled application to servlet container at location: ${deployDir}")

File warFile = new File("${project.buildDir}/libs/${project.war.archiveName}")
Expand Down
2 changes: 1 addition & 1 deletion etc/tomcat/conf/context.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@
<WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>

<!-- Comment this to enable session persistence across Tomcat restarts -->
<Manager pathname="" />
<Manager pathname=""/>
</Context>
21 changes: 9 additions & 12 deletions etc/tomcat/conf/server.xml
Original file line number Diff line number Diff line change
Expand Up @@ -154,33 +154,30 @@
resources under the key "UserDatabase". Any edits
that are performed against this UserDatabase are immediately
available for use by the Realm. -->
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
<Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>
</Realm>

<Host name="localhost" appBase="webapps"
unpackWARs="false" autoDeploy="false">
<Host name="localhost" appBase="webapps" unpackWARs="false" autoDeploy="false">

<Context path="/publisher" docBase="${server.webapps}/esup-publisher" reloadable="false" crossContext="true" >
<Context path="/publisher" docBase="${server.webapps}/esup-publisher" reloadable="false" crossContext="true">
<Parameter name="spring.config.additional-location" value="${PROJECT_HOME}/esup-publisher/"/>
</Context>
<Context path="/pronote-ws" docBase="${server.webapps}/pronote-ws" reloadable="false" crossContext="true" >
<Context path="/pronote-ws" docBase="${server.webapps}/pronote-ws" reloadable="false" crossContext="true">
<Parameter name="spring.config.additional-location" value="${PROJECT_HOME}/pronote-ws/"/>
</Context>
<Context path="/glc2" docBase="${server.webapps}/GLC" reloadable="false" crossContext="true" >
<Context path="/glc2" docBase="${server.webapps}/GLC" reloadable="false" crossContext="true">
<Parameter name="spring.config.additional-location" value="${PROJECT_HOME}/glc/"/>
</Context>
<Context path="/wisemapping" docBase="${server.webapps}/wisemapping" reloadable="false" crossContext="true"/>
<Context path="/collabsoft" docBase="${server.webapps}/collabsoft" reloadable="false" crossContext="true">
<Parameter name="spring.config.additional-location" value="${PROJECT_HOME}/collabsoft/"/>
</Context>
<Context path="/paramuseretab" docBase="${server.webapps}/paramuseretab" reloadable="false" crossContext="true" >
<Context path="/paramuseretab" docBase="${server.webapps}/paramuseretab" reloadable="false" crossContext="true">
<Parameter name="spring.config.additional-location" value="${PROJECT_HOME}/paramuseretab/"/>
</Context>
<Context path="/manager" docBase="${server.home}/webapps/manager" reloadable="false" antiResourceLocking="false" privileged="true" useHttpOnly="true">
</Context>
<Context path="/probe" docBase="${server.webapps}/psi-probe" reloadable="false" antiResourceLocking="false" privileged="true" useHttpOnly="true" >
</Context>

<Context path="/manager" docBase="${server.home}/webapps/manager" reloadable="false" antiResourceLocking="false" privileged="true" useHttpOnly="true"/>
<Context path="/probe" docBase="${server.webapps}/psi-probe" reloadable="false" antiResourceLocking="false" privileged="true" useHttpOnly="true"/>

<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
Expand Down
14 changes: 7 additions & 7 deletions etc/tomcat/conf/tomcat-users.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<tomcat-users xmlns="http://tomcat.apache.org/xml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<tomcat-users xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://tomcat.apache.org/xml"
xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd"
version="1.0">
<role rolename="probeuser" />
<role rolename="poweruser" />
<role rolename="poweruserplus" />
<role rolename="manager-gui"/>
<user username="manager" password="CHANGEIT" roles="manager-gui"/>
<role rolename="probeuser"/>
<role rolename="poweruser"/>
<role rolename="poweruserplus"/>
<role rolename="manager-gui"/>
<user username="manager" password="CHANGEIT" roles="manager-gui"/>
</tomcat-users>
6 changes: 2 additions & 4 deletions gradle/tasks/properties.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import java.nio.file.Paths

/*
* Allows a collection of Java versions to be supported.
* If the currect Java version is unsupported, it will stop the current task execution.
Expand All @@ -9,12 +7,12 @@ task javaVersionCheck() {
description 'Ensures the current Java version is supported'

doLast {
def supportedJavaVersions = [ JavaVersion.VERSION_1_8, JavaVersion.VERSION_11 ];
def supportedJavaVersions = [JavaVersion.VERSION_1_8, JavaVersion.VERSION_11];
def currentJavaVersion = JavaVersion.current();
if (!supportedJavaVersions.contains(currentJavaVersion)) {
throw new GradleException("Incorrect Java version; found ${currentJavaVersion} but supported versions are: ${supportedJavaVersions}");
}
logger.lifecycle("Java version OK: ${currentJavaVersion}" )
logger.lifecycle("Java version OK: ${currentJavaVersion}")
}
}

Expand Down
2 changes: 1 addition & 1 deletion gradle/tasks/tomcat.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ task tomcatConfig() {
*/
String projectHomeDir = rootProject.ext['buildProperties'].getProperty('project.home')
file(projectHomeDir).mkdirs()
logger.lifecycle("\nDeploying files from 'etc/${appName}/*.*' into ${projectHomeDir}/")
logger.lifecycle("\nDeploying files from 'etc/${appName}/*.*' into ${projectHomeDir}/")
copy {
from "etc/${appName}"
//include '*_config/*.*'
Expand Down
2 changes: 1 addition & 1 deletion overlays/GLC/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ dependencies {
}

war {
archiveName="glc.war"
archiveName = "glc.war"

classpath = classpath.files
}
6 changes: 3 additions & 3 deletions overlays/GLC/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<configuration scan="true" scanPeriod="30 seconds">
<contextName>glc</contextName>
<jmxConfigurator />
<jmxConfigurator/>

<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_DIR}/${CONTEXT_NAME}.log</file>
Expand All @@ -18,11 +18,11 @@
</appender>

<root level="${logback.loglevel:-WARN}">
<appender-ref ref="FILE" />
<appender-ref ref="FILE"/>
</root>


<logger name="fr.recia.glc" level="WARN" />
<logger name="fr.recia.glc" level="WARN"/>

<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
<resetJUL>true</resetJUL>
Expand Down
2 changes: 1 addition & 1 deletion overlays/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ subprojects {
repositories {
mavenLocal()
mavenCentral()
maven { url "https://jitpack.io" }
maven { url "https://jitpack.io" }
maven {
url "https://s01.oss.sonatype.org/content/groups/public/"
mavenContent {
Expand Down
2 changes: 1 addition & 1 deletion overlays/esup-publisher/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ dependencies {
}

war {
archiveName="esup-publisher.war"
archiveName = "esup-publisher.war"

classpath = classpath.files
}
4 changes: 2 additions & 2 deletions overlays/esup-publisher/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<configuration scan="true" scanPeriod="30 seconds">
<contextName>publisher</contextName>
<jmxConfigurator />
<jmxConfigurator/>

<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_DIR}/${CONTEXT_NAME}.log</file>
Expand All @@ -17,7 +17,7 @@
</encoder>
</appender>

<root level="${logback.loglevel:-WARN}">
<root level="${logback.loglevel:-WARN}">
<appender-ref ref="FILE"/>
</root>

Expand Down
2 changes: 1 addition & 1 deletion overlays/paramuseretab/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<configuration scan="true" scanPeriod="30 seconds">
<contextName>paramuseretab</contextName>
<jmxConfigurator />
<jmxConfigurator/>

<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_DIR}/${CONTEXT_NAME}.log</file>
Expand Down
2 changes: 1 addition & 1 deletion overlays/pronote-ws/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ dependencies {
}

war {
archiveName='pronote-ws.war'
archiveName = 'pronote-ws.war'

classpath = classpath.files
}
8 changes: 4 additions & 4 deletions overlays/pronote-ws/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<configuration scan="true" scanPeriod="30 seconds">
<contextName>pronote-ws</contextName>
<jmxConfigurator />
<jmxConfigurator/>

<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_DIR}/${CONTEXT_NAME}.log</file>
Expand All @@ -18,11 +18,11 @@
</appender>

<root level="INFO">
<appender-ref ref="FILE" />
<appender-ref ref="FILE"/>
</root>

<logger name="fr.recia" level="INFO" />
<logger name="org" level="WARN" />
<logger name="fr.recia" level="INFO"/>
<logger name="org" level="WARN"/>

<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
<resetJUL>true</resetJUL>
Expand Down
2 changes: 1 addition & 1 deletion overlays/psi-probe/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ dependencies {
}

war {
archiveFileName='psi-probe.war'
archiveFileName = 'psi-probe.war'

classpath = classpath.files
}
2 changes: 1 addition & 1 deletion overlays/wisemapping/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ dependencies {
}

war {
archiveName="wisemapping.war"
archiveName = "wisemapping.war"

classpath = classpath.files
}
2 changes: 1 addition & 1 deletion overlays/wisemapping/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<configuration scan="true" scanPeriod="30 seconds">
<contextName>wisemapping</contextName>
<jmxConfigurator />
<jmxConfigurator/>

<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_DIR}/${CONTEXT_NAME}.log</file>
Expand Down

0 comments on commit bbfb85d

Please sign in to comment.