...
/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.
jx get activities
The output is as follows:
STEP STARTED AGO DURATION STATUSvfarcic/environment-jx-rocks-staging/master #1 5m17s 59s Succeededmeta pipeline 5m17s 14s SucceededCredential Initializer Cd47r 5m17s 0s SucceededWorking Dir Initializer N5vv7 5m17s 1s SucceededPlace Tools 5m16s 1s SucceededGit Source Meta Vfarcic Environment Jx Roc ... 5m15s 4s Succeeded https://github.com/vfarcic/environment-jx-rocks-staging.gitGit Merge 5m11s 1s SucceededMerge Pull Refs 5m10s 0s SucceededCreate Effective Pipeline 5m10s 2s SucceededCreate Tekton Crds 5m8s 5s Succeededfrom build pack 5m2s 44s SucceededCredential Initializer Q4qvj 5m2s 0s SucceededWorking Dir Initializer Gtj86 5m2s 1s SucceededPlace Tools 5m1s 1s SucceededGit Source Vfarcic Environment Jx Rocks St ... 5m0s 5s Succeeded https://github.com/vfarcic/environment-jx-rocks-staging.gitGit Merge 4m55s 1s SucceededSetup Jx Git Credentials 4m54s 1s SucceededBuild Helm Apply 4m53s 35s Succeededvfarcic/environment-jx-rocks-staging/PR-1 #1 6m22s 47s Succeededmeta pipeline 6m22s 12s SucceededCredential Initializer Jdbwq 6m22s 0s SucceededWorking Dir Initializer T54b2 6m22s 0s SucceededPlace Tools 6m22s 1s SucceededGit Source Meta Vfarcic Environment Jx Roc ... 6m21s 5s Succeeded https://github.com/vfarcic/environment-jx-rocks-staging.gitGit Merge 6m16s 0s SucceededMerge Pull Refs 6m16s 1s SucceededCreate Effective Pipeline 6m15s 3s SucceededCreate Tekton Crds 6m12s 2s Succeededfrom build pack 6m7s 32s SucceededCredential Initializer Ntjdr 6m7s 0s SucceededWorking Dir Initializer 86qgm 6m7s 1s SucceededPlace Tools 6m6s 1s SucceededGit Source Vfarcic Environment Jx Rocks St ... 6m5s 4s Succeeded https://github.com/vfarcic/environment-jx-rocks-staging.gitGit Merge 6m1s 1s SucceededBuild Helm Build 6m0s 25s Succeededvfarcic/jx-go/master #1 7m24s 2m26s Succeeded Version: 0.0.1meta pipeline 7m24s 18s SucceededCredential Initializer J9wnj 7m24s 0s SucceededWorking Dir Initializer Fs82g 7m24s 2s SucceededPlace Tools 7m22s 2s SucceededGit Source Meta Vfarcic Jx Go Master ... 7m20s 3s Succeeded https://github.com/vfarcic/jx-go.gitGit Merge 7m17s 1s SucceededMerge Pull Refs 7m16s 0s SucceededCreate Effective Pipeline 7m16s 3s SucceededCreate Tekton Crds 7m13s 7s Succeededfrom build pack 7m4s 2m6s SucceededCredential Initializer Fmc45 7m4s 0s SucceededWorking Dir Initializer Vpjff 7m4s 3s SucceededPlace Tools 7m1s 2s SucceededGit Source Vfarcic Jx Go Master ... 6m59s 11s Succeeded https://github.com/vfarcic/jx-go.gitGit Merge 6m48s 1s SucceededSetup Jx Git Credentials 6m47s 0s SucceededBuild Make Build 6m47s 6s SucceededBuild Container Build 6m41s 2s SucceededBuild Post Build 6m39s 1s SucceededPromote Changelog 6m38s 4s SucceededPromote Helm Release 6m34s 5s SucceededPromote Jx Promote 6m29s 1m31s SucceededPromote: staging 6m24s 1m26s SucceededPullRequest 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.