Cant open Blue Ocean visual pipeline editor - jenkins

Recently I installed Blue Ocean plugin, but I can't find out how to edit or create pipeline using plugin's UI.
When I create new pipeline in Blue Ocean and connect with GitLab repo, I don't have option to create/edit pipeline (Jenkinsfile file). No matter if repo contains it or not. When Ocean connects to git server creation is over.
I cannot open visual pipeline editor via URL ([local-address]/blue/organizations/jenkins/pipeline-editor/[project-name]). I get error alert with message:
Error loading Pipeline
There was an error loading the pipeline from the Jenkinsfile in this repository. Correct the error by editing the Jenkinsfile using the declarative syntax then commit it back to the repository.
Server Error
Meanwhile script works perfectly in Blue Ocean's branches tab. It shows steps, artifacts, outputs, etc.
I've tried also with example, trivial scripts from tutorial pages. None of them can convince visual editor that they are OK. Of course all this scripts are declarative.
Did you have similar problems? Maybe I have to use some special type of Jenkinsflie? Fact that I can't find other way to get to editor other than direct URL seems to be strange.

Blue Ocean's pipeline editor does not seem to work properly, cause it still in development.
Although, I have found walk-around. To be able to edit script in fancy visual editor you have to open editor's sandbox-mode page:
[your_jenkins_URL/blue]/organizations/jenkins/pipeline-editor/
Then you have to use magic shortcut Ctrl+S (cause buttons are old-fashioned). Ta-da you now have access to code of displayed things.
Feel free to paste your code and copy back after making changes using this app.

You can install the replay pipeline feature available in jenkins.
This will allow you to edit your Jenkinsfile and re-run it without committing the changes to your original file (can be done for n number of times). So once you are satisfied with your Jenkinsfile, then you can commit those changes in your original file.
Refer to below link to know more about usage of replay pipeline feature :
https://jenkins.io/doc/book/pipeline/development/

Related

Creating Jenkins Process Job DSL. Interface doesn't show DSL Script box

I have installed Jenkins from https://hub.docker.com/r/jenkins/jenkins. After creating my user and adding the DSL plugin, when I try to create a DSL script the interface does not show the code box.
I have tried to run the docker image attaching a volume so I can use file system files... but I also didn't manage to make that work either... I'm running out of ideas on how to proceed. All the references that I used show the DSL script box after the installation without a problem.
I had something similar happen to me. This text area seems a bit buggy, for me it was always collapsed. There is a handle in the middle which allows you to change the box size. If you can't see it then this might be a different problem (maybe some browser plugin?).
Also might try clicking between Use the provided DSL script and Look on Filesystem, I vaguely remember this handle showed up after I did that. Sometimes just saving the job (with the JOB DSL step added to the job) helps.
A similar issue happened to me, it is happening in the newer versions.
I installed an old version of Jenkins - that old version didn't have this problem

Build trigger don't get saved in Jenkins

We have a nighly build that triggers build of many different projects to verify external testing like contracts and such to avoid triggering such tests on every checkin.
However lately we have encountered a problem, if you open a build configuration and enter any parameter or build triggers and then saves the configuration. Once you save it gives no indication as to an error or anything but if you open it again its not there, no build trigger or parameter gets saved.
We have managed to isolate it to pipeline build, freestyle builds still works.
We installed Blue Ocean recently and are not wondering if it somehow changes how a pipeline job definition is saved. It seems a bad decision if Blue ocean hinders such a basic setting but still. We haven't been able to create a pipeline job throught blue ocean either since our job isn't triggered by any SCM and blue ocean requires that.

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.

Can't find pipeline editor anymore

I have the Blue ocean beta plugin installed and cannot find the pipeline editor. Where should it be? I have the latest version of the plugin installed, I'm sure it used to be an obvious button you could click on when going to the blue ocean view, but it's not there for me anymore.
I encountered the same problem and posted a question in the Cloudbees Community. One of the Cloudbees engineers responded with this:
"At the moment you can only edit Pipelines that have been created through the "New Pipeline" flow.
However, we are going to restore a general link to access the editor as part of our "Pipeline Playgrounds" work. You can follow progress by logging in to Jenkins JIRA and watching JENKINS-43118."
In the JENKINS-43118 JIRA ticket, there is a comment that says
"We want to restore the link to the "Pipeline Playground" mode of the editor in a less obtrusive place.
This was lost as the editor and creation was merged together"
So, essentially I think this was a regression.
Another comment in the ticket mentions that the editor can still be invoked with a URL like "http://localhost:8080/jenkins/blue/organizations/jenkins/pipeline-editor/". ( I think you would insert the project name for the second "jenkins"). And then, supposedly, you can use keyboard shortcuts like Ctrl/Cmd-S to do the Save since the button isn't there anymore. I tried this, but things still appear to be broken, so I think we're out of luck until this JIRA issue is resolved. Too bad.

TFS 2010 custom build step

I am playing with TFS 2010, and am trying to setup a build process that will have some custom steps.
These include things like, stopping/starting IIS, search and replace files etc... across environments.
I have tried to look for examples online and have not found anything clear and meaningful on how to just run a script or something over the source files. Looking at the default build process template (DefaultTemplate.xml) I cant make much sense of it.
How do I go about doing this ?
For info on customising the TFS2010 workflow build templates have a look at Ewald Hoffman's series. Start with Part 1 (archived here).
I should also mention that since it looks like you're doing deployment then you may want to break deployment automation away from build automation.
This is almost exactly what I'd say for this question (Split build and deplyment stages, investigate TFSDeployer). One additional element is more generic - for deployment tasks you can't find an easy integrated tool you should create a custom deployment script. You can call any script by adding an "InvokeProcess" step in your Build workflow. TFSDeployer also has locations where you can insert custom PowerShell Scripts. (If you don't like PowerShell you can have PowerShell or "InvokeProcess" call a different script engine.)

Resources