CodeArts + CCE: From code to Application
CodeArts is a one-stop, full-process, secure, and trustworthy cloud-native DevSecOps platform. It's provide many services.I select some service's components to demonstrate how to quickly implement CI/CD capabilities through codearts and deploy code to CCE.
Note
The steps is: source code → build ---> package to docker image → push to swr → deploy to CCE
A Java web app build
1. create code repository
- open the codearts console, create a project
- Go to the code → Repo → New Repository
- We can create a empty repository , and then use git command push code to this repository.
- we can create repository use template
We are select a template for demo in there.
2. create dockerfile
create a dockerfile for package the application to image when CI(continuous integration) step build the source code finished.
1 2 3 4 |
|
3. Build steps
Go to CI/CD option, select build step → create task
Next step have a lot of Build Templates can select. choice the blank template, added two steps for the build task.
Note: We can added more steps if we want more tasks for build.
Build and Running
So we can see it's successful build the source code to jar file → package to docker image → upload to SWR.
A Java web app deploy
create deploy.yaml file:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
|
1. CodeArts deploy
Switch to deploy option, and create a new task about deploy to CCE, setting like this:
This is the details informations
Let's switch the CCE console check the workload, we found the application had deployed.
2. CodeArts pipeline
We can create a pipeline to combine the preceding two operations. And then We can deploy from source code to application with just click 1 time.
Let's delete the CCE workload, try it again. we can check the service to CCE.
捐赠本站(Donate)
如您感觉文章有用,可扫码捐赠本站!(If the article useful, you can scan the QR code to donate))