I recently started working with Docker images that we build through our continuous integration pipe. Gitlab CI is an accessible and easy-to-use tool and we’ll see how to use it to deploy docker images on Rancher.
Category: DevOps Page 1 of 2
In this article, I will explain how I solved a large git repository clone issue we had during our continuous integration job.
The fact is that we have a Cordova project using multiple plugins. Most of these plugins are stored in git repositories and some of them or their dependencies are really large. This can slow our job execution or even make it fail (due to timeout) as it depends on our internet connection..
I decided to find a way to “cache” repository so the build jobs wouldn’t use internet connection each time they need to clone the plugin repository without changing plugins files.
The solution I found was to use our locally hosted gitlab as a mirror for the large repository and force git to use it using the git configuration “insteadOf”
I created a new repository in our gitlab to host the large plugin repository and I cloned it’s content from remote location once. I then added the following configuration for git inside the CI job runner machine:
git config --global url."<url of local gitlab mirror>".insteadOf "<url of primary repository>"
Working on a small package Atom lately, I started to configure Travis CI to automatically launch my builds and tests.This allows me to ensure that the future push and pull requests of my project do not break anything. As this is an opensource project, I can use Github free TravisCI services.
My repository is installed on Github and I started to activate webhook Travic CI in parameters. To do this, go to Settings> Webhooks & Services> Travic CI and activate this service by clicking edit button.
You must now set Travis CI. My Travis CI account is linked to my Github account so I can find the list of my repository and I chose the one that is concerned.
Finally, to start the work of travis, add a .travis.yml file in the root of the project. This file contains the information necessary for Travis and configuration for actions to run. Regarding the Atom packages, a repository has been deployed to easily set up Travis configurations. Just go to https://github.com/atom/ci/blob/master/.travis.yml and use it.
When I makes new push on the repository, Travis will now launch automatically builds and keep me informed in case of problems. To top it all, I can have the small button indicating the status of the repository.It can easily be integrated on a web page or on my project README
For Atom packages, it is also possible to use other services or as AppVeyor Circle. The details for these are also available on the directoryhttps://github.com/atom/ci/
Et voila, your turn now!