23 Enterprise Level Cicd Tools for Deploying Serverless Applications

23 Enterprise-Level CICD Tools for Deploying Serverless Applications #

Background #

1.png

Through the study of previous lessons, I believe you have gained some understanding of the SAE platform. SAE eliminates many complex operations and maintenance tasks for customers, with out-of-the-box functionality and pay-as-you-go pricing. At the same time, SAE provides rich Open APIs, making it easy to integrate with other platforms. CI/CD tools like Yunxiao and Jenkins are important in agile software development practices as they can automate the compilation, testing, packaging, and deployment of customer code to different environments, thereby improving development efficiency.

This article is divided into two parts. First, it introduces the use of the Yunxiao platform to implement continuous integration from source code to the SAE environment. Then, it explains how to configure continuous integration using Jenkins.

Deploying to SAE using Yunxiao #

Yunxiao (rdc.console.aliyun.com) is an enterprise-level one-stop DevOps platform launched by Alibaba Cloud, covering the entire process from requirements to development, testing, release, operation, and maintenance. If you are interested in Yunxiao, you can search for it on the Alibaba Cloud official website. This article only introduces the parts related to CI/CD.

2.PNG

As shown in the above figure, the top part of the image is our configuration process, and the bottom part is an example of the continuous integration process we need to execute. Initially, Yunxiao will pull the corresponding code from the code repository, then perform code inspection and unit testing. Next is the code compilation and build process, which will generate corresponding artifacts. In this case, let’s take a Java application as an example. If the build artifact is a JAR file, the pipeline will execute the “mvn package” command to generate the corresponding JAR file during runtime. If the build artifact is a Docker image, after building the JAR package, the build process will continue with the “docker build” command to build the corresponding Docker image and upload it to the selected ACR image repository. The last two steps of the pipeline are to call the SAE Open API to deploy and distribute the build artifact (JAR file/Docker image) to the testing environment. Depending on the pre-set configuration, the pipeline will stop after deploying to the testing environment and wait for a manual trigger. After manually verifying that the deployment in the testing environment is normal, the pipeline can be manually triggered to continue running. This time it will call Open API to deploy to the production environment.

Operational steps:

  • First, make sure that the configuration for compilation and packaging of the code is correct and can be compiled and packaged successfully locally. If deploying using the Docker method, the project’s root directory should contain the corresponding Dockerfile configuration.
  • Create the corresponding application in the SAE console. Please note that if you have multiple environment deployment requirements, such as deploying to the test and production environments, you should first create the corresponding “test” namespace and “product” namespace, and then create the application in the corresponding namespace.
  • Configure Yunxiao accordingly, including the source code repository configuration and pipeline configuration. For details, please refer to the corresponding product documentation.
  • Finally, click “Run” to trigger the pipeline to execute the compilation and deployment.

Deploying to SAE using Jenkins #

Jenkins is a widely used open-source CI/CD platform. Using Jenkins, you can package and deploy source code to SAE. The final result achieved with Jenkins is similar to “deploying to SAE using cloud products and Yunxiao”. Using Jenkins, you can compile the application source code into a JAR file, and then use the Maven plugin to call the SAE Open API deployment interface to deploy the application to SAE.

3.PNG

Operations steps:

  • The code repository should have the corresponding packaging configuration. When using Jenkins, the generated build artifact is a JAR file, so it is required to have the corresponding Maven configuration file “pom.xml” in the project’s root directory.
  • Before deployment, create the corresponding namespace and application in the SAE platform, and complete the application configuration through the initialization deployment.
  • Configure the corresponding Docker plugin in Jenkins and create and configure the corresponding Project in Jenkins. The Project can be configured to trigger manual deployment or be configured to trigger compilation and deployment when code is committed. For specific configurations, please refer to the corresponding product documentation.

Deployment process demonstration: Please click the link to watch: https://developer.aliyun.com/lesson202619006

Conclusion #

By now, I believe you have learned how to use CI/CD tools to easily deploy source code to the SAE platform. I hope the combination of CI/CD platforms and SAE can help accelerate your business development.

To allow more developers to enjoy the benefits of serverless computing, this time we have gathered more than 10 Alibaba Cloud serverless technology experts to create the most suitable serverless public course for developers, enabling you to learn and use it immediately, and easily embrace the new paradigm of cloud computing—serverless.

Click to watch the course for free: https://developer.aliyun.com/learning/roadmap/serverless