How to query Postgres database from Jenkins pipeline

Published: 08 August 2023
on channel: Toolio
1,322
12

This video explains the steps of integration between postgresql and jenkins to query data from postgres database from jenkins pipeline.
Step 1 is to download and Install the postgres psql client on windows. Once it's installed, just add the client path in system path variable
Step 2 is to create a .pgpass file on the Jenkins agent under user home directory that should contain the .jenkins folder
Step 3 is to create the jenkins credentials to refer the password in a most secure way.
Step 4 is to create jenkins pipeline to execute the psql commands. Here you need to add the PGPASSFILE environment variable to the jenkins pipeline under Environment declarative and provide the path of the .pgpass file and that's it. now you can run the jenkins job and it would execute the query on your postgres database if you have already implemented the access between your jenkins agent and postgres database


Watch video How to query Postgres database from Jenkins pipeline online, duration hours minute second in high quality that is uploaded to the channel Toolio 08 August 2023. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 1,322 times and liked it 12 visitors.