generated from CDCgov/template
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into platform/kalish/15766-azure-event-item-sent
- Loading branch information
Showing
21 changed files
with
232 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# action.yml | ||
name: "Build Auth" | ||
description: "Build Auth microservice" | ||
inputs: | ||
version: | ||
description: "Version tag" | ||
required: true | ||
upload-build: | ||
default: true | ||
run-integration-tests: | ||
default: false | ||
run-qc: | ||
default: false | ||
github-token: | ||
default: false | ||
sp-creds: | ||
description: "Azure Service Principal creds" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
# These are for CI and not credentials of any system | ||
- name: Set Environment Variables | ||
working-directory: prime-router | ||
shell: bash | ||
run: | | ||
echo >> $GITHUB_ENV DB_USER='prime' | ||
echo >> $GITHUB_ENV DB_PASSWORD='changeIT!' | ||
- name: Remove unnecessary software | ||
shell: bash | ||
run: | | ||
sudo rm -rf /usr/local/lib/android | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@2dfa2011c5b2a0f1489bf9e433881c92c1631f88 | ||
with: | ||
java-version: "17" | ||
distribution: "temurin" | ||
cache: "gradle" | ||
|
||
- uses: gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808 | ||
|
||
- name: Lint | ||
if: inputs.run-integration-tests == 'true' | ||
run: ./gradlew :auth:ktlintCheck | ||
shell: bash | ||
|
||
- name: Spin up build containers | ||
working-directory: prime-router | ||
shell: bash | ||
run: docker compose -f docker-compose.postgres.yml up -d | ||
|
||
- name: Build auth Package | ||
uses: ./.github/actions/retry | ||
with: | ||
timeout_minutes: 10 | ||
max_attempts: 2 | ||
retry_wait_seconds: 30 | ||
command: | | ||
./gradlew :auth:build -x test | ||
shell: bash | ||
|
||
- name: Cleanup Gradle Cache | ||
if: inputs.run-integration-tests == 'true' | ||
working-directory: prime-router | ||
run: | | ||
rm -f .gradle/caches/modules-2/modules-2.lock | ||
rm -f .gradle/caches/modules-2/gc.properties | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
org.gradle.jvmargs=-Dfile.encoding=UTF8 -Xmx2048M | ||
# Set Kotlin version for all peices of the build environment | ||
systemProp.kotlinVersion=1.9.23 | ||
systemProp.kotlinVersion=1.9.25 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,17 +35,27 @@ apply(from = rootProject.file("buildSrc/shared.gradle.kts")) | |
plugins { | ||
val kotlinVersion by System.getProperties() | ||
id("reportstream.project-conventions") | ||
id("org.flywaydb.flyway") version "10.17.0" | ||
id("org.flywaydb.flyway") version "10.18.0" | ||
id("nu.studer.jooq") version "9.0" | ||
id("com.github.johnrengelman.shadow") version "8.1.1" | ||
id("com.microsoft.azure.azurefunctions") version "1.16.1" | ||
id("com.adarshr.test-logger") version "4.0.0" | ||
id("jacoco") | ||
id("org.jetbrains.dokka") version "1.8.20" | ||
id("com.avast.gradle.docker-compose") version "0.17.7" | ||
id("com.avast.gradle.docker-compose") version "0.17.8" | ||
id("org.jetbrains.kotlin.plugin.serialization") version "$kotlinVersion" | ||
id("com.nocwriter.runsql") version ("1.0.3") | ||
id("io.swagger.core.v3.swagger-gradle-plugin") version "2.2.22" | ||
id("io.swagger.core.v3.swagger-gradle-plugin") version "2.2.23" | ||
} | ||
|
||
// retrieve the current commit hash | ||
val commitId by lazy { | ||
val stdout = ByteArrayOutputStream() | ||
exec { | ||
commandLine("git", "rev-parse", "--short", "HEAD") | ||
standardOutput = stdout | ||
} | ||
stdout.toString(StandardCharsets.UTF_8).trim() | ||
} | ||
|
||
group = "gov.cdc.prime.reportstream" | ||
|
@@ -65,7 +75,7 @@ val javaVersion = when (appJvmTarget) { | |
} | ||
val ktorVersion = "2.3.12" | ||
val kotlinVersion by System.getProperties() | ||
val jacksonVersion = "2.17.1" | ||
val jacksonVersion = "2.17.2" | ||
jacoco.toolVersion = "0.8.12" | ||
|
||
// Local database information, first one wins: | ||
|
@@ -261,6 +271,9 @@ sourceSets.create("testIntegration") { | |
runtimeClasspath += sourceSets["main"].output | ||
} | ||
|
||
// Add generated version object | ||
sourceSets["main"].java.srcDir("$buildDir/generated-src/version") | ||
|
||
val compileTestIntegrationKotlin: KotlinCompile by tasks | ||
compileTestIntegrationKotlin.kotlinOptions.jvmTarget = appJvmTarget | ||
|
||
|
@@ -340,6 +353,7 @@ tasks.withType<Test>().configureEach { | |
} | ||
|
||
tasks.processResources { | ||
dependsOn("generateVersionObject") | ||
// Set the proper build values in the build.properties file | ||
filesMatching("build.properties") { | ||
val dateFormatter = DateTimeFormatter.ofPattern("yyyyMMdd") | ||
|
@@ -500,18 +514,32 @@ tasks.azureFunctionsPackage { | |
finalizedBy("copyAzureScripts") | ||
} | ||
|
||
// TODO: remove after implementation of health check endpoint | ||
tasks.register("generateVersionFile") { | ||
doLast { | ||
val stdout = ByteArrayOutputStream() | ||
exec { | ||
commandLine("git", "rev-parse", "--short", "HEAD") | ||
standardOutput = stdout | ||
} | ||
val currentCommit = stdout.toString(StandardCharsets.UTF_8).trim() | ||
File(buildDir, "$azureFunctionsDir/$azureAppName/version.json").writeText("{\"commitId\": \"$currentCommit\"}") | ||
file("$buildDir/$azureFunctionsDir/$azureAppName/version.json").writeText("{\"commitId\": \"$commitId\"}") | ||
} | ||
} | ||
|
||
tasks.register("generateVersionObject") { | ||
val sourceDir = file("$buildDir/generated-src/version") | ||
val sourceFile = file("$sourceDir/Version.kt") | ||
sourceDir.mkdirs() | ||
sourceFile.writeText( | ||
""" | ||
package gov.cdc.prime.router.version | ||
/** | ||
* Supplies information for the current build. | ||
* This file is generated via Gradle task prior to compile time and should always contain the current commit hash. | ||
*/ | ||
object Version { | ||
const val commitId = "$commitId" | ||
} | ||
""".trimIndent() | ||
) | ||
} | ||
|
||
val azureResourcesTmpDir = File(buildDir, "$azureFunctionsDir-resources/$azureAppName") | ||
val azureResourcesFinalDir = File(buildDir, "$azureFunctionsDir/$azureAppName") | ||
tasks.register<Copy>("gatherAzureResources") { | ||
|
@@ -805,7 +833,7 @@ buildscript { | |
// will need to be removed once this issue is resolved in Maven. | ||
classpath("net.minidev:json-smart:2.5.1") | ||
// as per flyway v10 docs the postgres flyway module must be on the project buildpath | ||
classpath("org.flywaydb:flyway-database-postgresql:10.17.0") | ||
classpath("org.flywaydb:flyway-database-postgresql:10.18.0") | ||
} | ||
} | ||
|
||
|
@@ -818,37 +846,37 @@ configurations { | |
} | ||
|
||
dependencies { | ||
jooqGenerator("org.postgresql:postgresql:42.7.3") | ||
jooqGenerator("org.postgresql:postgresql:42.7.4") | ||
|
||
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion") | ||
implementation("org.jetbrains.kotlin:kotlin-stdlib-common:$kotlinVersion") | ||
implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion") | ||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1") | ||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.9.0") | ||
implementation("com.microsoft.azure.functions:azure-functions-java-library:3.1.0") | ||
implementation("com.azure:azure-core:1.51.0") | ||
implementation("com.azure:azure-core-http-netty:1.15.3") | ||
implementation("com.azure:azure-core:1.52.0") | ||
implementation("com.azure:azure-core-http-netty:1.15.4") | ||
implementation("com.azure:azure-storage-blob:12.27.0") { | ||
exclude(group = "com.azure", module = "azure-core") | ||
} | ||
implementation("com.azure:azure-storage-queue:12.22.0") { | ||
exclude(group = "com.azure", module = "azure-core") | ||
} | ||
implementation("com.azure:azure-security-keyvault-secrets:4.8.5") { | ||
implementation("com.azure:azure-security-keyvault-secrets:4.8.6") { | ||
exclude(group = "com.azure", module = "azure-core") | ||
exclude(group = "com.azure", module = "azure-core-http-netty") | ||
} | ||
implementation("com.azure:azure-identity:1.13.2") { | ||
implementation("com.azure:azure-identity:1.13.3") { | ||
exclude(group = "com.azure", module = "azure-core") | ||
exclude(group = "com.azure", module = "azure-core-http-netty") | ||
} | ||
implementation("com.nimbusds:nimbus-jose-jwt:9.40") | ||
implementation("org.apache.logging.log4j:log4j-api:2.23.1") | ||
implementation("org.apache.logging.log4j:log4j-core:2.23.1") | ||
implementation("org.apache.logging.log4j:log4j-slf4j2-impl:2.23.1") | ||
implementation("org.apache.logging.log4j:log4j-layout-template-json:2.23.1") | ||
implementation("org.apache.logging.log4j:log4j-api-kotlin:1.4.0") | ||
implementation("com.nimbusds:nimbus-jose-jwt:9.41.1") | ||
implementation("org.apache.logging.log4j:log4j-api:2.24.0") | ||
implementation("org.apache.logging.log4j:log4j-core:2.24.0") | ||
implementation("org.apache.logging.log4j:log4j-slf4j2-impl:2.24.0") | ||
implementation("org.apache.logging.log4j:log4j-layout-template-json:2.24.0") | ||
implementation("org.apache.logging.log4j:log4j-api-kotlin:1.5.0") | ||
implementation("io.github.oshai:kotlin-logging-jvm:7.0.0") | ||
implementation("com.github.doyaaaaaken:kotlin-csv-jvm:1.9.3") | ||
implementation("com.github.doyaaaaaken:kotlin-csv-jvm:1.10.0") | ||
implementation("tech.tablesaw:tablesaw-core:0.43.1") | ||
implementation("com.github.ajalt.clikt:clikt-jvm:4.4.0") | ||
|
||
|
@@ -857,7 +885,7 @@ dependencies { | |
implementation("com.github.javafaker:javafaker:1.0.2") { | ||
exclude(group = "org.yaml", module = "snakeyaml") | ||
} | ||
implementation("org.yaml:snakeyaml:2.2") | ||
implementation("org.yaml:snakeyaml:2.3") | ||
implementation("io.github.linuxforhealth:hl7v2-fhir-converter") { | ||
version { | ||
branch = "master" | ||
|
@@ -873,7 +901,7 @@ dependencies { | |
implementation("ca.uhn.hapi:hapi-base:2.5.1") | ||
implementation("ca.uhn.hapi:hapi-structures-v251:2.5.1") | ||
implementation("ca.uhn.hapi:hapi-structures-v27:2.5.1") | ||
implementation("com.googlecode.libphonenumber:libphonenumber:8.13.42") | ||
implementation("com.googlecode.libphonenumber:libphonenumber:8.13.46") | ||
implementation("org.thymeleaf:thymeleaf:3.1.2.RELEASE") | ||
implementation("com.sendgrid:sendgrid-java:4.10.2") | ||
implementation("com.okta.jwt:okta-jwt-verifier:0.5.7") | ||
|
@@ -887,12 +915,12 @@ dependencies { | |
implementation("org.apache.commons:commons-text:1.12.0") | ||
implementation("commons-codec:commons-codec:1.17.1") | ||
implementation("commons-io:commons-io:2.16.1") | ||
implementation("org.postgresql:postgresql:42.7.3") | ||
implementation("org.postgresql:postgresql:42.7.4") | ||
implementation("com.zaxxer:HikariCP:5.1.0") | ||
implementation("org.flywaydb:flyway-core:10.17.0") | ||
implementation("org.flywaydb:flyway-database-postgresql:10.17.0") | ||
implementation("org.flywaydb:flyway-core:10.18.0") | ||
implementation("org.flywaydb:flyway-database-postgresql:10.18.0") | ||
implementation("org.commonmark:commonmark:0.22.0") | ||
implementation("com.google.guava:guava:33.2.1-jre") | ||
implementation("com.google.guava:guava:33.3.0-jre") | ||
implementation("com.helger.as2:as2-lib:5.1.2") | ||
implementation("org.bouncycastle:bcprov-jdk15to18:1.78.1") | ||
implementation("org.bouncycastle:bcprov-jdk18on:1.78.1") | ||
|
@@ -915,14 +943,14 @@ dependencies { | |
implementation("it.skrape:skrapeit-http-fetcher:1.3.0-alpha.2") | ||
implementation("org.apache.poi:poi:5.3.0") | ||
implementation("org.apache.poi:poi-ooxml:5.3.0") | ||
implementation("org.apache.commons:commons-compress:1.26.2") | ||
implementation("org.apache.commons:commons-compress:1.27.1") | ||
implementation("commons-io:commons-io:2.16.1") | ||
implementation("com.anyascii:anyascii:0.3.2") | ||
// force jsoup since [email protected]+ has not updated | ||
implementation("org.jsoup:jsoup:1.18.1") | ||
// https://mvnrepository.com/artifact/io.swagger/swagger-annotations | ||
implementation("io.swagger:swagger-annotations:1.6.14") | ||
implementation("io.swagger.core.v3:swagger-jaxrs2:2.2.22") | ||
implementation("io.swagger.core.v3:swagger-jaxrs2:2.2.23") | ||
// https://mvnrepository.com/artifact/javax.ws.rs/javax.ws.rs-api | ||
implementation("javax.ws.rs:javax.ws.rs-api:2.1.1") | ||
// https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api | ||
|
@@ -948,7 +976,7 @@ dependencies { | |
implementation("io.konform:konform-jvm:0.4.0") | ||
|
||
runtimeOnly("com.okta.jwt:okta-jwt-verifier-impl:0.5.7") | ||
runtimeOnly("com.squareup.okio:okio:3.9.0") | ||
runtimeOnly("com.squareup.okio:okio:3.9.1") | ||
runtimeOnly("io.jsonwebtoken:jjwt-impl:0.11.5") | ||
runtimeOnly("io.jsonwebtoken:jjwt-jackson:0.11.5") | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# This setting makes flyway fall back to session locks as concurrent index creation cannot be done | ||
# within a transaction. This setting is needed as of flyway 9.19.4. | ||
flyway.postgresql.transactional.lock=false | ||
flyway.postgresql.transactional.lock=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.