Jenkins Operations: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
(16 intermediate revisions by the same user not shown)
Line 2: Line 2:


* [[Jenkins#Subjects|Jenkins]]
* [[Jenkins#Subjects|Jenkins]]
* [[Writing_a_Jenkins_Pipeline|Writing a Jenkins Pipeline]]
=Overview=
=Jenkins Version=
Manage Jenkins → About Jenkins


=Best Practices=
=Best Practices=
Line 7: Line 14:
{{External|https://wiki.jenkins.io/display/JENKINS/Jenkins+Best+Practices}}
{{External|https://wiki.jenkins.io/display/JENKINS/Jenkins+Best+Practices}}


=Container-Based Jenkins=
=<span id='Container-Based_Jenkins'></span>Running Jenkins as a Docker Container=
 
{{Internal|Running Jenkins as a Docker Container|Running Jenkins as a Docker Container}}
 
=Procedures=
 
* [[Injecting Jenkins Credentials into a Build Job#Overview|Injecting Jenkins Credentials into a Build Job]]
 
=Writing a Jenkins Pipeline=
{{Internal|Writing a Jenkins Pipeline|Writing a Jenkins Pipeline}}
 
=Manage Worker Nodes=
 
==Bring up a New Worker Node==
 
Jenkins → Manage Jenkins → Manage Nodes
 
To bring up a new type of worker node,  navigate to the bottom and use the "Provision with ''node-type''" dropdown box.
 
==Configure a New Worker Node Type==
 
Jenkins → Manage Jenkins → Configure System
 
A node type is known as a "Cloud", so the configuration lives in the "Cloud" section.
 
The name of the worker type is technically the "name of the Jenkins could of agents". 
 
We want an "Amazon EC2" type of cloud. The "Amazon EC2" could is capable launching multiple types of workers, based on different AMIs..
 
==Load Statistics==
 
Manage Jenkins → Load Statistics
 
For a specific type of executor: https&#58;//jenkins.example.com/cloud/label/<yourlabelhere>/load-statistics


==Help==
=Download Logs=
==Download a Build's Console Output==


docker run --rm jenkins/jenkins:LTS --help
Using UI, navigate to the build's console output: Build → Build History → Specific build → View as plain text → get the URL.


==Run==
<syntaxhighlight lang='bash'>
curl -H "Authorization: Basic c[...]4"  https://jenkins.example.com/cloud/job/example/job/somejob/33/consoleText > ./build-33.txt
</syntaxhighlight>


The following command line assumes that the image was modified to maintain [[Jenkins_Concepts#Instance_State|the plugin and WAR directories]] in custom locations:
==Download a Node Log==
<syntaxhighlight lang='bash'>
curl -H "Authorization: Basic c[...]4"  https://jenkins.example.com/cloud/blue/rest/organizations/jenkins/pipelines/example/branches/sombranch/runs/${build_number}/nodes/${node_number}/log/?start=0 > ./node.txt
</syntaxhighlight>


docker run --rm -p 8080:8080 jenkins/jenkins:LTS
=Plugin Operations=
==Amazon EC2 Container Service Plugin==
{{Internal|Jenkins_Amazon_EC2_Container_Service_Plugin#Operations|Amazon EC2 Container Service Plugin Operations}}
=Aborting a Build=
{{External|https://www.jenkins.io/doc/book/using/aborting-a-build/}}

Latest revision as of 17:20, 31 August 2020

Internal

Overview

Jenkins Version

Manage Jenkins → About Jenkins

Best Practices

https://wiki.jenkins.io/display/JENKINS/Jenkins+Best+Practices

Running Jenkins as a Docker Container

Running Jenkins as a Docker Container

Procedures

Writing a Jenkins Pipeline

Writing a Jenkins Pipeline

Manage Worker Nodes

Bring up a New Worker Node

Jenkins → Manage Jenkins → Manage Nodes

To bring up a new type of worker node, navigate to the bottom and use the "Provision with node-type" dropdown box.

Configure a New Worker Node Type

Jenkins → Manage Jenkins → Configure System

A node type is known as a "Cloud", so the configuration lives in the "Cloud" section.

The name of the worker type is technically the "name of the Jenkins could of agents".

We want an "Amazon EC2" type of cloud. The "Amazon EC2" could is capable launching multiple types of workers, based on different AMIs..

Load Statistics

Manage Jenkins → Load Statistics

For a specific type of executor: https://jenkins.example.com/cloud/label/<yourlabelhere>/load-statistics

Download Logs

Download a Build's Console Output

Using UI, navigate to the build's console output: Build → Build History → Specific build → View as plain text → get the URL.

curl -H "Authorization: Basic c[...]4"  https://jenkins.example.com/cloud/job/example/job/somejob/33/consoleText > ./build-33.txt

Download a Node Log

curl -H "Authorization: Basic c[...]4"  https://jenkins.example.com/cloud/blue/rest/organizations/jenkins/pipelines/example/branches/sombranch/runs/${build_number}/nodes/${node_number}/log/?start=0 > ./node.txt

Plugin Operations

Amazon EC2 Container Service Plugin

Amazon EC2 Container Service Plugin Operations

Aborting a Build

https://www.jenkins.io/doc/book/using/aborting-a-build/