-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/make repo generic #7
Merged
Merged
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
0b29d09
converting repo to generic lambda repo, added metrics lambda
sb-keane 4f3df9e
added missed files
sb-keane 1ecb5b4
fixed build script typo
sb-keane b64e51e
publish all branches
sb-keane 31f1e8b
missing function
sb-keane 43fd236
updated build command
sb-keane 364cfff
added group, fixed building sub projects, added /build dirs to gitignore
sb-keane 553beba
updated depend vesions to match dependabot
sb-keane 1c5fa00
updated more depend vesions to match dependabot
sb-keane File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.idea | ||
.gradle | ||
build/* | ||
build/* | ||
*/build/* |
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,96 @@ | ||
pipeline { | ||
environment { | ||
ARTIFACTORY_URL = credentials('ARTIFACTORY_URL') | ||
} | ||
|
||
agent { | ||
label 'build' | ||
} | ||
|
||
tools { | ||
gradle "gradle-7.2" | ||
jdk 'adoptjdk13' | ||
} | ||
|
||
stages { | ||
|
||
stage ('Build Lambdas') { | ||
steps { | ||
withCredentials([usernamePassword(credentialsId: 'artifactoryuserpass', usernameVariable: 'ARTIFACTORY_USER', passwordVariable: 'ARTIFACTORY_PASSWORD')]) { | ||
sh './gradlew -b build.gradle ' | ||
} | ||
} | ||
} | ||
stage ('Test Lambdas') { | ||
steps { | ||
withCredentials([usernamePassword(credentialsId: 'artifactoryuserpass', usernameVariable: 'ARTIFACTORY_USER', passwordVariable: 'ARTIFACTORY_PASSWORD')]) { | ||
sh './gradlew clean test --info -b build.gradle' | ||
} | ||
} | ||
} | ||
|
||
stage ('Build Jars') { | ||
steps { | ||
withCredentials([usernamePassword(credentialsId: 'artifactoryuserpass', usernameVariable: 'ARTIFACTORY_USER', passwordVariable: 'ARTIFACTORY_PASSWORD')]) { | ||
sh './gradlew buildZip --info -b build.gradle' | ||
} | ||
} | ||
} | ||
// stage('SonarQube Analysis') { | ||
// steps { | ||
// withCredentials([usernamePassword(credentialsId: 'artifactoryuserpass', usernameVariable: 'ARTIFACTORY_USER', passwordVariable: 'ARTIFACTORY_PASSWORD')]) { | ||
// // Automatically saves the an id for the SonarQube build | ||
// withSonarQubeEnv('CMSSonar') { | ||
// sh './gradlew sonarqube -Dsonar.projectKey=ab2d-lambdas-project -Dsonar.host.url=https://sonarqube.cloud.cms.gov' | ||
// } | ||
// } | ||
// } | ||
//} | ||
// stage("Quality Gate") { | ||
// options { | ||
// timeout(time: 10, unit: 'MINUTES') | ||
// } | ||
// steps { | ||
// Parameter indicates whether to set pipeline to UNSTABLE if Quality Gate fails | ||
// true = set pipeline to UNSTABLE, false = don't | ||
// waitForQualityGate abortPipeline: true | ||
// } | ||
// }*/ | ||
|
||
stage ('Publish Lambdas') { | ||
//when { | ||
// branch 'main' | ||
// } | ||
steps { | ||
withCredentials([usernamePassword(credentialsId: 'artifactoryuserpass', usernameVariable: 'ARTIFACTORY_USER', passwordVariable: 'ARTIFACTORY_PASSWORD')]) { | ||
script { | ||
def deployScript = ''; | ||
|
||
//Calls a gradle task to check if the version of each build has already been deployed | ||
//Each build is broken up by '''. | ||
def versionPublishedList = sh( | ||
script: './gradlew -q lookForArtifacts', | ||
returnStdout: true | ||
).trim().split("'''") | ||
|
||
//First value represents the build name and the second value is if the version is already deployed. | ||
for (int i = 1; i < versionPublishedList.size(); i++) { | ||
def artifactoryInfo = versionPublishedList[i].split(":") | ||
if (artifactoryInfo[1] == 'false') { | ||
echo "Deploying ${artifactoryInfo[0]}" | ||
deployScript += "${artifactoryInfo[0]}:artifactoryPublish " | ||
} | ||
} | ||
|
||
//deployScript represents what we are publishing. Insert it into the gradle command to do the publishing. | ||
//ex. ab2d-fhir:artifactoryPublish" | ||
//If nothing is there, skip publishing | ||
if(deployScript != '') { | ||
sh "./gradlew ${deployScript} -b build.gradle" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
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,67 @@ | ||
plugins { | ||
id 'java' | ||
} | ||
|
||
configurations { | ||
all.collect { configuration -> | ||
configuration.exclude group: 'org.springframework.boot' | ||
configuration.exclude group: 'com.slack.api' | ||
configuration.exclude group: 'org.jetbrains.kotlin' | ||
configuration.exclude group: 'org.postgresql' | ||
configuration.exclude group: 'com.squareup.okhttp3' | ||
configuration.exclude group: 'commons-codec' | ||
configuration.exclude group: 'com.squareup.okio' | ||
configuration.exclude group: 'org.springframework.cloud' | ||
configuration.exclude group: 'org.mock-server' | ||
configuration.exclude group: 'software.amazon.awssdk:netty-nio-client' | ||
configuration.exclude group: 'io.netty' | ||
configuration.exclude group: 'org.testcontainers:testcontainers' | ||
// Lombok is amazing but its jar is 2 MBs which is 20% of the total fat jar. | ||
// Even when set as compile and annotationProcessor only gradle still adds it to the fat jar | ||
|
||
} | ||
|
||
} | ||
|
||
version "$fetcherVersion" | ||
|
||
dependencies { | ||
compileOnly 'org.projectlombok:lombok:1.18.24' | ||
implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' | ||
implementation 'com.amazonaws:aws-lambda-java-events:3.11.0' | ||
implementation 'org.springframework:spring-context:5.3.20' | ||
implementation 'com.newrelic.agent.java:newrelic-api:7.6.0' | ||
implementation 'ca.uhn.hapi.fhir:hapi-fhir-structures-dstu3:5.7.2' | ||
implementation 'ca.uhn.hapi.fhir:hapi-fhir-structures-r4:5.7.2' | ||
implementation 'gov.cms.ab2d:ab2d-aggregator:1.2.1' | ||
implementation 'gov.cms.ab2d:ab2d-bfd:1.3.1' | ||
implementation 'gov.cms.ab2d:ab2d-events-client:1.3.1' | ||
implementation 'gov.cms.ab2d:ab2d-fhir:1.1.1' | ||
implementation 'gov.cms.ab2d:ab2d-filters:1.6.1' | ||
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.13.3' | ||
annotationProcessor "org.projectlombok:lombok:1.18.24" | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
} | ||
|
||
task buildZip(type: Zip) { | ||
from compileJava | ||
from processResources | ||
into('lib') { | ||
from configurations.runtimeClasspath | ||
} | ||
archiveFileName = 'eob-fetcher.zip' | ||
} | ||
|
||
task wrapper(type: Wrapper){ | ||
gradleVersion = '7.5' | ||
} | ||
|
||
java { | ||
sourceCompatibility = JavaVersion.VERSION_11 | ||
targetCompatibility = JavaVersion.VERSION_11 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does AWS support 17 yet? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not yet. It's been requested for almost a year aws/aws-lambda-base-images#29 |
||
} | ||
|
||
build.dependsOn buildZip |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Empty file.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dependabot - change this to 7.10.0