This is the fishing method used by programmers with an annual salary of millions...

With the continuous development of information technology, many traditional workflows are rapidly transforming towards automation. In the past, developers would have to manually perform a series of operations to deploy the code to production after they finished writing it.

This seems simple, but in actual operation, it is not only prone to various human errors, but also consumes a lot of time and energy from developers. In addition, a rollback operation is required once a problem occurs, which means that the above steps need to be performed again until successful.

As a veteran tester, this sadness and pain is beyond words. In order to solve these problems, automated deployment technology has gradually emerged. Automatic deployment, simply put, from code version control, construction, testing to final release, these complex and tedious steps are completed automatically without manual intervention.

I had already finished my work in the morning, and then I suddenly wanted to share my "fishing" skills with you. This article will introduce the advantages and practices of automated deployment. By understanding the basic principles and tools of automated deployment, we can help you achieve an efficient and reliable software release process.

 

1. Why automated deployment is so important

1. Provide timely feedback and increase release frequency

Automated deployment greatly simplifies the deployment process, not only can new features and fixes be quickly pushed to users, but also timely feedback can be obtained from users. Through quick feedback, the team can immediately understand whether the product changes are effective and meet the needs of users, and then make adjustments based on user feedback.

Facebook mobile applications are updated very frequently. iOS and Android applications are updated once a month on average. Each update may include new features, performance improvements, bug fixes, etc.

At Facebook, an average of 92 lines of code are added or modified per deployed software update, and each developer pushes an average of 3.5 updates to production per week. Given the size of Facebook's engineering team, this means 1,000 deployments to production every day, which cannot be accomplished by automating deployments alone.
 

The market changes frequently and competition among similar products is fierce. Automated deployment can promote the rapid release of new versions, help products quickly adapt to market changes, and gain users' attention.

facebook

2. Improve efficiency and reduce human errors

Developers are developing new features or fixing bugs every day, and new code needs to be deployed to the production environment every day. Once an error occurs during the process of uploading or starting the code, the product may not function properly and affect the user experience.

If you use automated deployment, you only need to submit the code to the version control system and wait for the automated deployment tool to complete the next steps, so there is no human error. Even if an error is discovered during the build or test process, the automated deployment stops and notifies the developer, so the developer can fix the error immediately before it affects the production environment.

Additionally, automated deployment can be combined with grayscale release strategies. Developers can first deploy the new code to a subset of servers to see if there are any problems. If there are no problems, then deploy the code to all servers. In this way, even if there is a problem with the new code, it will only affect some users, not all users.

Many companies have achieved significant results after successfully implementing automated deployment. For example, Google uses Cloud Build and Cloud Deploy to implement automated deployment, reducing deployment time by up to 80%; Amazon uses AWS CodeDeploy to automate deployment and deploy without downtime. Millions of code changes.

We have to admit that automated deployment reduces human errors to a certain extent and greatly improves the speed and reliability of deployment.
 

3. Long-term stability, avoiding repeated debugging

Manual deployment processes are often documented, which requires additional time to maintain, and version deployments are often inconsistent or incomplete due to updates. If personnel turnover or resignation occurs, the deployment process will be seriously affected. In addition, the work efficiency of those who have been engaged in manual deployment work for a long time is easily affected by factors such as work status and concentration. On the one hand,

automated

Automated deployment

2. How to realize automated deployment

1. How to choose the appropriate automated deployment tool

With the development of digital transformation, offline businesses of enterprises are gradually moving online, the number of applications is increasing day by day, and deployment activities are becoming more frequent. Currently, there are various automated deployment tools on the market. How do we choose the tool that suits our development process?

  • Project requirements

We need to know exactly what our project requires. Do you need to support multi-environment deployment, such as development, testing, and production environments? Do you need to support multi-platform deployment, such as Windows, Linux, Mac or cloud services (AWS, Azure, GCP)? What language or framework our project is developed on... these will affect your choice of deployment tools.
 

  • Ease of use

