The key is not about choosing the perfect tool. Pick a suitable tool - It doesn’t have to be perfect Jenkins offers a configurable user interface which is convenient for non-developers such as QA to execute certain tasks like deployments and integration tests. But extra effort on integrating Jenkins with version control is needed and as I mentioned before.Īlthough i prefer using GitLab CI, it doesn’t mean it could completely replace Jenkins. Actually Jenkins also has a pipeline plugin and it could work with Docker to serve exactly the same purpose. By using Docker, the developer can reference dependencies available on Docker Hub without asking the server admin to setup such dependencies on the server each time. In the past when using a tool such as Jenkins, I’d have to make sure that all of these are installed on the server. The stage output The benefits of using GitLab CI with Dockerĭifferent projects may require different dependencies such as Node.js, Ant, Maven. The pipeline history View the stage in detailĬlick on a specific pipeline and you can read the console output of each stage. Just make some changes on the master branch and you can find the pipeline running on the CI / CD -> Pipeline page. And if the script execution fails, the stage will be classified as failed. The attributes of before_script and script can have multiple values (array in. Let’s take a deeper look in the stage definition. Furthermore, this image attribute could be defined within the stage definition so that you could use different tool for each stage. But in GitLab CI, we only need to mention which Docker image is needed.
Anyone could run the task locally as long as the have Node.js installed. Each stage is just a gulp task defined in gulpfile.js.
In the above YAML configuration file we defined 3 stages. To play along, fork this repository and check it out.
In this example, we have a simple Node.js project and we would like to make sure the code is good by linting and running a unit test. gitlab-ci.yml to define the project configuration, which includes a definition of all the stages that need to be run after a CI/CD pipeline is triggered in response to a git push/merge. Let’s take a look at the following example. GitLab CI also allows you to setup continuous integration utilizing any Docker image available on Docker Hub. is a SAAS based service where you can host your Git repository, track issues and write the wiki in markdown.
So it would be great if there were a single platform which could fulfil all these requires and that is why we’ve chosen GitLab. Moreover, the workflow would be broken if any one of the services in the chain go down. Usually, most tools already provide out of the box integration with other common services but it is still difficult to configure them at times. For example, we may want a git commit hook up with existing issues, or trigger an automated test after pushing commits to the master branch. But to improve the efficiency and quality of our project, we need to bring all these tools together. Tools like Jenkins are good for continuous integration and delivery. In this tutorial, I’ll be showing you a quick and easy way to set up continuous integration for your environment using GitLab and Docker. In the past you may have tried different tools to manage the deployment of your applications effectively.
By Ying Kit Yuen How to setup CI on GitLab using DockerĪn example using Docker to test and build your pipeline