Recently, I had the honor to try a new product of Ali Cloud: cloud development platform, and experience a brand new development mode! Although there were some problems in the middle, the overall experience revealed a sense of the future, because the whole process did not need to use our most commonly used IDEA, just rely on the browser to put a Spring Boot online!

What is a cloud development platform? Cloud development platform (workbench.aliyun.com) is a cloud R&D work platform provided by Ali Cloud for the majority of developers. It helps the R&D team to realize online work (team online, environment online, code online, collaborative online) and Serverless research and development mode. To help the R&D team to effectively share and spread the industry architecture experience and architecture services, so as to improve the R&D efficiency and reduce the r&d cost.

Here, I share how to develop and deploy Spring Boot applications on this platform! Interested children’s shoes, you can click into the cloud development platform, step by step with me to experience the complete development experience!

Basic configuration

Step 1: Create a new application

Step 2: Select Microservice and Spring Boot Application Migration Solution (SAE) or Spring Boot Application Migration Solution (ASK) for the solution. We’ve written a lot of Spring Boot examples before, so let’s use a migration solution to try out a scenario where Spring Boot is already developed.

Step 3: Enter information about the Spring Boot application

After clicking Finish, you can see the hello-World application you just created in the list of applications.

From the above card element, we can see that even though this is a simple application creation operation, it actually does a lot of things, such as allocating the environment, creating a Git repository, etc.

Application development

There are two ways to develop in a cloud development platform: online (in a browser) and offline (in a traditional editor).

Online development

Click “Development deployment” in the application card to take you to the cloud development page below:

You can see the files already in the project (mainly image build configurations, run scripts, and documentation) in the left center.

Take our old Spring Boot sample (if you haven’t played with Spring Boot, see the free tutorial series) and drag a Spring Boot application that you’ve written before:

After dragging in the code, you need to make some changes to the project organization according to the cloud development platform specification, so open pom.xml and make the following configuration changes:

  1. Properties add the applicationName configuration
  2. FinalName configuration added to build must be consistent with ****applicationName, so you can also use a reference
  3. Configure the spring-boot-Maven-plugin plugin. Use ZIP to package the plugin. Modify the main classpath of the application

The online test

After importing the project, we tried to run the application.

  1. Click the terminal TAB at the bottom
  2. On the CLI, enter MVN spring-boot:run

Not surprisingly, the terminal will output something like the following, the application started successfully!

But the application is launched on the cloud platform, not native, so how do we verify the interface provided by the application?

Click the “preview” button above and enter the port number you want to expose in the top popup box, for example: 8080

According to the prompt, press Enter, the prompt whether to visit immediately will appear in the lower right corner. Click Access directly to enter the accessible domain name address (which is mapped to the startup address on the cloud platform).

Submit code

After the above development work is done, it is usually the submission of the code that we focus on. Click the branch icon on the left to commit the code changes

Then click the arrow in the lower left and push the code into the repository.

Local development

You might think that the current online editors are not powerful enough, as we saw above that pom.xml is not highlighted yet. At this point, you can also choose native development mode. Just click “Code repository” in the application card, go to the following page, enter your local SSH key and save, and then you can pull the Git repository of your application to the local development!

Tip: You can see that the repository names are built by date and time, which is fine if you use online development and not sensitive to this content. However, if you want to develop locally, such a name is not so friendly to users, sometimes you will think of it as a temporary directory, looking forward to future improvements!

Application deployment

After completing application development and local testing, all we need to do is deliver and deploy the application. So, let’s try out the deployment capabilities of this platform!

Before deploying, we need to check that the current environment is ready for deployment. Click the “Environment Management” button in the application card, you can see the following page:

If any dependent cloud services are not enabled, click Open now to activate the services one by one. Otherwise, the subsequent deployment process cannot be completed properly.

If the use of environment variables is involved in your application, go ahead and click “Application Configuration” on the application card to set it up.

If your app needs to be developed with more than one person, you can add other developers with your Alicloud account in the “Member Management” section and they can access your app code as well.

Ready, let’s move on. Continue to open the deployment interface, click the first button in the left bar, you can see the deployment bar pops up:

Select the environment to be deployed (daily environment, pre-delivery environment, and online environment), select the first environment: Daily environment, and click Deploy.

As for the environment, you can’t add or modify it visually here. It is expected that there will be some flexibility in the configuration of the environment, and there are many different possibilities for different management styles, both in terms of name and number of environments.

Click “Continue deployment” to complete the CI and CD process:

From the log link in the log, you can also see the current container build:

If there is a problem, click on the log to see the details, such as:

If your service has been enabled and the project configuration is ok, the deployment will be completed as follows. After deployment is complete, it outputs the accessible domain name, which you can use to access the interface you provided to verify that the application started correctly.

Continuous deployment

Above we have completed the deployment of an environment that covers the basic operations of CI and CD. Let’s try out the flexibility of the continuous deployment (CD) section.

In the deployment bar, select another environment to try

You can see that there is a special option: publish the daily environment to the pre-release environment. If this parameter is checked, the image of the daily environment will be deployed to the pre-delivery environment, which conforms to the definition of CD. If this parameter is not checked, the image will be compiled and deployed again, which is another complete CI + CD process.

Use offline

The offline operation is very simple, just need to find the corresponding environment button in the corresponding application card, if the green status is in service, just click, you can start the application offline operation.

For example, I clicked Offline in the card, and the status in the card has become Offline. However, it cannot be redeployed in the development deployment page, and the log shows that the task is still being uninstalled.

Some tips

The environment description in logs does not match the environment definition. You are advised to use the same description

The XML is not highlighted and editing is a bit difficult

Once you start deploying, there is no manual termination; if you go wrong, you just have to wait

In the first release of this article, I successfully developed and deployed the Spring Boot application using only the browser. Please indicate the source.

conclusion

The cloud development platform is a new product, although there are still some uncomfortable places, but the overall use experience can solve many development efficiency problems, especially for independent developers like me (collaborative content is weak, but I don’t need it, haha). Basically, I can cover the most commonly used functions such as development, testing and on-line, and the development platform in the browser is my favorite. Although there is still a big gap in functionality compared with IDEA at present, the basic functions are available and there is no obstacle in the development process. However, the advantages of not having to configure the runtime environment, install an editor, and so on, make development relatively light.

There is another small finding that is more suggestive. Click the top headline in the upper right corner of the menu and click ‘Account Settings’ to jump to Aliyun version of Teambition: Cloud Effect Collaboration. Therefore, what made me feel that the collaboration function was still weak may have more room to play in the future. The combination of these two can be combined from demand management, RESEARCH and development management, operation and maintenance management all the way in the future, but what will be done specifically? Look forward to the platform showcasing their products in the future!

Welcome to pay attention to my public account: Program monkey DD, get the exclusive arrangement of learning resources, daily dry goods and welfare gifts.