Wiki source code of Jenkins
Last modified by DevOps-as-a-Service Operator on 2025/02/05 11:33
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | Jenkins is a Continuous Integration/Continuous Delivery tool for building, testing, delivering and deploying software. This [[link >>url:https://www.jenkins.io/doc/||shape="rect"]]is a good starting point for vendor documentation. | ||
2 | |||
3 | {{toc/}} | ||
4 | |||
5 | = How to log in to Jenkins = | ||
6 | |||
7 | To use Jenkins, select a Project in SDPortal (in this example the project named **Showing DevOps as a Service capabilities** with the project key //Showcase//) then click **Jenkins**. | ||
8 | |||
9 | [[image:attach:image2019-6-24_13-55-41.png||data-xwiki-image-style-border="true" queryparams="effects=drop-shadow" height="179" width="1000"]] | ||
10 | |||
11 | In the next step use your credentials that you used for log in to SDPortal. | ||
12 | |||
13 | [[image:attach:image2019-6-24_13-43-46.png||data-xwiki-image-style-border="true" queryparams="effects=drop-shadow" height="298" width="351"]] | ||
14 | |||
15 | {{error}} | ||
16 | ❗ Keep in mind, that you have to use **lower case letters in your email address** during the login procedure due to a Jenkins bug - using uppercase letters will let you log in to Jenkins, but you won't see any project(s)! | ||
17 | {{/error}} | ||
18 | |||
19 | = Classic view = | ||
20 | |||
21 | == Initial view == | ||
22 | |||
23 | After you log in you will be inside your project folder that you are assigned to. Inside in this folder you can add jobs manually to the project. | ||
24 | |||
25 | You can see the basic features of Jenkins through this example project. | ||
26 | |||
27 | [[image:attach:image2019-7-15_10-16-52.png||data-xwiki-image-style-border="true" queryparams="effects=drop-shadow" height="504" width="1000"]] | ||
28 | |||
29 | == {{id name="folderhiearchy"/}}Folder hierarchy == | ||
30 | |||
31 | If you click on the folder's name you can see what other projects you have been assigned to (in this example //Azuretest //can be another project). You can see that means going up one level in the folders' hierarchy.[[image:attach:image2019-7-3_8-22-23.png||data-xwiki-image-style-border="true" queryparams="effects=drop-shadow" height="474" width="1000"]] | ||
32 | |||
33 | If you click on the folder with project name (**//Showing DevOps as a Service// capabilities**) you can return to the initial view of your project, in this example you can see **sdcloud-caas-bginx-demo **and **//Showing DevOps as a Service capabilities.//** | ||
34 | |||
35 | You can notice the hierarchy of the folders appear on the top left section as a path to the folder structure. | ||
36 | |||
37 | There you can see the folder of the project appears two times, it is because the first folder for project separation and inside it there is a another folder for the auto discovery feature (related to Bitbucket). | ||
38 | |||
39 | == Repositories == | ||
40 | |||
41 | If you click on the appearing folder name (here it is Showing DevOps as a Service capabilities) the **Repositories** can be seen, in this example it is sdcloud-caas-bginx-demo. | ||
42 | |||
43 | Bitbucket and Jenkins are connected to each other, so that Jenkins automatically knows all repositories in which a Jenkinsfile resides. | ||
44 | |||
45 | [[image:attach:image2019-7-3_8-25-15.png||data-xwiki-image-style-border="true" queryparams="effects=drop-shadow" height="239" width="1000"]] | ||
46 | |||
47 | == Branches == | ||
48 | |||
49 | If you click on the //sdcloud-caas-bginx-demo//, you can see the **Branches** and the **Pull requests** also. In this example we have 6 branches. | ||
50 | |||
51 | [[image:attach:image2019-7-3_8-29-47.png||data-xwiki-image-style-border="true" queryparams="effects=drop-shadow" height="330" width="1000"]] | ||
52 | |||
53 | You can click on the triangle next to the branch's name and several options appear: | ||
54 | |||
55 | [[image:attach:image2019-7-3_8-33-39.png||data-xwiki-image-style-border="true" queryparams="effects=drop-shadow" height="250"]] | ||
56 | |||
57 | == Steps and stages == | ||
58 | |||
59 | If you click on the selected branch (in this example it is //SHOWCASE-8-change-nginx//), you can see the **Stage View**, which shows all the stages for the build. | ||
60 | |||
61 | [[image:attach:image2019-7-3_8-35-41.png||data-xwiki-image-style-border="true" queryparams="effects=drop-shadow" height="580" width="1000"]] | ||
62 | |||
63 | == Manually creating Jobs == | ||
64 | |||
65 | The Bitbucket folder will automatically show jobs for all repositories found in the project on Bitbucket. But you can still manually create additional jobs in the Jenkins project folder. This can be used to e.g. build from other sources than the Bitbucket included in DevOps-as-a-Service. | ||
66 | |||
67 | After signing in the //project name// appears (in this example the project named **Test Project 5**), and a so called "folder" is visible, which is a way to implement the projects. | ||
68 | |||
69 | If you would like to create a custom job or a pipeline click on the **New Item** on the left. | ||
70 | |||
71 | [[image:attach:image2019-7-18_9-36-0.png||data-xwiki-image-style-border="true" queryparams="effects=drop-shadow" width="600"]] | ||
72 | |||
73 | You can select and set the required feature for your project. | ||
74 | |||
75 | Here you can set behaviors for the //branches//, the //pipelines//, and you can see the //technical use//r also. | ||
76 | |||
77 | For more details please visit the vendor's website. | ||
78 | |||
79 | To finalize your setting click** Save.** | ||
80 | |||
81 | [[image:attach:image2019-7-18_9-38-5.png||data-xwiki-image-style-border="true" queryparams="effects=drop-shadow" height="577" width="1000"]] | ||
82 | |||
83 | == Credentials == | ||
84 | |||
85 | Each project folder has its own credential store. It contains [[doc:Jenkins.Automatically provided Credentials.WebHome]], but you can also add your own ones. | ||
86 | |||
87 | = Blue Ocean view = | ||
88 | |||
89 | Another option to view your build process is to use the **Blue Ocean** plugin, which has a fancy user interface and optimized for the usage of pipelines. | ||
90 | |||
91 | You can see the same folder structure like in the classical view, you can notice the hierarchy of the folders appear as a path to the [[folderhiearchy>>doc:||anchor="folderhiearchy"]]. | ||
92 | |||
93 | [[image:attach:image2019-6-26_13-38-0.png||data-xwiki-image-style-border="true" queryparams="effects=drop-shadow" height="276" width="1000"]] | ||
94 | |||
95 | If you click Blue Ocean in the left menu you can see the **Pipelines** of the projects. | ||
96 | |||
97 | Health shows the results of the last run of the builds, if the health is "cloudy" that means some errors can be found in the build process. | ||
98 | |||
99 | Branches shows the number of pipelines depending on the number of branches, in this case the project has 5 branches. | ||
100 | |||
101 | If you click on the project's name (in this example //Showing DevOps as a Service capabilities/sdcloud-caaas-nginx-demo//) you can see the **Activity** of the builds: | ||
102 | |||
103 | [[image:attach:image2019-6-26_13-54-59.png||data-xwiki-image-style-border="true" queryparams="effects=drop-shadow" height="389" width="1000"]] | ||
104 | |||
105 | If you click on one of the build jobs you can see the stages of the build, in this example the commit //af8de71// is selected: | ||
106 | |||
107 | [[image:attach:image2019-6-26_14-12-50.png||data-xwiki-image-style-border="true" queryparams="effects=drop-shadow" height="570" width="1000"]] | ||
108 | |||
109 | You can see the different stages of the build (clone-build-test-push), if you click on a stage (for example Push Docker Image) you can see the steps. | ||
110 | |||
111 | In this example the steps (tag and push) are responsible for creating 3 images with different prefixes - all of these are written in the Jenkins file. | ||
112 | |||
113 | We provide a template Jenkins file in our public library, which consists of only two lines. You can use our library for building containers, the library can be referenced with it's name, and it makes accessible a basic repository in Jenkins. | ||
114 | |||
115 | = Webhooks = | ||
116 | |||
117 | **Webhooks plugin** enable you to make request to a server (or another external service) when certain events occur in Bitbucket. For example, you can configure webhooks to update an issue tracker, trigger CI builds, or even deploy to your production server. [[Learn more>>url:http://docs.atlassian.com/bitbucketserver/docs-062/Managing+webhooks+in+Bitbucket+server?utm_campaign=in-app-help&utm_medium=in-app-help&utm_source=stash||shape="rect"]]. | ||
118 | |||
119 | The **Jenkins hook** is a webhook that is automatically added by Jenkins, You can see it in Bitbucket by viewing the Repository settings: | ||
120 | |||
121 | [[image:attach:image2019-7-22_15-15-23.png||data-xwiki-image-style-border="true" queryparams="effects=drop-shadow" height="328" width="1000"]] | ||
122 | |||
123 | It is also possible to view the event log by clicking View details: | ||
124 | |||
125 | [[image:attach:image2019-7-22_15-17-59.png||data-xwiki-image-style-border="true" queryparams="effects=drop-shadow" height="328" width="1000"]] | ||
126 | |||
127 | Of course these settings should not be changed, since Jenkins manages them automatically. |