Hi All, in this video we will see that how can we use "Services" keyword in .gitlab-ci.yml file or config.toml file. The usage of "Services" keyword is to provide network accessible services.
Common use cases of network accessible services are connection to the database services i.e. mysql, postgresql, redis etc.
We will also see that how can we get the required details from the primary image container to connect with secondary/services image container. This will be the image that we have mentioned in "image" keyword.
In this video, I am using python as my primary image and mysql as my secondary image or services image.
To get the required details from an image container the ways are as follows,
We need to execute the commands from primary image container. In my case I need to execute it from the container running python image.
1. To write "env" command in the terminal which will provide us all the environment variables with their corresponding values, or we can use /etc/hosts details as well to get the details.
2. Use of environmental variable name itself.
We also need to make sure that whichever image we have provided in "Services" keyword we provide some of the default values that the image container will require to work properly else we will get an error while CI-CD pipeline running.
Following are the links that I have used to create the ppt.
https://docs.gitlab.com/ee/ci/services/
https://docs.gitlab.com/runner/config...
Please use below link to get the files that I have used in this session.
https://gitlab.com/Nayan.1989/youtube...