Continuous Integration Continuous Deployment (CI/CD). It automatically downloads a project from the repository, carries out a given procedure and deploys the obtained results to the remote server.
Why do you need such a system? The answer is simple: it provides partial automation of work for developers, designers and testers, transfer the execution on the remote server, order the project construction process and facilitates control.
A decision has been made to redesign a company’s site. The designer and the tester had to view the work results on staging version of the site. Every time a change has been made they had to manually form and deploy the solution from their PC thus wasting their time. To solve this problem two configurations in the TeamCity have been built – Staging and Production.
Staging starts the process of building and deploying the solution on staging service after each update of dev branch in the site repository. Production starts the process of building and deploying the solution on main service after each update of master branch in the site repository.
The Staging configuration is activated by the change of dev branch, it builds a solution and deploys it on the staging service. Having tested and analyzed the results, the senior developer merges the dev branch with master branch, then the Production configuration builds the solution and deploys it on the main service.
Therefore the designer doesn’t need to gain insight into specifics of site deployment, the tester can write automatized acceptance tests and integrate them into Staging configuration, receiving reports on testing after each commit, and the senior developer can easily control the process. I have chosen the TeamCity as an example of such system since it is very flexible, has thorough documentation and a big community.
Lets do an arranging a workstation for TeamCity. For a start we need to create a virtual machine, on which we install the server controlling the system operation and an agent, which carries out assembly and deployment. If we plan to create many projects and carry out assemblies frequently, it would be wise to leave only server functions and take out assembly agents onto other VMs, but if assemblies are planned to be occasional, both the agent and the server can be allocated on one VM.
At the beginning a machine of A1 size with Windows Server 2012 R2 Datacenter is enough. Later on we can extend the VM size up to the required extent.
We should add two disks to the VM to store the database and assembly artifacts.
In order to simplify further adding of new VMs with supplementary agents, it is necessary to create a virtual network.
Then we need to create rules for access to ports 80 (for deployment) and 6600 (for access to TeamCity server).
It is necessary to connect disks to the system, marking them, for example, with letter T: where we will store TeamCity data and M: for DB data. For the effective work of the server we need to create a database. To do so we need to install MySQL, directories for the data and logs should be allocated on disk M. for the proper work it is necessary to install also the Java connector.
We create a DB named TeamCity. MySQL -u root -p [password] create database TeamCity; Then we should install the latest Java version and add the route to .exe files into the environment variable PATH.
Lets do an Installation and setup of TeamCity. The path for TeamCity installation should be ”C:\TeamCity\”. Then you should install the components of the server and the agent onto VM. After the installation, you will be offered to choose port for the TeamCity server – chose port 6600. In the agent configuration window specify server Url http://localhost:6060 and the agent’s own port, paths to work and temporary directories (it’s better to allocate them on disk T).
Then you should indicate that the server and the agent will be applied from the system account. Then a browser will open for further server setup. Here you should specify the directory where server data will be stored (disk T). Then choose the database and allocate here the Java connector that was installed earlier in “C:\TeamCity\bin\TeamCity\lib\jdbc” directory and choose TeamCity database that was created earlier.
Software is a great combination between artistry and engineering.Bill Gates
Then it is necessary to create administrator user account and the server setup is finished. Important! On every machine where you plan to setup the server or agent install all the required functions, for example, for .NET you can install Visual Studio Community Edition.
Installation and setup of additional TeamCity assembly agents. If one assembly agent is not enough, you can connect additional assembly agents to the server, which are located on other VMs. For that you need to create a VM in the same virtual network where the server is located. The new VM configuration should be the same as on the server but there is no need for a DB disk. Create rules for access to the corresponding agent port 9090 (9091, 9092, …). Install only the agent’s part.
Then you need to finish the agent configuration, specifying the server IP address, the work directory and the directory for storage of temporary files as was shown for agent settings in the previous section.
On every machine where you plan to setup the server or agent, install all the required functions, for example, for .NET you can install Visual Studio Community Edition. For conclusion. TeamCity enables automation of routine manual operations thus saving time for all participants of software creation process. By creating different configurations, you can strictly separate actual (e.g. master branch) and test (e.g. dev branch) versions of a product.
Software innovation, like almost every other kind of innovation, requires the ability to collaborate and share ideas with other people, and to sit down and talk with customers and get their feedback and understand their needs.Bill Gates
Carrying out functional tests after every commit assures that no accumulation of errors and logical divergences will occur. For a tester conditions for prompt analysis of the project status and found divergences are ensured as well as a possibility to carry out test in parallel for several projects and facility to modify CI settings according to requirements of specific project.
Need some help?
Contact us at [email protected] and we will provide you with a detailed estimation of timing and price for your project. Give us a call at +1844.880.5473 and we will give you a solid plan of turning your idea into reality.TeamCity