How to query Postgres database from Jenkins pipeline

Опубликовано: 08 Август 2023
на канале: 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


Смотрите видео How to query Postgres database from Jenkins pipeline онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Toolio 08 Август 2023, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 1,322 раз и оно понравилось 12 людям.