From 983b900da761b78ed536dd46df04812bf0ea3d17 Mon Sep 17 00:00:00 2001 From: LSmyrnaios Date: Thu, 9 Sep 2021 15:56:37 +0300 Subject: [PATCH] - Add the "installAndRun.sh" script. - Update the README. - Update the dependencies. --- README.md | 9 +++++++ build.gradle | 15 ++++++----- gradle/wrapper/gradle-wrapper.properties | 2 +- installAndRun.sh | 34 ++++++++++++++++++++++++ 4 files changed, 53 insertions(+), 7 deletions(-) create mode 100755 installAndRun.sh diff --git a/README.md b/README.md index 2b767b1..8003d22 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,11 @@ # UrlsController +This is the Controller's Application.
+It receives requests coming from the [workers](https://code-repo.d4science.org/lsmyrnaios/UrlsWorker) , constructs an assignments-list with data received from a database and returns the list to the workers.
+Then it receives the "WorkerReports" and writes them into the database.
+The database used is the [Impala](https://impala.apache.org/) .
+[...]
+ +To install and run the application, run ```git clone``` and then execute the ```installAndRun.sh``` script.
+If you want to just run the app, then run the script with the argument "1": ```./installAndRun.sh 1```.
+
diff --git a/build.gradle b/build.gradle index 01d2689..0e717ad 100644 --- a/build.gradle +++ b/build.gradle @@ -1,11 +1,12 @@ buildscript { ext { - springSecurityVersion = "5.5.1" + springBootVersion = "2.5.4" + springSecurityVersion = "5.5.2" } } plugins { - id 'org.springframework.boot' version '2.5.3' + id 'org.springframework.boot' version '2.5.4' id 'io.spring.dependency-management' version '1.0.11.RELEASE' id 'java' } @@ -20,11 +21,13 @@ repositories { } dependencies { - runtimeOnly 'org.springframework.boot:spring-boot-devtools' + runtimeOnly "org.springframework.boot:spring-boot-devtools:${springBootVersion}" - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation("org.springframework.boot:spring-boot-starter-security") - implementation("org.springframework.boot:spring-boot-configuration-processor") + implementation "org.springframework.boot:spring-boot-starter-web:${springBootVersion}" + implementation("org.springframework.boot:spring-boot-starter-security:${springBootVersion}") + implementation("org.springframework.boot:spring-boot-starter-jdbc:${springBootVersion}") + + implementation("org.springframework.boot:spring-boot-configuration-processor:${springBootVersion}") implementation("org.springframework.security:spring-security-core:${springSecurityVersion}") implementation("org.springframework.security:spring-security-web:${springSecurityVersion}") implementation("org.springframework.security:spring-security-config:${springSecurityVersion}") diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 05679dc..ffed3a2 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/installAndRun.sh b/installAndRun.sh new file mode 100755 index 0000000..05a3557 --- /dev/null +++ b/installAndRun.sh @@ -0,0 +1,34 @@ +cd "${0%/*}" || (echo "Could not chdir to this script's dir!" && exit) # Change the working directory to the script's directory, when running from other location. + +justInstall=0 + +if [[ $# -eq 1 ]]; then + justInstall=$1 +elif [[ $# -gt 1 ]]; then + echo -e "Wrong number of arguments given: ${#}\nPlease execute it like: script.sh "; exit 1 +fi + +gradleVersion="7.2" + +if [[ justInstall -eq 0 ]]; then + + wget https://services.gradle.org/distributions/gradle-${gradleVersion}-bin.zip + + sudo mkdir /opt/gradle + sudo unzip -d /opt/gradle gradle-${gradleVersion}-bin.zip + #ls /opt/gradle/gradle-${gradleVersion} # For debugging installation + + export PATH=$PATH:/opt/gradle/gradle-${gradleVersion}/bin + + gradle wrapper --gradle-version=${gradleVersion} --distribution-type=bin + + #gradle tasks # For debugging installation + #gradle -v # For debugging installation + + gradle clean + gradle build +else + export PATH=$PATH:/opt/gradle/gradle-${gradleVersion}/bin # Make sure the gradle is still accessible (it usually isn't without the "export"). +fi + +gradle bootRun