- Automatically use the latest version of "publications_retriever" software from the Nexus maven-repository.

- Update Gradle.
- Update License.
- Configure the destination of the logs in the "application.properties" file.
This commit is contained in:
Lampros Smyrnaios 2024-02-08 18:33:18 +02:00
parent 3909104a1b
commit 50d756d582
7 changed files with 20 additions and 47 deletions

View File

@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2021-2023 Athena Research and Innovation Center (ARC)
Copyright 2021-2024 OpenAIRE AMKE
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@ -12,9 +12,14 @@ java {
repositories {
mavenCentral()
flatDir {
dirs 'libs'
maven {
name "d4science"
url "https://maven.d4science.org/nexus/content/repositories/dnet45-snapshots/"
}
// Enable the following, in case you want to test temporal-jars.
/*flatDir {
dirs 'libs'
}*/
}
dependencies {
@ -32,7 +37,7 @@ dependencies {
// Enable the validation annotations.
//implementation group: 'jakarta.validation', name: 'jakarta.validation-api', version: '3.0.2'
implementation ("eu.openaire:publications_retriever:1.1-SNAPSHOT") {
implementation ("eu.openaire:publications_retriever:1.2-SNAPSHOT") {
exclude group: 'ch.qos.logback', module: 'logback-core'
exclude group: 'ch.qos.logback', module: 'logback-classic'
exclude group: 'org.slf4j', module: 'slf4j-api'

View File

@ -21,5 +21,5 @@ echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
# Adjusting the Swappiness Property
cat /proc/sys/vm/swappiness
sudo sysctl vm.swappiness=10 # Setting it closer to 0, makes the swaps more rare. (10 %)
sudo sysctl vm.swappiness=10 # Setting it closer to 0, makes the swaps more rare: 10%. The default is 60%.
echo "vm.swappiness=10" | sudo tee -a /etc/sysctl.conf # Append it to that file in order for the custom "swappiness" to be available on restart.

View File

@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME

View File

@ -11,55 +11,19 @@ handle_error () {
cd "${0%/*}" || handle_error "Could not change-dir to this script's dir!" 1
justRun=0
avoidReInstallingPublicationsRetriever=0
if [[ $# -eq 1 ]]; then
justRun=$1
elif [[ $# -eq 2 ]]; then
justRun=$1
avoidReInstallingPublicationsRetriever=$2
elif [[ $# -gt 2 ]]; then
echo -e "Wrong number of arguments given: ${#} (more than 2)\nPlease execute it like: script.sh <justRun: 0 | 1> <avoidReInstallingPublicationsRetriever: 0 | 1>"; exit 2
elif [[ $# -gt 1 ]]; then
echo -e "Wrong number of arguments given: ${#} (more than 1)\nPlease execute it like: script.sh <justRun: 0 | 1>"; exit 2
fi
gradleVersion="8.5"
gradleVersion="8.6"
shouldBeCarefulWithMaxHeap=0 # This is NOT a cmd-arg.
if [[ justRun -eq 0 ]]; then
if [[ avoidReInstallingPublicationsRetriever -eq 1 ]]; then
if [[ ! -f ./libs/publications_retriever-1.1-SNAPSHOT.jar ]]; then
echo -e "\n\nThe required \"PublicationsRetriever\" software has not been installed yet, thus the script will override the user-defined value of \"avoidReInstallingPublicationsRetriever\" to FALSE..\n\n"
avoidReInstallingPublicationsRetriever=0; # In case the jar-file does not exists, then make sure we follow the normal procedure, independently from what the user requested.
fi
fi
if [[ avoidReInstallingPublicationsRetriever -eq 0 ]]; then
if [ ! -d libs ]; then
mkdir libs || handle_error "The directory \"libs\" could not be created! Exiting.." 3
fi
cd libs || exit 4
git clone https://github.com/LSmyrnaios/PublicationsRetriever.git # We assume there is no previously source-code here, if so, it will be overwritten.
# Keep a backup of the previous JAR file, if it exists.
if [ -f ./publications_retriever-1.1-SNAPSHOT.jar ]; then
mv ./publications_retriever-1.1-SNAPSHOT.jar ./publications_retriever-1.1-SNAPSHOT_BACKUP.jar
fi
cd PublicationsRetriever && sudo apt install -y maven && mvn clean install
# Copy the created JAR file to the top libs directory.
cp target/publications_retriever-1.1-SNAPSHOT.jar ../publications_retriever-1.1-SNAPSHOT.jar
# Delete the directory with the source-code.
cd ../ && rm -rf PublicationsRetriever
# Clean, (re)build and run the project.
cd ../
fi
# Install the specified Gradle-build-tool version, if it does not exist.
if [[ ! -d /opt/gradle/gradle-${gradleVersion} ]]; then
wget https://services.gradle.org/distributions/gradle-${gradleVersion}-bin.zip
@ -86,7 +50,7 @@ if [[ justRun -eq 0 ]]; then
#gradle tasks # For debugging installation
#gradle -v # For debugging installation
gradle clean build
gradle clean build # --refresh-dependencies # --info
else
export PATH=/opt/gradle/gradle-${gradleVersion}/bin:$PATH # Make sure the gradle is still accessible (it usually isn't without the "export").
fi

View File

@ -34,6 +34,7 @@ workerReportsDirPath: ${HOME}/workerReports/
# LOGGING LEVELS
logging.config=classpath:logback-spring.xml
logging.file.path=logs
logging.level.root=INFO
logging.level.org.springframework.web=INFO
logging.level.org.springframework.security=WARN

View File

@ -2,7 +2,7 @@
<configuration debug="false">
<appender name="RollingFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>logs/UrlsWorker.log</file>
<file>${LOG_PATH}/UrlsWorker.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<fileNamePattern>logs/UrlsWorker.%i.log.zip</fileNamePattern>
@ -27,7 +27,10 @@
</appender>
<root level="debug">
<appender-ref ref="Console" />
<!--
<appender-ref ref="RollingFile" />
-->
</root>
</configuration>