Deployment tools should be easy to understand and use, especially for novices. If a tool requires significant learning and configuration costs, it may not be the best choice. Also, the tool’s documentation and community support are factors to consider.
 

  • Scalability

If the project is likely to grow or change, then this requires a tool that can scale with the needs of the project. This includes supporting new deployment targets (e.g., new operating systems or cloud services), as well as supporting more complex deployment strategies (e.g., blue/green deployments or canary deployments).
 

  • integrated

Deployment tools should be easily integrated into your development and operations processes. This may include integration with source code management systems (such as GitFox), continuous integration/continuous deployment (CI/CD) tools (such as Jenkins, GitHub Actions, GitLab CI/CD), and monitoring and logging systems.
 

  • cost

The cost of deployment tools is also an important factor. This includes the direct costs of purchasing and maintaining the tools, as well as the indirect costs of learning and using the tools. Some tools may be free but require significant configuration and maintenance, while others may be paid but offer more features and support.
 

Common automated deployment tools include Jenkins, Ansible, Docker, Kubernetes, etc. Each tool has its pros and cons, and teams need to choose the right tool based on the above factors and specific needs.

Automated deployment

2. How to implement automatic deployment process

Automated deployment is an important part of supporting DevOps practices and managing CI/CD pipelines. Taking the ZenTao DevOps platform as an example, how to implement the automatic deployment process:

  • Version control: During the development process, developers submit the code they write to version control tools (such as GitLab and GitFox software) for source code management and track code changes in real time.
  • Continuous integration: When the code is submitted, ZenTao's continuous integration tools will automatically trigger the build process, including SonarQube for static code analysis, ZTF automated test management framework for unit testing, etc. If any issues arise during the build, developers are immediately notified. After testing is complete, initiate a merge request.
  • Continuous testing: The development team can use continuous integration tools (GitFox pipeline, GitLab CI) to drive ZTF to perform certain types of automated testing. During the testing process, the script obtains structured test data by accessing the data files or API interfaces generated by ZenData.
  • Continuous deployment: If the build is successful, the continuous deployment tool integrated with ZenTao will automatically deploy new code changes to the specified environment, such as a test environment or a production environment.
  • Feedback and improvement: After the deployment is completed, the ZenTao platform can provide detailed deployment logs and application performance monitoring data to help the team understand the running status of the application and make adjustments or repairs if necessary.

It's worth noting that the actual deployment process may be adjusted based on specific project needs and team habits.

ZenTao DevOps Platform

3. One-click automated deployment to continue fishing

Although automated deployment brings many advantages, we cannot ignore its challenges, such as complex environment configuration, security issues, etc. Therefore, automated deployment tools need to be selected and configured based on specific project requirements and environment.

Although automated deployment tools are not a panacea, automated deployment is indeed an important part of software development and testing. It is not difficult to see that I am the beneficiary of automated deployment.

Not to mention, a new task is here again. Next time I will share with you other time-saving and labor-saving "fishing" techniques.

The pirated resources of "Celebrating More Than Years 2" were uploaded to npm, causing npmmirror to have to suspend the unpkg service. Microsoft's China AI team collectively packed up and went to the United States, involving hundreds of people. The founder of the first front-end visualization library and Baidu's well-known open source project ECharts - "going to the sea" to support Fish scammers used TeamViewer to transfer 3.98 million! What should remote desktop vendors do? Zhou Hongyi: There is not much time left for Google. It is recommended that all products be open source. A former employee of a well-known open source company broke the news: After being challenged by his subordinates, the technical leader became furious and fired the pregnant female employee. Google showed how to run ChromeOS in an Android virtual machine. Please give me some advice. , what role does time.sleep(6) here play? Microsoft responds to rumors that China's AI team is "packing for the United States" People's Daily Online comments on office software's matryoshka-like charging: Only by actively solving "sets" can we have a future
{{o.name}}
{{m.name}}

Guess you like

Origin my.oschina.net/candou/blog/11181106