12.1 Making Changes to the Code
As I mentioned earlier, all modern development is about making small changes to the code. Millions of programmers have been doing this for decades, so the process is well-established, standardized, and formalized in every possible way.
First off, there's a special program for storing code — Git. Git is a distributed version control system used to track changes in code and coordinate work among programmers on joint projects.
Git lets developers create branches in the project, keeping a complete history of changes and the ability to revert to any file state. This ensures effective merging of changes and resolving conflicts, making Git a key tool for collaborative work on code in modern software development.
Secondly, the process of making changes to the code is also standardized. Usually, for each new feature, you create a new branch in git, make your changes in a series of commits, and then send a Pull Request to your tech lead or teammate to conduct a Code Review and approve your changes.
If everything goes well, your changes get merged into the dev branch, an automatic project build is triggered, and tests. Lots of tests.
12.2 Building the Project
Before testing or uploading the project to the server, you need to build it.
Project building is the process of compiling the source code of a project into executable programs or other runnable formats, often including testing and deployment. It's a key aspect of software development that ensures the program is ready for use.
Building isn't just compilation, though compilation is often part of the build process. After the build is complete, you might have dozens or even hundreds of files to upload to various servers.
Builders can be low-level:
Maven and Gradle are widely used in Java projects for dependency management and project building.
Apache Ant is another tool for building Java projects, offering great flexibility in writing build scripts.
MSBuild is used for building projects created with Microsoft Visual Studio.
Make is a classic build tool that uses a Makefile to define build rules, especially popular in C and C++ projects.
Webpack is often used for building JavaScript applications, managing dependencies and modules.
Gulp and Grunt are tools that help automate frequently performed tasks in web application development, like file minification and compiling SCSS to CSS.
Builders can also be high-level. More on them below.
12.3 CI/CD
CI/CD (Continuous Integration/Continuous Delivery) is a methodology that involves continuous merging of changes from all development branches into the main branch, followed by automatic testing and deployment of these changes. This helps quickly identify and fix errors, boosting development efficiency and speed.
One of the most common, albeit somewhat outdated, CI/CD systems is Jenkins. If you're working in a small company, there's an 80% chance they'll use it.
Jenkins is a popular automation system used for continuous integration and delivery (CI/CD). Jenkins automates various stages of software development, including building, testing, and deployment, improving code quality and speeding up the development process.
If you end up in a large company, there might be five more options to choose from:
TeamCity is a powerful commercial system from JetBrains, offering deep integration with various development and testing environments.
GitLab CI is a built-in part of GitLab, providing continuous integration and delivery with configuration via YAML files.
CircleCI is a cloud-based CI/CD service, supporting automation of testing and deployment for a variety of projects.
Travis CI is one of the first cloud CI services, used in many open projects, with seamless integration with GitHub.
Bamboo is a product from Atlassian, closely integrating with other tools from the company, like Jira and Bitbucket.
You don't need to know and work with them: usually, a company has a DevOps specialist who sets up all these build processes. You just need to know they exist and understand the conversation when Jenkins, CI/CD, or "continuous integration" is mentioned.
12.4 Delivering the Project to the Server
It's not enough to write the project, it also needs to be on your server. Deploying a project on a server is the process of placing and activating a web application on a server so that it's accessible to users over the internet.
This involves transferring project files to the server, configuring the server environment, databases, dependencies, and setting up network and security configurations.
How do you think your code gets on the server? Does someone upload it there? Or maybe you connect via SSH to the remote server, upload a couple of files, and set everything up? Relax: no one does that anymore. Now there's Docker.
Docker is a platform for developing, shipping, and running applications using containerization. Docker simplifies creating, deploying, and running applications by using containers, which package an application with its entire environment and dependencies into one compact object, ensuring consistency across all stages of development, testing, and production.
Docker allows you to package your project(s) into a Docker container. It's like a virtual machine, only very lightweight.
And although in any Docker forum, if you call it a virtual machine, you'll get flak, if you know what a virtual machine is, you can think of a Docker container as a virtual machine. Just very lightweight.
Essentially, a Docker container is a virtual "virtual machine". Virtual machines include a full copy of the OS, OS kernel, and virtual hardware, whereas Docker containers share the host's kernel and can be lighter and faster.
Plus, deploying a project with Docker greatly simplifies the deployment process, ensuring speed and reliability. The project is packaged into Docker containers, which can be easily moved and run on any system that supports Docker.
This eliminates issues related to server environment differences and allows for easy scaling of the application by adding or removing containers according to the load. Everyone's switched to Docker — it's super convenient and straightforward.
GO TO FULL VERSION