Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Rancher pipelined configuration

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

1. Pipeline authorization settings

Gitlab version needs to be above 9, the authorized account must be the Maintainer of the project (master in gitlab 8), create the application in gitlab, copy the callbackurl on rancher

Generate the required ID and Key

Fill in the ID and Key just generated, and enter the URL of your gitlab address.

After authorization is complete, set resource limits for pipeline operation

2. Configuration pipeline

Now you can start setting up the pipeline, first set up the code base, open the code base that needs to run

Set what conditions can trigger the pipeline

Start the configuration pipeline process and select the branch you want to configure

3. Pipeline configuration

The first step is that the system has been set up, we only need to set up the following steps according to our own needs

The second step is build, the selected type is run script, execute mvn clean package command, the selected image is my own package maven3.6 image.

The company has its own maven private server, so when packaging maven mirror, you can set the setting.xml file and upload it to the harbor repository configured above. If you don't know where the settings file is placed in the mvn mirror, run mvn -X to see the order in which mvn reads the configuration files, and then copy the settings file into it.

This step is mainly to package the package built with build into an image according to the Dockerfile in the code. The current directory is still the directory after git clone. Specify the relative position of Dockerfile and name the packaged image name, where:${CICD_GIT_COMMIT} in the image name is a variable provided by rancher. Here the Dockerfile path and build context path are the path to the Dockerfile in the gitlab library.

Here is how to configure dockerfile:

FROM registry.hello.com/jdk:1.8_232 #This is my private warehouse jdk mirror ADD ./ target/app.jar app.jarCMD ["java -jar app.jar -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap"]

The last step is to deploy the Deployment.yaml file. The yaml path is the path under the project in your gitlab repository.

Once you've saved it, you can see that you're building it.

Once all are running successfully, you can see the pod running status in the workload

Perfect finish!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report