Quick start: Create and deploy a Spring Boot application
Alibaba Cloud DevOps AppStack uses an application-centric approach to organize development, testing, delivery, and operations. This guide walks you through creating and deploying a Spring Boot application with Alibaba Cloud DevOps AppStack.
Step 1: Create an application and select the Spring Boot template
Go to the Applications page on the Alibaba Cloud DevOps AppStack console, and click . This example uses a Spring Boot application in K8s deployment mode to demonstrate the complete workflow, from source code and image build to deployment to the test environment.
In the Application Name field, enter spring-boot-demo, select the Spring Boot experience template, and then click Create and Deploy Application.
After you select the template, the Preview Application panel appears on the right, displaying basic information about the application (application name: spring-boot-demo, code repository: https://atomgit.com/appstack-example/spring-boot.git, etc.), the orchestration configuration (Kubernetes Service YAML snippet), and the development process (production stage: release approval → deploy; staging stage: build → deploy; test stage: test → build → deploy).
Step 2: Trigger the development process
Once triggered, the development process for the spring-boot-demo project enters the test stage (Run #1, Status: Running). The pipeline visualization shows four columns in sequence: Pipeline Source (master branch) → Test (Maven Unit Test and Java Code Scan, both running) → Build (Image Build and Push) → Deploy (AppStack Deploy - Test Environment).
Step 3: Create and submit a deployment
Click Create Deployment Order to go to the deployment order page. If the environment is not associated with a deployment resource (such as an ACK cluster or a self-managed K8s cluster), click "Go to Associate" to configure "Kubernetes Resources". If no available K8s cluster exists, refer to Kubernetes Cluster Hosting.
When the pipeline run reaches the deployment stage, a Create Deployment Order link appears in the AppStack Deploy - Test Environment task.
In the Environment Settings dialog box that appears, select the Deployment Settings tab. Set the deployment method to Kubernetes Deployment, select the target cluster from the Kubernetes Resources drop-down list, and click OK.
After you associate the resources, the page displays the associated resource, for example, devops-pre-autotest-002. The form is automatically populated with the deployment order name, deployment version number, orchestration version number, and image information. Customizable parameters include namespace, cpuLimit, memoryLimit, cpuRequest, memoryRequest, and others. After confirming that the deployment details are correct, click Continue.
On the Confirm Deployment Options page, confirm the deployment resources (such as the spring-boot-demo-test Service and Deployment). Set the Deployment Strategy to rolling deployment, Target Instances to 1, Batch Size to 1, Timeout to 10 minutes, and Pause Strategy to pause on first batch. Then, click Submit.
Step 4: Verify the deployment and access the application
Wait for the deployment order to complete. This completes the end-to-end application build and deployment workflow.
On the deployment order details page, the deployment status is Succeeded. The component spring-boot-demo uses a 2-batch rolling deployment strategy (Batch 1: 1 instance; Batch 2: 1 instance; timeout per batch: 10 minutes), and both batches have completed (2/2). The resource topology at the bottom shows that the Deployment created a ReplicaSet for the target version and its two Pods are running normally.
Next steps
-
View resource status on the environment details page. For more information, see Environment Management.
-
Fully configure the pipelines for the staging stage and production stage. For more information, see Development Model.
-
Customize organization-level application templates for bulk application management. For more information, see Efficiently Manage Microservice Applications with AppStack.
-
Set environment deployment strategies and explore more release strategies. For more information, see Environment Deployment Strategy.