generated from CDCgov/template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CNDIT-1589: Liquibase migration to the NEDSS-DataReporting repository
- Loading branch information
1 parent
a97bd28
commit 0bd3ade
Showing
78 changed files
with
19,746 additions
and
1 deletion.
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
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,4 @@ | ||
.gradle | ||
.idea | ||
build | ||
*.iml |
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,43 @@ | ||
HELP.md | ||
.gradle | ||
build/ | ||
!gradle/wrapper/gradle-wrapper.jar | ||
!**/src/main/**/build/ | ||
!**/src/test/**/build/ | ||
.idea/ | ||
.gradle/ | ||
|
||
### STS ### | ||
.apt_generated | ||
.classpath | ||
.factorypath | ||
.project | ||
.settings | ||
.springBeans | ||
.sts4-cache | ||
bin/ | ||
!**/src/main/**/bin/ | ||
!**/src/test/**/bin/ | ||
|
||
### IntelliJ IDEA ### | ||
.idea | ||
*.iws | ||
*.iml | ||
*.ipr | ||
out/ | ||
!**/src/main/**/out/ | ||
!**/src/test/**/out/ | ||
|
||
### NetBeans ### | ||
/nbproject/private/ | ||
/nbbuild/ | ||
/dist/ | ||
/nbdist/ | ||
/.nb-gradle/ | ||
|
||
### VS Code ### | ||
.vscode/ | ||
|
||
## Logs ## | ||
logs/ | ||
*.log |
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,25 @@ | ||
FROM liquibase/liquibase:latest-alpine | ||
|
||
USER root | ||
|
||
RUN apk add --no-cache wget unzip | ||
|
||
RUN wget "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -O "awscliv2.zip" && \ | ||
unzip awscliv2.zip && rm -rf awscliv2.zip && \ | ||
./aws/install | ||
|
||
|
||
#Copy sources | ||
COPY liquibase-service/src/main/resources/db/changelog /liquibase/changelog | ||
COPY liquibase-service/src/main/resources/db/master /liquibase/changelog | ||
COPY liquibase-service/src/main/resources/db/odse /liquibase/changelog | ||
COPY liquibase-service/src/main/resources/db/rdb /liquibase/changelog | ||
|
||
#Set the Working Directory | ||
WORKDIR /liquibase/changelog | ||
|
||
USER liquibase | ||
|
||
CMD ["sh", "-c", "tail -f /dev/null"] | ||
|
||
|
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,110 @@ | ||
buildscript { | ||
repositories { | ||
mavenCentral() | ||
gradlePluginPortal() | ||
maven { | ||
url "https://plugins.gradle.org/m2/" | ||
} | ||
} | ||
} | ||
|
||
plugins { | ||
id 'java' | ||
id 'org.springframework.boot' version '3.2.4' | ||
id 'io.spring.dependency-management' version '1.1.4' | ||
id 'org.liquibase.gradle' version '2.2.2' | ||
id 'org.sonarqube' version '4.2.1.3168' | ||
} | ||
|
||
//apply plugin: 'org.owasp.dependencycheck' | ||
|
||
group = 'gov.cdc.eltdatapipeline' | ||
version = '0.0.1-SNAPSHOT' | ||
|
||
java { | ||
sourceCompatibility = JavaVersion.VERSION_17 | ||
} | ||
|
||
ext.isReleaseVersion = !version.endsWith("SNAPSHOT") | ||
|
||
tasks.withType(Jar).configureEach { duplicatesStrategy = DuplicatesStrategy.EXCLUDE } | ||
|
||
configurations { | ||
compileOnly { | ||
extendsFrom annotationProcessor | ||
} | ||
} | ||
|
||
repositories { | ||
mavenLocal() | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
implementation 'org.springframework.boot:spring-boot-starter-web' | ||
implementation 'net.logstash.logback:logstash-logback-encoder:7.4' | ||
testImplementation 'org.springframework.boot:spring-boot-starter-test' | ||
|
||
// Liquibase | ||
liquibaseRuntime 'org.liquibase:liquibase-core:4.27.0' | ||
liquibaseRuntime 'info.picocli:picocli:4.7.5' | ||
liquibaseRuntime 'com.microsoft.sqlserver:mssql-jdbc:12.6.1.jre11' | ||
} | ||
|
||
tasks.named('test') { | ||
useJUnitPlatform() | ||
} | ||
|
||
jar { | ||
manifest { | ||
attributes( | ||
'Main-Class': 'gov.cdc.etldatapipeline.EtlDataPipelineApplication' | ||
) | ||
} | ||
zip64 true | ||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE | ||
|
||
// Gather all runtime dependencies | ||
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } } | ||
} | ||
|
||
apply plugin: "org.liquibase.gradle" | ||
|
||
ext { | ||
NBS_DB_VER = '15.1' | ||
} | ||
|
||
liquibase { | ||
activities { | ||
odse_main { | ||
changelogFile "./src/main/resources/db/changelog/db.master.changelog-${NBS_DB_VER}.yaml" | ||
url "jdbc:sqlserver://${System.env.DB_URL}:1433;databaseName=master;encrypt=true;trustServerCertificate=true" | ||
username "${System.env.DB_USERNAME}" | ||
password "${System.env.DB_PASSWORD}" | ||
} | ||
odse_main { | ||
changelogFile "./src/main/resources/db/changelog/db.odse.changelog-${NBS_DB_VER}.yaml" | ||
url "jdbc:sqlserver://${System.env.DB_URL}:1433;databaseName=${System.env.DB_ODSE};encrypt=true;trustServerCertificate=true" | ||
username "${System.env.DB_USERNAME}" | ||
password "${System.env.DB_PASSWORD}" | ||
} | ||
rdb_main { | ||
changelogFile "./src/main/resources/db/changelog/db.rdb.changelog-${NBS_DB_VER}.yaml" | ||
url "jdbc:sqlserver://${System.env.DB_URL}:1433;databaseName=${System.env.DB_RDB};encrypt=true;trustServerCertificate=true" | ||
username "${System.env.DB_USERNAME}" | ||
password "${System.env.DB_PASSWORD}" | ||
} | ||
} | ||
} | ||
|
||
sonarqube { | ||
properties { | ||
property "sonar.sourceEncoding", "UTF-8" | ||
property "sonar.projectKey", "CDCgov_NEDSS-DataAccess" | ||
property "sonar.organization", "cdcgov" | ||
property "sonar.host.url", "https://sonarcloud.io" | ||
property "sonar.coverage.jacoco.xmlReportPaths", "${rootDir}/investigation-service/build/customJacocoReportDir/test/jacocoTestReport.xml," + | ||
"${rootDir}/ldfdata-service/build/customJacocoReportDir/test/jacocoTestReport.xml,${rootDir}/observation-service/build/customJacocoReportDir/test/jacocoTestReport.xml,${rootDir}/person-service/build/customJacocoReportDir/test/jacocoTestReport.xml," + | ||
"${rootDir}/post-processing-service/build/customJacocoReportDir/test/jacocoTestReport.xml" | ||
} | ||
} |
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,48 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
BASE="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" | ||
|
||
#DA_PATH=$BASE/nedss-dataaccess/builder/ #Uncomment for copying from github repo | ||
|
||
# Clone NEDSSDev | ||
#rm -rf $DA_PATH | ||
#cp -r $HOME/'GitPrj/NEDSS-DataAccess/data-reporting-service/' $DA_PATH | ||
|
||
#VERSION=master | ||
#git clone -b $VERSION [email protected]:cdcent/NEDSS-DataAccess.git $DA_PATH | ||
|
||
# Build and deploy database containers | ||
echo "Building SQL Server database" | ||
docker-compose -f $BASE/docker-compose.yml up nbs-dataaccess-mssql --build -d | ||
|
||
# Build and deploy Zookeeper container | ||
echo "Building Zookeeper" | ||
docker-compose -f $BASE/docker-compose.yml up zookeeper --build -d | ||
|
||
# Build and deploy Kafka Broke container | ||
echo "Building Kafka Broker" | ||
docker-compose -f $BASE/docker-compose.yml up broker --build -d | ||
|
||
# Build and deploy ETL Data pipeline container | ||
echo "Building the Liquibase Service" | ||
docker-compose -f $BASE/docker-compose.yml up liquibase-service --build -d | ||
|
||
echo "Building Person Reporting Service" | ||
docker-compose -f $BASE/docker-compose.yml up person-reporting-service --build -d | ||
|
||
# Cleanup | ||
#rm -rf $DA_PATH | ||
|
||
echo "**** NEDSS DataAccess ETL Data Pipeline build complete ****" | ||
echo "Reporting Service Health Check" | ||
echo "http://localhost:8081/status" | ||
echo "" | ||
echo "Person Reporting Service Health Check" | ||
echo "http://localhost:8090/status" | ||
echo "" | ||
echo "Database: localhost:1433" | ||
echo "DB user: sa" | ||
echo "DB password: fake.fake.fake.1234" | ||
echo "Kafka: localhost:9092" | ||
echo "" |
Binary file not shown.
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,7 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip | ||
networkTimeout=10000 | ||
validateDistributionUrl=true | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.