HIRS/HIRS_AttestationCAPortal/build.gradle

123 lines
3.7 KiB
Groovy
Raw Permalink Normal View History

plugins {
id 'application'
id 'java'
id 'war'
id 'com.netflix.nebula.ospackage' version '11.4.0'
id 'org.springframework.boot' version '3.0.6'
id 'io.spring.dependency-management' version '1.1.0'
}
2018-09-06 13:47:33 +00:00
// Get version from main project gradle
def packVersion = properties.get("packageVersion");
def jarVersion = properties.get("jarVersion");
//println "packageVersion is ${projVersion}"
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
2018-09-06 13:47:33 +00:00
}
}
configurations {
compileOnly {
extendsFrom annotationProcessor
2018-09-06 13:47:33 +00:00
}
2023-06-27 19:58:36 +00:00
all*.exclude module: 'spring-boot-starter-logging'
2018-09-06 13:47:33 +00:00
}
repositories {
flatDir { dirs "lib" }
mavenCentral()
2018-09-06 13:47:33 +00:00
}
dependencies {
2023-03-07 01:54:49 +00:00
implementation project(':HIRS_Utils')
implementation project(':HIRS_AttestationCA')
implementation libs.pci
implementation libs.gson
implementation libs.bouncycastle
implementation libs.guava
implementation libs.jakarta.servlet
2023-02-16 17:05:36 +00:00
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
2023-06-27 19:58:36 +00:00
implementation 'org.springframework.boot:spring-boot-starter-log4j2'
implementation 'org.apache.logging.log4j:log4j-spring-boot'
2023-02-23 17:28:52 +00:00
implementation 'org.projectlombok:lombok'
implementation 'commons-fileupload:commons-fileupload:1.5'
2023-06-26 13:15:54 +00:00
implementation 'org.apache.tomcat.embed:tomcat-embed-jasper:10.1.5'
2023-03-07 01:54:49 +00:00
compileOnly 'org.projectlombok:lombok'
2023-08-23 20:30:06 +00:00
implementation 'org.mariadb.jdbc:mariadb-java-client:3.1.4'
annotationProcessor 'org.projectlombok:lombok'
providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.junit.jupiter:junit-jupiter:5.9.3'
testImplementation 'org.hsqldb:hsqldb'
}
test {
useJUnitPlatform()
}
2018-09-06 13:47:33 +00:00
ospackage {
packageName = 'HIRS_AttestationCA'
os = LINUX
arch = NOARCH
version = "$packVersion"
release = '1'
user 'root'
fileMode = 0755
addParentDirs = true
createDirectoryEntry true
// copy json tables
into ('/etc/hirs/aca/default-properties') {
from '../HIRS_AttestationCA/src/main/resources/component-class.json'
from '../HIRS_AttestationCA/src/main/resources/vendor-table.json'
}
// copy springboot property file
into ('/etc/hirs/aca/') {
from '../HIRS_AttestationCAPortal/src/main/resources/application.properties'
}
// copy setup scripts to /opt/hirs/aca
into ('/opt/hirs/aca/scripts/') {
from '../package/scripts/'
}
// copy the war file into /opt/hirs/aca
into ('/opt/hirs/aca/') {
from '../HIRS_AttestationCAPortal/build/libs/HIRS_AttestationCAPortal.war'
user 'root'
fileMode = 0755
}
// Post Install
2023-10-10 18:29:37 +00:00
postInstall 'bash /opt/hirs/aca/scripts/aca/aca_setup.sh -u'
// add chrontab to run ACA at boot
2023-09-14 19:25:19 +00:00
postInstall 'echo "@reboot root /opt/hirs/aca/scripts/aca/aca_bootRun.sh -w" >> /etc/crontab'
// run ACA after install
postInstall '/opt/hirs/aca/scripts/aca/aca_bootRun.sh -w &'
2023-09-14 19:25:19 +00:00
postInstall 'chmod +x /opt/hirs/aca/scripts/aca/*'
2023-10-10 18:29:37 +00:00
postInstall 'bash /opt/hirs/aca/scripts/aca/check_for_aca.sh'
postInstall 'mkdir -p /etc/hirs/aca && touch /etc/hirs/aca/VERSION'
postInstall "echo ${jarVersion} > /etc/hirs/aca/VERSION"
2023-08-11 13:47:30 +00:00
// Uninstall
2023-10-10 18:29:37 +00:00
preUninstall 'bash /opt/hirs/aca/scripts/aca/aca_remove_setup.sh'
postUninstall 'rm -rf /etc/hirs'
buildRpm {
arch = X86_64
}
buildDeb {
2023-10-10 18:29:37 +00:00
packageName = 'hirs-attestationca'
arch = 'amd64'
}
}