build now option is not coming for job in jenkins - jenkins

I am new user to jenkins. My jenkins version is 1.594. When we got the confirmation from jenkins team about onboarding the jenkin job, i did not find the build now option for the job.

I just bumped into the same problem, but none of the mentioned solutions worked. I had created a new job using the Copy from functionality. I was then sent to the job configuration page. I left this page without pressing Save or Apply, and the Build now link did not appear. I then went back to the configuration page, pressed Save, and the Build with parameters link became visible.

Add one more possible answer:
Under some circumstances, you may automatically logout and stay at the same page(no button available), try login again fixed my problem...

Build now option does not come in either of the below reasons:
Project might be disabled. Please enable it or ask the concerned team to enable it.
You do not have enough permission to build the project. Please raise the concerned permission.

You can choose "This build is parameterized" in configure and add a dummy Boolean parameter, check default value.
Then you will get a build button

Another reason why "build now" might not appear is if your Jenkins couldn't find your Jenkinsfile. Scan your project and check the log.
If you find a line that says 'Jenkinsfile' not found, then that's your problem. Check the git repo and make sure the file is there and make sure there isn't a typo in the name.

In my case, I had accidentally hit the red X on Behaviors (under Branch Sources with a multi-branch pipeline). The default behavior "Discover branches" should be there. You can put it back by choosing the Add option below.

Related

VSTS, create build definition gets AllowScriptsAuthAccess error

long time listener, first time caller!
I've spent two days searching for an answer to this so hopefully someone here may be able to help.
I've set up a personal/free VSTS instance and created a project.
One of the first tasks I want to do is setup the build pipeline, so create a new pipeline, define the agent pool as VS2017, connect to my Github repo etc, all of which is fine.
Next I try to add an Agent Job, again choosing VS2017 as the agent. With no other options chosen, if I try to save the build definition I get the following error message (and cannot save it);
The AllowScriptsAuthAccess build option is not supported in API versions greater than 4.0.
Allow scripts to access the OAuth token is unchecked on the Agent job configuration under phases and on the Build/Options tab (slider set to disabled)
I've googled and searched for all sorts of stuff to try and find someone with the same problem but it's almost like I'm the first to discover this - which is highly unlikely!! It has almost driven me to using Bing to search for a solution, but let's not get carried away.
Any ideas or suggestions would be greatly appreciated!
So it turns out that turning off the "New YAML pipeline creation experience" and "New Navigation" under preview features fixes the problem, insofar as I can now create and save a build pipeline without the error.
Also, if you have "Build YAML Pipelines" enabled under preview features for the Organisation, you get the "View YAML" link that I was missing also.
Thanks all for your help. I'd be interested to know the root cause of this still. I'll update the Microsoft support ticket with the same and post back here if they have any insights.
There's an similar issue here:https://developercommunity.visualstudio.com/content/problem/123012/getting-multiconfiguration-build-option-not-suppor.html
Seems the build template was broken. So, you can try with other build templates or starting over with an empty template, then add the needed tasks manually to check if that works.
Besides, you can try below things:
Clean the caches on your client machine, also clean the browser
caches, then check it again. See How to clear the TFS cache on
client machines.
Create a new team project and create a new build pipeline within the
new team project to check if that works
I am assuming this is a bug in the VSTS system and it will likely be fixed soon. But for the time being, I found a workaround:
I was also getting the AllowScriptsAuthAccess error and struggled with it for hours. I don't think any of the configuration settings you mentioned have anything to do with it (free account, GitHub, OAuth token unchecked).
To solve it, I converted the Agent Job to YAML (which is as easy as clicking "View YAML" in the upper right). Save the code to a file named .vsts-ci.yml, and save this in the root folder of your solution. Commit/push the new file, then queue the build. (Note that the conversion to YAML is one-way, so you may want to Clone your build.)
That should get rid of the AllowScriptsAuthAccess error. After that I had to add a few variables, but then it's just a matter of following the error messages.
I hope this helps. Sorry I can't answer this more authoritatively. Please post a comment if I am missing any steps.
I had this issue and it turned out that I didn't have Build Admin permissions in VSTS for the project. Not a very helpful error message for this.

Jenkins “Keep this build forever” button is missing

