...

/

Retrieve Jenkins X Activities, Logs, Pipelines, and More

Retrieve Jenkins X Activities, Logs, Pipelines, and More

This lesson explores how we can retrieve information concerning Jenkins X through the command line and the initial GitHub release created by Jenkins X.

While UIs are nice to look at, I am a firm believer that nothing beats the command line concerning speed and repeatability. Fortunately, we can retrieve almost any information related to Jenkins X through jx executable.

Retrieving activities

We can, for example, get the last activities (builds) of those jobs.

Press + to interact
jx get activities

The output is as follows:

Press + to interact
STEP STARTED AGO DURATION STATUS
vfarcic/environment-jx-rocks-staging/master #1 5m17s 59s Succeeded
meta pipeline 5m17s 14s Succeeded
Credential Initializer Cd47r 5m17s 0s Succeeded
Working Dir Initializer N5vv7 5m17s 1s Succeeded
Place Tools 5m16s 1s Succeeded
Git Source Meta Vfarcic Environment Jx Roc ... 5m15s 4s Succeeded https://github.com/vfarcic/environment-jx-rocks-staging.git
Git Merge 5m11s 1s Succeeded
Merge Pull Refs 5m10s 0s Succeeded
Create Effective Pipeline 5m10s 2s Succeeded
Create Tekton Crds 5m8s 5s Succeeded
from build pack 5m2s 44s Succeeded
Credential Initializer Q4qvj 5m2s 0s Succeeded
Working Dir Initializer Gtj86 5m2s 1s Succeeded
Place Tools 5m1s 1s Succeeded
Git Source Vfarcic Environment Jx Rocks St ... 5m0s 5s Succeeded https://github.com/vfarcic/environment-jx-rocks-staging.git
Git Merge 4m55s 1s Succeeded
Setup Jx Git Credentials 4m54s 1s Succeeded
Build Helm Apply 4m53s 35s Succeeded
vfarcic/environment-jx-rocks-staging/PR-1 #1 6m22s 47s Succeeded
meta pipeline 6m22s 12s Succeeded
Credential Initializer Jdbwq 6m22s 0s Succeeded
Working Dir Initializer T54b2 6m22s 0s Succeeded
Place Tools 6m22s 1s Succeeded
Git Source Meta Vfarcic Environment Jx Roc ... 6m21s 5s Succeeded https://github.com/vfarcic/environment-jx-rocks-staging.git
Git Merge 6m16s 0s Succeeded
Merge Pull Refs 6m16s 1s Succeeded
Create Effective Pipeline 6m15s 3s Succeeded
Create Tekton Crds 6m12s 2s Succeeded
from build pack 6m7s 32s Succeeded
Credential Initializer Ntjdr 6m7s 0s Succeeded
Working Dir Initializer 86qgm 6m7s 1s Succeeded
Place Tools 6m6s 1s Succeeded
Git Source Vfarcic Environment Jx Rocks St ... 6m5s 4s Succeeded https://github.com/vfarcic/environment-jx-rocks-staging.git
Git Merge 6m1s 1s Succeeded
Build Helm Build 6m0s 25s Succeeded
vfarcic/jx-go/master #1 7m24s 2m26s Succeeded Version: 0.0.1
meta pipeline 7m24s 18s Succeeded
Credential Initializer J9wnj 7m24s 0s Succeeded
Working Dir Initializer Fs82g 7m24s 2s Succeeded
Place Tools 7m22s 2s Succeeded
Git Source Meta Vfarcic Jx Go Master ... 7m20s 3s Succeeded https://github.com/vfarcic/jx-go.git
Git Merge 7m17s 1s Succeeded
Merge Pull Refs 7m16s 0s Succeeded
Create Effective Pipeline 7m16s 3s Succeeded
Create Tekton Crds 7m13s 7s Succeeded
from build pack 7m4s 2m6s Succeeded
Credential Initializer Fmc45 7m4s 0s Succeeded
Working Dir Initializer Vpjff 7m4s 3s Succeeded
Place Tools 7m1s 2s Succeeded
Git Source Vfarcic Jx Go Master ... 6m59s 11s Succeeded https://github.com/vfarcic/jx-go.git
Git Merge 6m48s 1s Succeeded
Setup Jx Git Credentials 6m47s 0s Succeeded
Build Make Build 6m47s 6s Succeeded
Build Container Build 6m41s 2s Succeeded
Build Post Build 6m39s 1s Succeeded
Promote Changelog 6m38s 4s Succeeded
Promote Helm Release 6m34s 5s Succeeded
Promote Jx Promote 6m29s 1m31s Succeeded
Promote: staging 6m24s 1m26s Succeeded
PullRequest 6m24s 1m26s Succeeded PullRequest: https://github.com/vfarcic/environment-jx-rocks-staging/pull/1 Merge SHA: ...
Update 4m58s 0s Succeeded

We can see that there were activities with each of the three jobs. We had one deployment to the production environment (environment-jx-rocks-production), and two deployments to staging (environment-jx-rocks-staging). The first build (activity) is always performed when a job is created. Initially, environments only contain a few applications necessary for their correct operation. The reason for the second build of the staging environment lies in the creation of the jx-go project. One of the steps in its pipeline is in charge of promoting a successful build to the staging environment automatically. When we explore jenkins-x.yml in more detail, you’ll get a better understanding of the process, including promotions.

The last activity is of the jx-go pipeline. So far, we did not push any change to the repository, so we have only one build that was run when the job itself was generated through the quickstart process.

...
Access this course and 1400+ top-rated courses and projects.