ARTIFACTORY: How to update Database Driver in Helm installation

ARTIFACTORY: How to update Database Driver in Helm installation

AuthorFullName__c
Prakriti Vishwakarma
articleNumber
000006085
ft:sourceType
Salesforce
FirstPublishedDate
2024-05-01T09:09:49Z
lastModifiedDate
2024-05-01
VersionNumber
1

Artifactory comes with the default Database drivers for PostgreSQL. If you would like to upgrade the Database JDBC drivers, you may add the below preStartCommand value in the value.yaml file. 

artifactory:
    preStartCommand: "mkdir -p /var/opt/jfrog/artifactory/bootstrap/artifactory/tomcat/lib/; curl -o /var/opt/jfrog/artifactory/bootstrap/artifactory/tomcat/lib/postgresql-42.7.2.jar https://jdbc.postgresql.org/download/postgresql-42.7.2.jar; rm -rf /opt/jfrog/artifactory/app/artifactory/tomcat/lib/postgresql-42.4.3.jar"

The preStartCommand will do the following steps during the initialisation of Artifactory.
  1. Creating a Bootstrap directory /var/opt/jfrog/artifactory/bootstrap/artifactory/tomcat/lib/
  2. Downloading the updated PostgreSQL driver (in my case postgresql-42.7.2.jar)
  3. Removing the existing PostgreSQL driver /opt/jfrog/artifactory/app/artifactory/tomcat/lib/postgresql-42.4.3.jar

After adding the above snippet, redeploy the Artifactory using Helm Update command
helm upgrade artifactory -n testns -f values.yaml jfrog/artifactory

Upon redeploying the Artifactory, you may see the following drivers get updated in the /opt/jfrog/artifactory/app/artifactory/tomcat/lib/ directory -
bash-5.1$ cd /opt/jfrog/artifactory/app/artifactory/tomcat/lib/

bash-5.1$ ls
annotations-api.jar  catalina.jar  derby-10.14.2.0.jar    jaspic-api.jar    jf_postgresql-42.7.2.jar  jfrog-tomcat-lib.jar    servlet-api.jar  tomcat-api.jar  tomcat-coyote.jar  tomcat-jni.jar  tomcat-util-scan.jar  tomcat-util.jar