Jenkins > Blue Ocean > Build from latest commit - jenkins

To clarify, what I'm looking for is a Build from latest commit rather than Build from current commit.
I don't see a Build (from latest commit) button in Blue Ocean. I've got to be missing something, right?!
In Classic View you have "Schedule a Scan for pipeline" so, if you've just pushed something to git you can Rebuild.
However, in Blue Ocean you just have the Replay button (which just runs the last commit it has already pulled down).
How do you force Blue Ocean to pull the latest commit?!

When you view the last build for a certain branch, there is a "reload" style button on the upper right side. This allows you to run a build again:
In the Activity screen, the same button is also visible:

Currently, there is no rebuild option in blueocean see here

Related

How to change the development branch in BitBucket?

How do I change the development branch for my BitBucket repository? Right now my master branch is labeled as both the main and the development branch.
This is a near duplicate of this question: How to change the main branch in BitBucket? however, I couldn't find anything telling me how to change the label for the development label and since it is different enough, I thought it warranted its own post for anyone in the future looking for this answer. (the top answer there is pretty clear so I copied the format he used)
Repositories
Select repository
Click Repository settings (bottom of menu)
In the menu under WORKFLOW select Branching model
Should see a screen that looks like this at the top
Click the dropdown menu under Development branch and change it to Use specific branch.
After that you should be able to click the dropdown menu next to it and change it to whatever branch you want
Make sure to hit save at the bottom
After saving it might take like 30 seconds but when you go back to your branches they should now have the DEVELOPMENT label changed to the branch you specified
I do not know how to do this from the terminal.

Cannot see stages times in Jenkins pipeline

As you can see from the image below, even if the build #5 terminates correctly, I cannot see the elapsed time for each stage.
The only thing that I did in the pipeline was to remove old builds with the following code (inserted in URL/script):
item = Jenkins.instance.getItemByFullName(JOB_NAME)
item.builds.each() { build ->
build.delete()
}
item.updateNextBuildNumber(1)
This might not help fully, but what happens if you go to Blue Ocean?
There's an "Open Blue Ocean" button in the left-hand menu which should take you to the pipeline view in Blue Ocean.
I find that the old UI is somewhat buggy regarding the pipelines and stage displays.
I tried to create another pipeline, create a stage with a print inside and do a number of fake builds. Then, I ran the script that I posted in the answer and when I tried to do another build the stage view was empty. Then, I restarted Jenkins and now I can see the stage view.

Jenkins GitHub org last build status icon

I have Jenkins configured such that it scanned my entire organization and created jobs for every repo that had a PR with a Jenkinsfile. This worked fine and I'm getting the builds running.
My problem is these repo icons on the left column:
These are supposed to be "status of last build" icons. Is there any way to change this? This is really not useful as I need to click into each job to see what the last status was.

Where is the Blue Ocean pipeline editor?

Where is the pipeline editor located within the Blue Ocean Jenkins plugin?
I can see my pipeline jobs, and when clicking into these I cant see any links\buttons that take me to the editor.
I'm sure in previous beta releases I could get to it, but now since the official release has been launched which I am now using, I cannot find it.
Anyone know where it's hiding?
Use following url to open the pipeline editor:
http://<host>:<port>/jenkins/blue/organizations/jenkins/pipeline-editor/
In addition to Prashant Kajale's answer, you can edit a specific item with
[Url of Jenkins]/blue/organizations/jenkins/pipeline-editor/[item-name]
Edit: According to the issue tracker, saving doesn't work with none-github repositories. You have to go to [Url of Jenkins]/blue/organizations/jenkins/pipeline-editor/ and open the load/save dialog with Ctrl+S, paste you Jenkinsfile (if you have one yet), edit it, and then save it manually by using Ctrl+S and copy.
It is hidden and does not show up until you hover over. I suppose simply a bad UI
design.
Open Blue Ocean from a job.
Select a branch from Branches.
Hover over to the right and buttons will show up.
Select "Edit" and the editor will open.
There is an open bug where the editor links do not display when the job is moved to a folder.
https://issues.jenkins-ci.org/browse/JENKINS-46441
There is two possible reasons why the pipeline editor button isn't showing, either you're not logged in as a user or you're pipeline project is not into github repository.
Blue ocean doesn't support yet generating pipelines with blueocean-pipeline-editor-plugin when your SCM is bitbucket or gitlab or any other git tool.
The good news is that we will have editor support for Bitbucket and plain Git (which will include Gitlab) in our 1.3 release soon.
You can find more details about this issue here
In the Blue Ocean pipeline view, there's a pencil icon on the upper right that lets you edit. So if you click an entry under the Activity tab, if you click any run of the job it will take you to this (green indicates a successful run):
An example URL for a pipeline named my-pipeline would be:
http://localhost:8080/blue/organizations/jenkins/my-pipeline/detail/jenkins/1/pipeline
After installing Jenkins (either for Windows or Linux), you will need to install the plugin for Blue Ocean:
https://www.jenkins.io/doc/book/blueocean/getting-started/
How To Use Blue Ocean and edit an existing pipeline
After installing Blue Ocean and creating a small pipeline, you should be able to see this context menu:
Then, you will see your pipeline in a new "dashboard". Click on the row for the pipeline you need to work on:
You will get another "dashboard" looking screen. Editing is done from the configuration button (the gear icon) on the top menu:
This will take you to the Classic UI look, click on the Pipeline tab:
This is a complicated UI that either is designed to dissuade you not to use it or is in a desperate need for a redesign, in my opinion.

Pushing tags to github no longer causes travis to rebuild?

For at least several weeks I've been using tags to deploy releases to github. I commit some changes, travis builds cleanly (or not, in which case I push some more changes :-) ), I decide it's ready to release, I create and push a tag. Travis builds again and the deploy script puts the release artifacts on github. It's marvelous.
If you look at the build history here, for example: https://travis-ci.org/ndw/xmlcalabash1-xmlunit/builds you'll see what I mean.
Yesterday afternoon, I decided to release so I pushed a 1.1.1 tag. You can see that on github: https://github.com/ndw/xmlcalabash1-xmlunit/releases but travis didn't see the commit of the tag or didn't react to it or something.
I did this on several repositories and the result was the same in each one (and had also previously always worked). I deleted and repushed the tag, but that had no effect either.
I don't think I changed "anything else". The only difference I can think of is that several hours elapsed between the last code checkin and the tag checkin.
Clues most humbly solicited.
It appears to be the case that if the last non-tag commit push used [ci skip] then pushing the tag won't cause travis to rebuild. That was...confusing.

Resources