2023-02-14 12:30:16 +00:00
|
|
|
plugins {
|
|
|
|
id 'application'
|
|
|
|
id 'java'
|
|
|
|
id 'war'
|
2023-09-06 20:09:27 +00:00
|
|
|
id 'com.netflix.nebula.ospackage' version '11.4.0'
|
2023-04-26 12:32:45 +00:00
|
|
|
id 'org.springframework.boot' version '3.0.6'
|
2023-02-14 12:30:16 +00:00
|
|
|
id 'io.spring.dependency-management' version '1.1.0'
|
|
|
|
}
|
2018-09-06 13:47:33 +00:00
|
|
|
|
2023-03-17 18:47:10 +00:00
|
|
|
// Get version from main project gradle
|
|
|
|
def packVersion = properties.get("packageVersion");
|
|
|
|
def jarVersion = properties.get("jarVersion");
|
|
|
|
//println "packageVersion is ${projVersion}"
|
|
|
|
|
2023-02-14 12:30:16 +00:00
|
|
|
java {
|
|
|
|
toolchain {
|
|
|
|
languageVersion = JavaLanguageVersion.of(17)
|
2018-09-06 13:47:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-02-14 12:30:16 +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
|
|
|
}
|
|
|
|
|
2023-02-14 12:30:16 +00:00
|
|
|
repositories {
|
|
|
|
flatDir { dirs "lib" }
|
|
|
|
mavenCentral()
|
2018-09-06 13:47:33 +00:00
|
|
|
}
|
|
|
|
|
2023-02-14 12:30:16 +00:00
|
|
|
dependencies {
|
2023-03-07 01:54:49 +00:00
|
|
|
implementation project(':HIRS_Utils')
|
|
|
|
implementation project(':HIRS_AttestationCA')
|
|
|
|
|
2023-03-07 14:23:55 +00:00
|
|
|
implementation libs.pci
|
2023-06-13 13:29:29 +00:00
|
|
|
implementation libs.gson
|
2023-03-07 14:23:55 +00:00
|
|
|
implementation libs.bouncycastle
|
|
|
|
implementation libs.guava
|
|
|
|
implementation libs.jakarta.servlet
|
2023-02-16 17:05:36 +00:00
|
|
|
|
2023-02-14 12:30:16 +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'
|
2023-06-13 13:29:29 +00:00
|
|
|
implementation 'commons-fileupload:commons-fileupload:1.5'
|
|
|
|
implementation 'org.junit.jupiter:junit-jupiter:5.4.2'
|
|
|
|
implementation 'org.junit.jupiter:junit-jupiter:5.4.2'
|
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
|
|
|
|
2023-02-14 12:30:16 +00:00
|
|
|
compileOnly 'org.projectlombok:lombok'
|
2023-08-23 20:30:06 +00:00
|
|
|
implementation 'org.mariadb.jdbc:mariadb-java-client:3.1.4'
|
2023-02-14 12:30:16 +00:00
|
|
|
annotationProcessor 'org.projectlombok:lombok'
|
|
|
|
providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat'
|
|
|
|
|
|
|
|
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
2023-06-13 13:29:29 +00:00
|
|
|
testImplementation libs.testng
|
2023-02-14 12:30:16 +00:00
|
|
|
}
|
2018-09-06 13:47:33 +00:00
|
|
|
|
2023-04-27 19:51:22 +00:00
|
|
|
ospackage {
|
|
|
|
packageName = 'HIRS_AttestationCA'
|
|
|
|
os = LINUX
|
|
|
|
arch = NOARCH
|
|
|
|
version = "$packVersion"
|
|
|
|
release = '1'
|
2023-03-17 18:47:10 +00:00
|
|
|
|
2023-04-27 19:51:22 +00:00
|
|
|
user 'root'
|
|
|
|
fileMode = 0755
|
|
|
|
|
|
|
|
addParentDirs = true
|
|
|
|
createDirectoryEntry true
|
|
|
|
|
2023-09-27 18:40:18 +00:00
|
|
|
// 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'
|
|
|
|
}
|
2023-09-06 20:09:27 +00:00
|
|
|
// copy setup scripts to /opt/hirs/aca
|
|
|
|
into ('/opt/hirs/aca/scripts/') {
|
|
|
|
from '../package/scripts/'
|
2023-06-02 19:23:55 +00:00
|
|
|
}
|
2023-09-06 20:09:27 +00:00
|
|
|
// copy the war file into /opt/hirs/aca
|
|
|
|
into ('/opt/hirs/aca/') {
|
|
|
|
from '../HIRS_AttestationCAPortal/build/libs/HIRS_AttestationCAPortal.war'
|
|
|
|
user 'root'
|
|
|
|
fileMode = 0755
|
2023-06-02 19:23:55 +00:00
|
|
|
}
|
|
|
|
|
2023-09-06 20:09:27 +00:00
|
|
|
// Post Install
|
|
|
|
postInstall 'sh /opt/hirs/aca/scripts/aca/aca_setup.sh -u'
|
2023-09-13 20:56:39 +00:00
|
|
|
// 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'
|
2023-09-13 20:56:39 +00:00
|
|
|
// run ACA after install
|
2023-09-27 18:40:18 +00:00
|
|
|
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-09-27 18:40:18 +00:00
|
|
|
postInstall 'sh /opt/hirs/aca/scripts/aca/check_for_aca.sh'
|
2023-08-11 13:47:30 +00:00
|
|
|
|
2023-09-06 20:09:27 +00:00
|
|
|
// Uninstall
|
|
|
|
preUninstall 'sh /opt/hirs/aca/scripts/aca/aca_remove_setup.sh'
|
2023-09-27 18:40:18 +00:00
|
|
|
postUninstall 'rm -rf /etc/hirs'
|
2023-04-27 19:51:22 +00:00
|
|
|
|
|
|
|
buildRpm {
|
|
|
|
arch = X86_64
|
|
|
|
}
|
|
|
|
|
|
|
|
buildDeb {
|
|
|
|
arch = 'amd64'
|
|
|
|
}
|
|
|
|
}
|