Our team is composed of:
- CLAVIER Eliott
- PIGNON Nathan
- MATHÉ Clément
- RIPAULT Paul
- MARTIN Maxime
This project aims to create an agile DevOps environment, allowing a team of developers to practice Agile development processes, and continuous product delivery.
To do this, we set up a Gitlab environment to manage the code, and provide a runner to execute the different pipelines. With its release system, developers can trigger the deployment of their applications from the Gitlab interface.
The deployment can be configured on different environments, but for this project we configured virtual machines using Vagrant. One of them embeds a Gitlab runner, allowing to execute the deployment on the other machines in local environment.
Ansible playbooks will then be executed from this deployment virtual machine, to install the necessary services, and then when a deployment is triggered, to retrieve the build artifacts from our Nexus server (http://nexus.epitech-projects.me:8081/) to make the applications available.
With this project, we ensure an Agile product development cycle, for the team of developers for whom it is intended.
Before you start, you will need to have the following installed on your computer:
- A computer running Windows, macOS, or Linux
- VirtualBox, a free and open-source virtualization software
- Vagrant, a tool for building and managing virtual machine environments
-
Download and install VirtualBox from the VirtualBox website.
-
Download and install Vagrant from the Vagrant website.
The names and IP addresses of the virtual machines are defined in a vagrant/config.yml file. You must create it. To do this :
- In "vagrant" folder, use
example.config.ymltemplate to create aconfig.ymlfile - Open the file and complete the IP addresses of the virtual machines.
- Indicate true to the
main_vmparms to get a Vm with Ansible on it ( in the template, the VM called "terminal" has this option to true) - Indicate the url of the gitlab server
- Indicate the
runner_register_token.
You must define a password in root_pass.txt. To do this :
- In /ansible, use the
example.vault_pass.txttemplate to create file to create avault_pass.txtfile - Write a password of your choice inside the file
You must define parms in vault.yml To do this :
- In /ansible, use the
example.vault.ymltemplate file to create avault.ymlfile. - Define a configuration. (refer to comments in it or keys name)
-
Navigate to the directory that contains your Vagrantfile in the terminal.
-
Start the virtual machine by running the following command:
vagrant up
This command will run all virtual machine.
-
For a specific vitrual machine, use :
vagrant up <vm_name>
These command will use the configuration specified in your Vagrantfile to start the virtual machine.
-
Log into the virtual machine by running the following command:
vagrant ssh <vm_name>
Replace <vm_name> with the name of the virtual machine that you have specified in the config.yaml file. This will open a secure shell connection to the virtual machine.
-
Run the "terminal" vm or a vm with main_vm to true
-
After the virtual machine (VM) supporting the Gitlab deployment runner is executed, run the following command in the terminal:
ansible-playbook -i /etc/ansible/inventories/local/hosts /etc/ansible/playbooks/setup.yml
The local environnement is now set up
This guide is designed for developers who need to use the Gitlab server (https://gitlab.epitech-projects.me) for their projects. The server has been configured with a few necessary steps to follow in order to register and deploy your applications.
- Create an account on the Gitlab server using an email address ending in @epitech.eu.
- Select your role as a developer.
- Wait for an admin to whitelist your account.
- Push your code to one of the repositories on the Gitlab server. This will trigger the CI pipelines to run and build your application as well as perform unit tests.
- To deploy your application, create a release based on a tag named following the expression
/^d+\.\d+\.\d+/(like "4.2.3"). The CD jobs in the pipeline will then send the build artifacts to the Nexus server (nexus.epitech-projects.me). - The Ansible playbook will retrieve the artifacts and deploy the application to the configured hosts.
To revert to a previous version, manually trigger the last job in the release pipeline.
To revert to a specific version, manually remove the release of the desired target version. Then, create a branch from the code present in the desired tag, then make a release from this branch.
This guide has provided a comprehensive explanation of the steps necessary to register and deploy your application on the Gitlab server. If you have any questions or issues, please reach out to the admin team for support.