filmov
tv
How to query Postgres database from Jenkins pipeline

Показать описание
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
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
Комментарии