I am an admin on our Jenkins master but, this button is not available for any builds for any user.
I found this question which has a somewhat relevant answer since we are also using Matrix-based security, however no one has this button showing up on any build
Is there a plugin required to have this feature available?
My version isJenkins ver. 2.105
Keep forever option appears only when relevant, meaning only if you opt in on other option Discard old builds. If not it's irrelevant see jenkins users answer
option only appears if you have chosen to Discard Builds
from the config for the job. (i.e. if you have chosen not to discard
any builds have a certain time/build number, then the button won't
show).

Configuring a workflow to be used with a gated check-in

I am trying to setup a gated check-in policy, but I am running into an issue with my workflow.
In the build definition menu, I select Trigger -> Gated Check-in.
This gives me the error...
"The trigger you selected in the trigger tab cannot be used with the Build Process template you specified on the process tab. (It supports the build reasons Manual, IndividualCI, BatchedCI, Scheduled, ScheduleForced, UserCreated)"
Anyone have an idea as to where I can select which build reasons it supports?
I looked through all the code in the .xaml file, but I did not see anything that stood out as being the issue.
Any help here would be greatly appreciated.
The Build Workflow has an argument called SupportedReasons that usually has a default value set. Try changing the default value of this argument.
I solved this by pasting the contents of this xaml file into an existing xaml file that I knew could be used as a Gated Check-in template.
I don't know what the difference is, but this did the trick.

"Delete Build in Jenkins after Keep Forever"

I've used the Simple Promote Plugin in Jenkins and it set my build to "keep this build forever".
Is there any way I can delete it?
I got access to the slave who build it and to the master (tried to find anything related in there but no luck).
I'm not sure whether (or how) the Simple Promote Plugin affects this at all, but can't you just click the button that says "Don't keep this build forever", followed by "Delete"?
When a build is marked as "keep forever" (and the padlock icon shows next to the build), you should be able to "unlock" it by pressing that "Don't keep..." button on the build page.
Just as Christopher said, you can remove the build just by deleting the build directory on the master, inside the job directory.
However if you access the page again, the build data gets dumped to disk again. So you either shut down Hudson first, or you go to the Hudson management console and 'Reload Configuration from Disk' which basically discards whatever's in memory and reloads from your config files.
Just make sure you do it right after deleting the folder.
In order to delete builds marked "keep this forever" you should change that flag to opposite state.
Please follow next steps
Open within a text editor $HUDSON_HOME/jobs/job-name/builds/xx/build.xml
Change
<keepLog>true</keepLog> to <keepLog>false</keepLog>
Go to Manage Jenkins -> Reload Configuration from Disk
After these steps you will be able to delete build marked as "keep this forever"
I think that the final (and may be the only one step) to completely delete build from Hudson's history is to modify "nextBuildNumber" file placed in job directory.
Please remember that "Don't keep this build forever" button will only appear when you enable "Discard Old Builds" inside job configuration. I am not sure if it affects Simple Promote Plugin, but it work in this way with 'Release Plugin'.
MichalT
Not sure about masters and slaves, but there is an answer here that allowed me to delete a build "explicitly marked to be kept".
List all keep-forever builds in Jenkins?

What causes TFS to create additional workspaces?

I've seen the question related to the error message you get from TFS when a workspace is already mapped. The accepted answer for removing the workspace is alright as a workaround, but it's already getting tedious to run a delete command each time this error occurs.
What do I need to change in order to get out of having to use this workaround? I've got two builds (continuous integration and nightly deploy), and need to add at least one more build type. I followed this URL to see if there was a possible resolution there, but I'm not sure I understand it completely.
I am not sure how this is accomplished in TFS 2010, as I have not gotten to work with Team Build in 2010, yet. In 2008, though, if you expand the Builds node in the Team Project and right-right click on either of the builds, you will see a "Manage Build Agents..." option. Click into that, and it will bring up a dialog. One of the things on that dialog is an option called "Working Directory". Do you have the same hard-coded path in both of them?
By default, when you create a new build definition, it provides a calculated folder for this value. This is where the build agent will do the checkout from TFS for the build attempt. The default value is, $(Temp)\$(BuildDefinitionPath), I believe (I am not connected to TFS at the moment).
The article you link to is basically saying that you should include either that $(BuildDefinitionPath) value or the $(BuildDefinitionID) value as part of that path in that dialog so that the two builds do not try to use the same workspace. Changing the working folder to include one of those values should resolve your issue, going forward.

Resources