Hi everyone, I would like to ask you a few questions (hoping I'm not totally off the mark).
We have a little "CICD" and I have to improve it. I'm a junior so I'm a little bit confused with some informations I've found.
Indeed, we have a simple system : git, test servers and a production server.
We have configured pipelines in order to be able to launch our unit tests and then trigger the delivery of the files to the server concerned (the delivery in production is totally manual for the moment).
During the merge in the branch corresponding to the concerned server, the steps are the following:
- the unit tests are launched as this :
- once this step is over, a bash script is called
- this bash script allows to update the git repository and the dependencies (npm and composer in particular). So this command is launched :
My questions are :
Is it possible to do these steps without having the .git file on the concerned server ?
Is it recommended or not to use git in a CICD ?
Is it possible to run unit tests without installing php unit (via composer) ?
Thanks for your time :)
1. Git uses the .git folder to manage the containing folder as a git repository. This folder is used to mark the folder as managed by git and to hold all metadata relevant to the repo: HEAD commit hash, branches' hashes, etc'. The .git folder is created usually upon `git init` (creating new repo locally) or `git clone` (cloning a repo from a remote server). To answer your question, if you don't have the .git folder locally, it means you have to clone the repo you wish to build. If you do have the .git folder, it usually means that you just need to pull the latest changes and checkout the relevant branch for the build. The latter is usually faster (no need to clone the repo), and the first option is a bit more stable as you don't relay nor affected by current state of the build directory.
2. It depends on your requirements from the CICD and your preferred methodology. Many teams generate the version during the build and then commit & push it back into the repository. Some teams/organizations object using git directly during the build as it allows developers to commit & push code w/o going through pull request.
3. If installing php-unit has to be via composer - I don't know. However, the php-unit is a dependency, and as such, you can either fetch & install it during build time or run your builds on servers/containers which already include this dependency.
Hi @Erez Maadani thank you so much for your answers :)
I will work on it !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.