Skip to content
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

Java 21, Spring, code refactor and deploy as standalone container. #163

Merged
merged 224 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
224 commits
Select commit Hold shift + click to select a range
3f5ff7d
[ALS-5508] Dependabot dep bumps
Jan 18, 2024
0da626c
Label checker GH action
Aug 17, 2023
bac5e6d
Add deps to label checker + release config
Dec 19, 2023
4a4d1c2
Bump com.jayway.jsonpath:json-path in /pic-sure-auth-services
dependabot[bot] Jan 22, 2024
f58525c
[ALS-5612] Create stored procedure to create a user (#154)
Gcolon021 Feb 13, 2024
0ed9bf0
[ALS-5612] Updated stored procedure (#155)
Gcolon021 Feb 14, 2024
6403f7c
Start major refactor of PSAMA
Gcolon021 Mar 20, 2024
e2a49bb
WIP: Continuing to migrate to Java 21, Spring 6, and Tomcat
Gcolon021 Mar 25, 2024
aa8112e
WIP: Refactored UserController and UserMetadataMappingWebController
Gcolon021 Mar 26, 2024
5a8cc18
Refactor name of application.default.uuid in JSON and properties files
Gcolon021 Mar 26, 2024
fcc15f8
Update JWTFilter and remove unused imports
Gcolon021 Mar 26, 2024
cc440c1
Refactor code and add spring-boot-starter-mail dependency
Gcolon021 Mar 27, 2024
b6f8bb4
Remove BaseEntityService and improve user-specific behaviour
Gcolon021 Apr 5, 2024
3d85ebd
Update UserService and User entity classes
Gcolon021 Apr 8, 2024
aff802a
Update more dependencies to jakarta
Gcolon021 Apr 10, 2024
b612748
Add trace level logging to improve debugging
Gcolon021 Apr 10, 2024
dfce735
Refactor logging in JWTFilter
Gcolon021 Apr 10, 2024
a4dabcc
Refactor security configuration and improve authentication handling
Gcolon021 Apr 11, 2024
3450930
Update authorized request paths in SecurityConfig
Gcolon021 Apr 11, 2024
f666158
Remove test code
Gcolon021 Apr 11, 2024
d2ed5fc
Optimize log message formatting in AuthenticationService
Gcolon021 Apr 11, 2024
56339f0
Update dependency and refactor JWTUtil
Gcolon021 Apr 11, 2024
0387850
Update import statement in JsonUtils.java
Gcolon021 Apr 11, 2024
cb6ac1c
Update pom.xml version and dependencies
Gcolon021 Apr 11, 2024
23996d5
Update pom.xml version
Gcolon021 Apr 11, 2024
3dbd705
Move original dockerfile to bak
Gcolon021 Apr 11, 2024
60a588e
Create new Dockerfile for java 21 and tomcat
Gcolon021 Apr 11, 2024
25785c4
Update pom.xml to repackage application
Gcolon021 Apr 11, 2024
4129b21
Update application.properties to use environment variables
Gcolon021 Apr 11, 2024
1e75a38
Add Dockerfile and docker-compose for auth services for development
Gcolon021 Apr 11, 2024
ccd5c0f
Add AWS certificate to Dockerfile
Gcolon021 Apr 11, 2024
ab9f080
Update properties in application.properties file
Gcolon021 Apr 11, 2024
6aba8dc
Update Dockerfiles and dependencies in pom.xml
Gcolon021 Apr 11, 2024
d87d4a6
Remove commented out MySQL command
Gcolon021 Apr 11, 2024
2214d28
Update Dockerfiles for AWS certificate and clean-up
Gcolon021 Apr 16, 2024
bdaeef9
Update source code path in Dockerfile
Gcolon021 Apr 17, 2024
4ef49ce
Update AWS certificate path in Dockerfile
Gcolon021 Apr 17, 2024
7046b0c
Update AWS certificate path in Dockerfile
Gcolon021 Apr 17, 2024
49b45da
Update Dockerfile to correct jar file path
Gcolon021 Apr 17, 2024
45d2df0
Update MySQL connector dependency in pom.xml
Gcolon021 Apr 17, 2024
6c86cac
Update Hibernate dialect to MySQL5InnoDB
Gcolon021 Apr 18, 2024
defb036
Revert database dialect
Gcolon021 Apr 18, 2024
9439cf3
Update MySQL connector and dialect version
Gcolon021 Apr 18, 2024
b1f65e4
Update MySQL connector and dialect version
Gcolon021 Apr 18, 2024
3f2923a
Disable hibernate's default camelCase to snake_case conversion
Gcolon021 Apr 18, 2024
2fd473e
Add logging to getResponse for debugging
Gcolon021 Apr 19, 2024
75ad2d8
Make AUTH0_HOST have no default
Gcolon021 Apr 19, 2024
21e4507
Update methods to fetch connection by id
Gcolon021 Apr 19, 2024
15ea78d
Change connection ID type in auth services
Gcolon021 Apr 19, 2024
dfdaa45
Update JWT implementation and remove unused clientSecret parameter
Gcolon021 Apr 22, 2024
c3d7112
Add logging of client secret in JWTUtil
Gcolon021 Apr 22, 2024
3f955d6
Refactor JWT operations utilizing JWTUtil dependency injection
Gcolon021 Apr 22, 2024
aea0789
Update client secret setting and JWT encryption method
Gcolon021 Apr 22, 2024
d986cbe
Update handling of Terms of Service updates and acceptance
Gcolon021 Apr 22, 2024
9dc2cea
Update JWT encryption method
Gcolon021 Apr 22, 2024
7f7f780
Replace 'decryptWith' method with 'verifyWith'
Gcolon021 Apr 22, 2024
61cd536
Refactor UserService and TOSService, rename TermsOfServiceController,…
Gcolon021 Apr 22, 2024
ee82e90
Updated logging messages in TOS related services
Gcolon021 Apr 22, 2024
d234360
Improve JWT filter logging and response handling
Gcolon021 Apr 22, 2024
6dd72e8
Improve JWT filter logging and response handling
Gcolon021 Apr 22, 2024
14f9255
Implement Spring Security and change authentication flow
Gcolon021 Apr 23, 2024
1f80323
Update account status return values in CustomUserDetails
Gcolon021 Apr 23, 2024
e1f46ac
Add logging for user roles in JWTFilter
Gcolon021 Apr 23, 2024
01477fb
Add CustomUserDetails and update user authentication
Gcolon021 Apr 23, 2024
3c3fa92
Refactor security config and improve user authentication
Gcolon021 Apr 23, 2024
9c371bc
Refactor UserController and enhance security features
Gcolon021 Apr 23, 2024
4f1f5f9
Refactor UserController and SecurityConfig classes
Gcolon021 Apr 23, 2024
3bd1430
Disable pre-post method security
Gcolon021 Apr 23, 2024
542ff3e
Remove redundant SecurityContext initialization
Gcolon021 Apr 23, 2024
b718f82
Add UUID to User entity constructor
Gcolon021 Apr 23, 2024
de30656
Add logging for security context in UserService
Gcolon021 Apr 23, 2024
1d94c84
Add SecurityContext to handle authentication in JWTFilter
Gcolon021 Apr 23, 2024
9475d04
Update user service and application repository method
Gcolon021 Apr 23, 2024
5a8327a
Update application default UUID variable
Gcolon021 Apr 23, 2024
ec4fc5f
Refactor PrivilegeController route mapping
Gcolon021 Apr 23, 2024
8fbb1b1
Remove hasToken if null check
Gcolon021 Apr 23, 2024
8ba0b97
Update token authentication check in JWTFilter
Gcolon021 Apr 23, 2024
afe3945
Logging for debugging
Gcolon021 Apr 23, 2024
8b801b5
Remove authorities from CustomApplicationDetails
Gcolon021 Apr 23, 2024
dab551a
Add copy constructor to Application class
Gcolon021 Apr 23, 2024
a9f61a0
Add default constructor to Application.java
Gcolon021 Apr 23, 2024
8062ca9
Refactor @OneToMany relationship in Application.java
Gcolon021 Apr 24, 2024
935a5f2
Refactor Application entity and adjust application retrieval logic
Gcolon021 Apr 24, 2024
1756ffd
Revert changes to method
Gcolon021 Apr 24, 2024
b5ac9be
Refactor UserDetails subclasses for better encapsulation
Gcolon021 Apr 24, 2024
a6cd2e2
Add getUser method to CustomUserDetails
Gcolon021 Apr 24, 2024
f724fbb
Refactor JWTFilter for better user context management
Gcolon021 Apr 24, 2024
0eaf869
Update JWTFilter setting of security context
Gcolon021 Apr 24, 2024
1c11955
Refactor user retrieval in UserService
Gcolon021 Apr 24, 2024
1777906
Replace User with CustomUserDetails in UserService
Gcolon021 Apr 24, 2024
4cd929c
Optimize authentication setting in JWTFilter
Gcolon021 Apr 24, 2024
8d0d222
Add @RequestBody annotation to inputMap parameter
Gcolon021 Apr 24, 2024
fd3ccf9
Add logging for created authenticationToken object
Gcolon021 Apr 24, 2024
891171e
Refactor TokenController import statements and annotations
Gcolon021 Apr 24, 2024
77225b4
Update getPassword method and add getApplication method
Gcolon021 Apr 24, 2024
f06b6ff
Update fetch type and remove constructor in Application class
Gcolon021 Apr 24, 2024
1d60c0c
Add CustomUserDetailService and refactor user and app verification
Gcolon021 Apr 24, 2024
7e293ab
Refactor TokenService to use CustomApplicationDetails
Gcolon021 Apr 25, 2024
a77ed63
Add Hibernate initialization to prevent lazy loading exception
Gcolon021 Apr 25, 2024
890c3b2
Update method for retrieving application details
Gcolon021 Apr 25, 2024
9040d3c
Disable SQL and security logging in application properties
Gcolon021 Apr 25, 2024
b7dd794
Remove logging of client secrets
Gcolon021 Apr 25, 2024
cfe4574
Remove unused imports
Gcolon021 Apr 25, 2024
1b3d877
Refactor refreshUserToken method for clarity
Gcolon021 Apr 25, 2024
e4e0265
Update user authentication in UserService
Gcolon021 Apr 25, 2024
6cd9b56
Add @RequestBody annotation in addUser method
Gcolon021 Apr 25, 2024
237582a
Refactor UserService constructor and update user roles and connection…
Gcolon021 Apr 25, 2024
d4b869f
Add @RequestBody annotation to updateUser method
Gcolon021 Apr 25, 2024
8a2cdf2
Add logging to CustomUserDetailService
Gcolon021 Apr 25, 2024
a05dedc
Adding a jenkinsfile
TDeSain Apr 25, 2024
eb13a65
correct comments....
TDeSain Apr 25, 2024
aac2fe2
Update jenkinsfile
TDeSain Apr 25, 2024
b4c1200
Update jenkinsfile
TDeSain Apr 25, 2024
809d7e6
Update jenkinsfile
Gcolon021 Apr 25, 2024
a301ed8
Update jenkinsfile
TDeSain Apr 25, 2024
122389e
Update jenkinsfile
Gcolon021 Apr 25, 2024
b139c88
Update jenkinsfile
Gcolon021 Apr 25, 2024
cc0b095
Update jenkinsfile
Gcolon021 Apr 25, 2024
17ba946
Update jenkinsfile
Gcolon021 Apr 25, 2024
7211a41
Update jenkinsfile
Gcolon021 Apr 25, 2024
0dc2ea5
Update jenkinsfile
Gcolon021 Apr 25, 2024
4e3ad2c
Update jenkinsfile
Gcolon021 Apr 25, 2024
d61db76
Update jenkinsfile
Gcolon021 Apr 25, 2024
9716812
Add logging to debug
Gcolon021 Apr 25, 2024
7014a2a
Update jenkinsfile
Gcolon021 Apr 25, 2024
c96e944
Update jenkinsfile
Gcolon021 Apr 25, 2024
46f114d
Update jenkinsfile
Gcolon021 Apr 25, 2024
331b39b
Update jenkinsfile
Gcolon021 Apr 25, 2024
87802ec
Update jenkinsfile
Gcolon021 Apr 25, 2024
e445e29
Update jenkinsfile
Gcolon021 Apr 25, 2024
5ed01b4
Update jenkinsfile
Gcolon021 Apr 25, 2024
13a1e5f
Update jenkinsfile
Gcolon021 Apr 25, 2024
0e9f56f
Update jenkinsfile
Gcolon021 Apr 25, 2024
a0177d7
Update jenkinsfile
Gcolon021 Apr 25, 2024
8d3704b
Update jenkinsfile
Gcolon021 Apr 25, 2024
59d7784
Update logger to display user principal
Gcolon021 Apr 25, 2024
da364ef
Merge remote-tracking branch 'origin/feature/java-21' into feature/ja…
Gcolon021 Apr 25, 2024
f82397a
Update user saving method and enhance logger output
Gcolon021 Apr 26, 2024
b597764
Reduce PSAMA_OPTS memory allocation
Gcolon021 Apr 26, 2024
bcc650f
Add @RequestBody annotation in ApplicationController
Gcolon021 Apr 26, 2024
2995069
Update @PostMapping in ApplicationController
Gcolon021 Apr 26, 2024
5fe74e4
Remove redundant value attribute in PutMapping
Gcolon021 Apr 26, 2024
6ae58b1
Add @RequestBody annotation to updateApplication method
Gcolon021 Apr 26, 2024
c5699f8
Update method of setting privileges in ApplicationService
Gcolon021 Apr 26, 2024
dedb8b8
Add equals and hashCode methods to Application class
Gcolon021 Apr 27, 2024
e7aee6f
Rollback code
Gcolon021 Apr 27, 2024
83b0f0e
Update setPrivileges method in Application class
Gcolon021 Apr 27, 2024
f699343
Add @Transactional annotation to updateApplications method
Gcolon021 Apr 27, 2024
66a9c07
Remove @Transactional annotation in ApplicationService
Gcolon021 Apr 29, 2024
f862d76
Remove orphanRemoval attribute from OneToMany relationship
Gcolon021 Apr 29, 2024
3b0ab0a
Add @Transactional annotation to updateApplications method
Gcolon021 Apr 29, 2024
12b28d2
Refactor Annotation parameters in REST controllers
Gcolon021 Apr 29, 2024
9bb2d24
Remove unused dependencies from pom.xml
Gcolon021 Apr 29, 2024
5b0f662
Update GetMapping annotation in ConnectionWebController
Gcolon021 Apr 29, 2024
aa85b22
Remove redundant comment in ConnectionWebController
Gcolon021 Apr 29, 2024
2a0fe24
Add @RequestBody annotation to RoleController methods
Gcolon021 Apr 29, 2024
b5b8c86
Refactor TOSService to use constructor injection
Gcolon021 Apr 29, 2024
3346f63
Update annotation in AccessRuleController
Gcolon021 Apr 29, 2024
9895a12
Refactor role names in AuthNaming class
Gcolon021 Apr 29, 2024
534a1f1
Remove unnecessary Json exceptions in RestClientUtil
Gcolon021 Apr 29, 2024
ce0d92c
Refactor JWTUtil class to use final values
Gcolon021 Apr 29, 2024
8a45027
Remove unused imports in RestClientUtil.java
Gcolon021 Apr 29, 2024
58cb154
Remove equals and hashCode methods from Application class
Gcolon021 Apr 29, 2024
8dafc00
Remove unused backup files in auth services
Gcolon021 Apr 29, 2024
e124f5a
Revert
Gcolon021 Apr 29, 2024
24a2c9b
Removed 'development' scope in pom.xml
Gcolon021 Apr 30, 2024
35392be
Repair Unit Test
Gcolon021 May 1, 2024
2d9e145
Remove authentication test file
Gcolon021 May 2, 2024
af93ed9
Refactor code and add timeout configuration for requests
Gcolon021 May 2, 2024
9a1f868
Refactor RestClientUtil, remove unused methods and improve logging
Gcolon021 May 2, 2024
f2b1c23
Updated docker-compose.dev.yml and added auth-flyway service
Gcolon021 May 2, 2024
b52c82c
Add Maven dependencies pre-fetching in Dockerfile
Gcolon021 May 2, 2024
69f0af6
Refactor RoleController getRoleById
Gcolon021 May 2, 2024
b95978b
Update response handling in UserController and UserService
Gcolon021 May 2, 2024
a4b2556
Refactor response handling in various services and controllers
Gcolon021 May 3, 2024
36156d4
Add tests for AccessRuleService
Gcolon021 May 8, 2024
423e343
Remove catch block
Gcolon021 May 8, 2024
05a819f
Update setPrivileges method in Application class
Gcolon021 May 8, 2024
e591404
Update exception handling in refreshApplicationToken method
Gcolon021 May 8, 2024
e1b3ece
Add ApplicationService unit tests
Gcolon021 May 8, 2024
a51262f
Refactor RestClientUtil to component
Gcolon021 May 8, 2024
1a24a14
Refactor logging in BasicMailService
Gcolon021 May 8, 2024
610aa86
Inject RestClientUtil into FENCEAuthenticationService
Gcolon021 May 8, 2024
79801d3
Update AuthenticationService and refactor RestClient
Gcolon021 May 8, 2024
576c7c1
Add AuthenticationService test cases
Gcolon021 May 8, 2024
ea1ca4f
Add tests for ConnectionWebService
Gcolon021 May 8, 2024
d5dc053
Add CustomUserDetailService unit tests
Gcolon021 May 8, 2024
ef66fc7
Refactor Auth0MatchingServiceTest class location and minor cleanup
Gcolon021 May 8, 2024
d137006
Add setters for unit testing
Gcolon021 May 8, 2024
68bdeb2
Add TokenService unit tests
Gcolon021 May 9, 2024
9000a7d
Remove unnecessary if statement
Gcolon021 May 9, 2024
469b4bd
Update token handling and associated tests
Gcolon021 May 10, 2024
f622c95
Add additional token refresh tests and improve error handling
Gcolon021 May 13, 2024
4584485
Add UserServiceTest for auth service testing
Gcolon021 May 13, 2024
4bc6e53
Refactor UserService to handle absent roles
Gcolon021 May 13, 2024
19e9ec6
Add getRoleById method in RoleService
Gcolon021 May 13, 2024
16267b0
Update UserServiceTest with additional test methods
Gcolon021 May 13, 2024
eaa7c3a
Remove unused import in UserServiceTest
Gcolon021 May 13, 2024
f812fda
Update UserServiceTest with additional test methods
Gcolon021 May 14, 2024
b57048a
Add additional tests and modify CustomUserDetails class
Gcolon021 May 14, 2024
3bc777d
Add unit tests for Terms of Service (TOS) service
Gcolon021 May 14, 2024
8b0b411
Update BasicMailService with setters and implement tests
Gcolon021 May 14, 2024
131dd78
Remove unused Auth0Exception import
Gcolon021 May 14, 2024
89655a8
Add testing for UserMetadataMappingService and remove unnecessary import
Gcolon021 May 14, 2024
749f099
Remove commented-out code in UserServiceTest.java
Gcolon021 May 14, 2024
1610210
Update test to expect NullPointerException
Gcolon021 May 14, 2024
e0b85db
Add RoleService unit tests
Gcolon021 May 14, 2024
861584a
Add test cases for PrivilegeService
Gcolon021 May 14, 2024
6dde553
Add AuthorizationServiceTest and refactor AuthorizationService
Gcolon021 May 14, 2024
cab400e
Update AuthorizationService test methods
Gcolon021 May 14, 2024
8028f53
Remove unused test methods in AuthorizationServiceTest
Gcolon021 May 14, 2024
5337420
Removed unnecessary contains methods
Gcolon021 May 15, 2024
84690a0
Update pic-sure-auth-services/src/main/java/edu/harvard/hms/dbmi/avil…
Gcolon021 May 15, 2024
240c25b
Fixed missing character
Gcolon021 May 15, 2024
840cd02
Update null handling in OauthUserMatchingService
Gcolon021 May 15, 2024
35de2ff
Remove contains method
Gcolon021 May 15, 2024
9ea2091
I don't like ResponseEntity<?> (#171)
Luke-Sikina May 21, 2024
db16150
Change method name
Gcolon021 May 21, 2024
47ae043
Update role logging in JWTFilter
Gcolon021 May 21, 2024
dcda7a8
Remove unused import in JWTFilter.java
Gcolon021 May 21, 2024
27988f8
Refine return types in API responses
Gcolon021 May 21, 2024
04508e2
Add function to fetch roles by UUIDs in bulk
Gcolon021 May 21, 2024
7ae7667
Add logging for user privileges in JWTFilter
Gcolon021 May 29, 2024
722a8c6
Merge branch 'refs/heads/release' into feature/java-21
Gcolon021 Jun 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
version: '3.8'
services:
pic-sure-auth-service:
build:
context: .
dockerfile: ./pic-sure-auth-services/dev.Dockerfile
environment:
JAVA_OPTS: "-Xmx1024m -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005"
# Note: To use this you will need to set ENVIRONMENT variables for the application.properties
ports:
- "8090:8090" # Application port
- "5005:5005" # Debug port
depends_on:
auth-flyway:
condition: service_started

picsure-db:
build:
context: ./pic-sure-auth-db/
dockerfile: Dockerfile
environment:
MYSQL_DATABASE: auth
MYSQL_ROOT_PASSWORD: password
ports:
- "3306:3306" # MySQL port
command:
- --default-authentication-plugin=mysql_native_password # Required for MySQL 8.0
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
interval: 10s
timeout: 5s
retries: 5

auth-flyway:
image: flyway/flyway:latest
volumes:
- ./pic-sure-auth-db/db/sql:/flyway/sql
# linux/amd64
platform: linux/amd64
environment:
- FLYWAY_URL=jdbc:mysql://picsure-db:3306/auth?useSSL=false
- FLYWAY_USER=root
- FLYWAY_PASSWORD=password
- FLYWAY_SCHEMAS=auth
- FLYWAY_LOCATIONS=filesystem:/flyway/sql
- FLYWAY_IGNORE_MISSING_MIGRATIONS=true
- FLYWAY_BASELINE_ON_MIGRATE=true
command:
- migrate
depends_on:
picsure-db:
condition: service_healthy
45 changes: 45 additions & 0 deletions jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
pipeline {
agent any

parameters {
string(name: 'DOCKER_REGISTRY', description: 'Docker registry URL (e.g., ECR URL)', defaultValue: 'hms-dbmi')
string(name: 'REPOSITORY_NAME', description: 'Docker repository name', defaultValue: 'psama')
}

environment {
DOCKER_BUILD_ARGS = "-f ./pic-sure-auth-services/Dockerfile --build-arg http_proxy=$http_proxy --build-arg https_proxy=$http_proxy --build-arg no_proxy=\"$no_proxy\" --build-arg HTTP_PROXY=$http_proxy --build-arg HTTPS_PROXY=$http_proxy --build-arg NO_PROXY=\"$no_proxy\""
GIT_BRANCH_SHORT = sh(script: 'echo ${GIT_BRANCH} | cut -d "/" -f 2', returnStdout: true).trim()
GIT_COMMIT_SHORT = sh(script: 'echo ${GIT_COMMIT} | cut -c1-7', returnStdout: true).trim()
IMAGE_TAG = "${GIT_BRANCH_SHORT}_${GIT_COMMIT_SHORT}"
LATEST_TAG = "latest"
EMAIL_TEMPLATE_VOLUME="-v $DOCKER_CONFIG_DIR/wildfly/emailTemplates:/opt/jboss/wildfly/standalone/configuration/emailTemplates "
TRUSTSTORE_VOLUME="-v $DOCKER_CONFIG_DIR/wildfly/application.truststore:/opt/jboss/wildfly/standalone/configuration/application.truststore"
PSAMA_OPTS="-Xms1g -Xmx2g -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true"
TRUSTSTORE_JAVA_OPTS="-Djavax.net.ssl.trustStore=/opt/jboss/wildfly/standalone/configuration/application.truststore -Djavax.net.ssl.trustStorePassword=password"
}

stages {
stage('build') {
steps {
sh "docker build ${DOCKER_BUILD_ARGS} -t ${params.DOCKER_REGISTRY}/${params.REPOSITORY_NAME}:${IMAGE_TAG} ."
sh "docker tag ${params.DOCKER_REGISTRY}/${params.REPOSITORY_NAME}:${IMAGE_TAG} ${params.DOCKER_REGISTRY}/${params.REPOSITORY_NAME}:${LATEST_TAG}"
}
}
stage('deploy') {
steps {
script {
env.PROXY_OPTS = env.PROXY_OPTS == null ?: ''
}
sh "docker stop psama || true"
sh "docker rm psama || true"
sh """docker run --name=psama --restart always \
--network=picsure \
--env-file /usr/local/docker-config/psama/.env \
$EMAIL_TEMPLATE_VOLUME \
$TRUSTSTORE_VOLUME \
-e JAVA_OPTS="$PSAMA_OPTS $TRUSTSTORE_JAVA_OPTS" \
-d ${params.DOCKER_REGISTRY}/${params.REPOSITORY_NAME}:${IMAGE_TAG}"""
}
}
}
}
2 changes: 1 addition & 1 deletion pic-sure-auth-db/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mysql:5.7.24
FROM mysql:8.2.0

RUN mkdir /tempsql/
COPY db/picsure-auth-dump-initial.sql /tempsql/picsure-auth-dump-initial.sql
Expand Down
47 changes: 17 additions & 30 deletions pic-sure-auth-services/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,40 +1,27 @@
FROM jboss/wildfly:17.0.0.Final AS production
FROM maven:3.9.6-amazoncorretto-21 as build

# TODO: It'd be nice if wildfly used alpine -Andre
COPY ./pom.xml /app/pom.xml

LABEL maintainer="avillach_lab_developers@googlegroups.com"
RUN mvn -f /app/pom.xml dependency:go-offline

# mysql database
ENV AUTH_DB_CONNECTION_USER root
ENV AUTH_MYSQLADDRESS localhost
ENV AUTH_DB_PORT 3306
ENV AUTH_MYSQLPASS password
# Copy the source code into the container
COPY ./ /app

# JWT Token
ENV AUTH_CLIENT_SECRET secret
ENV AUTH_USER_ID_CLAIM sub
# Change the working directory
WORKDIR /app

# root required to create default scratch directory - Andre
USER root
# Build the jar
RUN mvn clean install -DskipTests

# Add certs for AWS to trust store
COPY aws_certs/certificate.der certificate.der
RUN keytool -noprompt -import -alias root_cert -keystore $JAVA_HOME/lib/security/cacerts -storepass changeit -file certificate.der
FROM amazoncorretto:21.0.1-alpine3.18

# copy modules
COPY target/modules/system/layers/base/com/sql/mysql/main/* /modules/
COPY src/main/resources/emailTemplates/accessEmail.mustache /usr/local/share/applications/
# Copy jar and access token from maven build
COPY --from=build /app/pic-sure-auth-services/target/pic-sure-auth-services.jar /pic-sure-auth-service.jar

# install modules
RUN wildfly/bin/jboss-cli.sh --command="module add --name=com.sql.mysql \
--resources=/modules/mysql-connector-java-5.1.38.jar --dependencies=javax.api"
# Copy the AWS certificate
COPY pic-sure-auth-services/aws_certs/certificate.der /certificate.der

# Copy standalone.xml
COPY src/main/resources/wildfly-configuration/standalone.xml wildfly/standalone/configuration/
# Import the certificate into the Java trust store
RUN keytool -noprompt -import -alias aws_cert -keystore $JAVA_HOME/lib/security/cacerts -storepass changeit -file /certificate.der

# Copy war file
COPY target/pic-sure-auth-services.war wildfly/standalone/deployments/pic-sure-auth-services.war

#USER jboss

ENTRYPOINT ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0"]
ENTRYPOINT ["sh", "-c", "java ${JAVA_OPTS} -jar /pic-sure-auth-service.jar"]
20 changes: 20 additions & 0 deletions pic-sure-auth-services/dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM maven:3.9.6-amazoncorretto-21 as build

# Copy the source code into the container
COPY ../ /app

# Change the working directory
WORKDIR /app

# Build the jar
RUN mvn clean install -DskipTests

FROM amazoncorretto:21.0.1-alpine3.18

# Copy jar and access token from maven build
#COPY target/pic-sure-auth-services.jar /pic-sure-auth-service.jar
COPY --from=build /app/pic-sure-auth-services/target/pic-sure-auth-services.jar /pic-sure-auth-service.jar

EXPOSE 8090

ENTRYPOINT ["sh", "-c", "java ${JAVA_OPTS} -jar /pic-sure-auth-service.jar"]
Loading
Loading