Development of a simple CI/CD for the SimpleBashUtils project. Building, testing, deployment.
CI/CD is a set of principles and practices that enable more frequent and secure deployment of software changes.
Reasons for using CI/CD:
- Team development;
- Long software life cycle;
- Shortened release cycle;
- Difficulties in deployment and testing of large systems;
- Human factor.
CI/CD pipeline is a sequence of actions (scripts) for a particular version of the code in the repository, which is started automatically when changes are made.
CI (Continuous Integration) refers to the integration of individual pieces of application code with each other. CI normally performs two tasks as described below.
- BUILD:
- Checking if the code is being built at all;
- Prepare the artifacts for the next stages;
- TEST:
- Codestyle tests;
- Unit tests;
- Integration tests;
- Other tests you have;
- Test reports.
CD (Continuous Delivery) is a continuous integration extension, as it automatically deploys all code changes to the test and/or production environment after the build stage. CD can perform the following tasks.
- PUBLISH (If using a deployment docker):
- Build container images;
- Push the images to where they will be taken from for deployment;
- UPDATE CONFIGS:
- Update configuration on the machines;
- DEPLOY STAGING:
- Deployment of test environment for manual tests, QA, and other non-automated checks;
- Can be run manually or automatically if CI stages are passed successfully;
- DEPLOY PRODUCTION:
- Deploying a new version of the system on "production";
- This stage better be run manually rather than automatically;
- If you want, you can set it up for a specific branch of the repository only (master, release, etc.).
"There you go. If you have any questions, run what I said slowly through your head. I'll be right back."
As a result of the work you must save two dumps of the virtual machine images described below.
P.S. Do not upload dumps to git under any circumstances!
"Since you have decided to do CI/CD, you must really, really like testing. I love it too. So let's get started." If you need any information, I recommend looking for answers in the official documentation.
== Task ==
Be prepared to save a dump of the virtual machine image at the end of the project.
- You will need a URL and a token for runner registration, that can be obtained from the task page on the platform.
"The previous test was designed to boost people's self-confidence." Now I have readjusted the tests, making them more difficult and less flattering.
== Task ==
"Congratulations, you've accomplished a completely pointless task. Just kidding. It was necessary for moving on to all the following ones."
== Task ==
== Task ==
"To complete this task, you must move the executable files to another virtual machine, which will play the role of a production. Good luck."
== Task ==
Write a bash script which copies the files received after the building (artifacts) into the /usr/local/bin directory of the second virtual machine using ssh and scp.
Here the knowledge gained from the DO2_LinuxNetwork project can help you.
- Be prepared to explain from the script how the relocation occurs.
As a result, you should have applications from the C2_SimpleBashUtils (s21_cat and s21_grep) project ready to run on the second virtual machine.
P.S. Do not upload dumps to git under any circumstances!
- Don't forget to run the pipeline with the last commit in the repository.
"It says that your next task is for Nobel laureates specially. It does not say what they won the prize for, but certainly not for their ability to work with gitlab-runner."
== Task ==
Set up notifications of successful/unsuccessful pipeline execution via bot named "[your nickname] DO6 CI/CD" in Telegram.
- The text of the notification must contain information on the successful passing of both CI and CD stages.
- The rest of the notification text may be arbitrary.