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.
- Creating a Bootstrap directory /var/opt/jfrog/artifactory/bootstrap/artifactory/tomcat/lib/
- Downloading the updated PostgreSQL driver (in my case postgresql-42.7.2.jar)
- 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