What is the preferred way to disable the periodical build when it has failed? Quick search showed that there is a Prerequisite build step plugin, but that fails the build, and I need the build to be completely disabled until manual intervention.
Thanks.
Okay, I think I managed to find a solution.
Retry Failed Builds plugin didn't work because it could not override the default project schedule, so the failed project got built again and again.
Naginator plugin didn't work because the delay is not configurable.
Prerequisite build step plugin is not suitable.
The solution is to install the Groovy Postbuild Plugin, which is run under the Jenkins JVM and exposes the Jenkins instance publically. So it is possible to programmatically disable the current build directly in the Project configuration:
if (manager.build.result.isWorseThan(hudson.model.Result.SUCCESS)) {
manager.build.project.disabled = true
}
There is a button "Disable project" on the project status page. I simulate button click by HTTP POST message with data "Submit=\"Disable Project\"" like this
wget --post-data "Submit=\"Disable Project\"" ${JOB_URL}disable
right from the bash script which runs the build (project). The whole code can look like this
set +e
# Run test/build
# ....
if [ $? -ne 0 ];
then
wget --post-data "Submit=\"Disable Project\"" ${JOB_URL}disable
# Or you can use following to disable one job from another
# wget --post-data "Submit=\"Disable Project\"" http://<Server>/job/$JOB_NAME/disable
exit -1
fi
This is a rather old question, so I guess there was no Disable/Enable button in Jenkins GUI than. If Jenkins is protected by a password you will need to make wget to login first, store cookies in some file and in the second file add the cookie.
Related
For internal messaging the company I work for uses Slack. It allows for a lot of awesome integration with tons of different software and services. I'm making my own bot for sending webhooks to Slack.
I got everything set up and working, I have a Perl script that sends a JSON payload. If I trigger the script manually, everything works flawlessly and my Slack bot sends messages.
However, when the script gets triggered by Finalbuilder (Software for automatic build processing), it it fails.
I get the following response:
501 Can't load 'C:/Strawberry/perl/site/lib/auto/Net/SSLeay/SSLeay.dll' for module Net::SSLeay: load_file:The specified module could not be found (LWP::Protocol::https not installed)
So I figured I needed to install the "LWP::Protocol::https" module. I just opened my cpan client and wrote install LWP::Protocol::https
Still get the error after installing the module.
I wrote test LWP::Protocol:https, which gave the following response:
Running test for module 'LWP::Protocol::https'
Running make for M/MS/MSCHILLI/LWP-Protocol-https-6.06.tar.gz
Checksum for C:\Strawberry\cpan\sources\authors\id\M\MS\MSCHILLI\LWP-Protocol-https-6.06.tar.gz ok
Scanning cache C:\Strawberry\cpan\build for sizes
............................................................................DONE
CPAN.pm: Going to build M/MS/MSCHILLI/LWP-Protocol-https-6.06.tar.gz
Checking if your kit is complete...
Looks good
Writing Makefile for LWP::Protocol::https
Could not read metadata file. Falling back to other methods to determine prerequisites
cp lib/LWP/Protocol/https.pm blib\lib\LWP\Protocol\https.pm
MSCHILLI/LWP-Protocol-https-6.06.tar.gz
C:\Strawberry\c\bin\dmake.EXE -- OK
Running make test
C:\Strawberry\perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0,'blib\lib', 'blib\arch')" t/*.t
t/apache.t ....... ok
t/https_proxy.t .. 1/56 # creating cert for direct.ssl.access
# creating cert for direct.ssl.access
# creating cert for foo
# creating cert for bar
# creating cert for foo
# creating cert for foo
# creating cert for bar
# creating cert for bar
t/https_proxy.t .. ok
All tests successful.
Files=2, Tests=61, 8 wallclock secs ( 0.02 usr + 0.01 sys = 0.03 CPU)
Result: PASS
MSCHILLI/LWP-Protocol-https-6.06.tar.gz
C:\Strawberry\c\bin\dmake.EXE test -- OK
I can trigger my script with windows CMD, or Finalbuilder. Both will work just fine, but when the Finalbuilder project gets activated through Continua CI, I get the "can't load ssleay.dll" error.
I have no clue what to do now. Does anyone know how I can fix the Perl error?
I got this same error while running scripts from IDE, but not from command line (same issue).
My command line was adding these to the path. (These were not globally defined).
c:\perl\perl\bin;c:\perl\sup\bin;c:\perl\c\bin;
But the IDE didn't have these. So same fix should work for FinalBuilder, it is missing the perl path information.
Have you loaded the header files? I don't know what they are for Windows but in Linux, they're called: libssl-dev and zlib1g-dev
I also had this error for awhile. In my case the solution was quite simple. It turned out that I hadn't restarted the SVN service, so when it ran the post-commit.bat file the PATH environment hadn't been updated to reflect the new paths that had been added during the Perl install.
While I was testing I was running from a new console window which had the correct PATH, but as soon as it ran from the batch file via SVN it broke, with exactly the same error you posted.
Same problem with IDE Eclipse, command line fine but error with IDE.
I check the location:
C:\>perldoc -l LWP::Protocol::https
C:\zailperl\perl\vendor\lib\LWP\Protocol\https.pm
And I add it to Environments variables.
I didn't want to reboot my PC so I add the parent path to the IDE.
Right click on project.
enter image description here
I'm trying to save an App snapshot on OpenShift, however it complains that my application isn't found. When I type rhc apps my application is correctly listed, not sure what I could be doing wrong.
For example:
appname # http://appname-domain.rhcloud.com
when I run rhc snapshot save -a appname, I get:
Application 'appname' not found.
If the application is not in your default namespace, then you will need to add the -n option to your rhc snapshot save command. That could be your issue.
I have an application in Openshift free plan with only one gear. I want to change it to scalabe and take usage of all of 3 free gears.
I read this blog post from openshift and I found that there is a way to do it. I should clone my current application to a new one as a scalable which will use the 2 remaining gears and then I will delete the original application. Thus, the new one will have 3 free gears.
The way that blog suggest is: rhc create-app <clone> --from-app <existing> --scaling
I have the following error: invalid option --from-app
Update
After running the command gem update rhc, I don't have the error above but...A new application with the given name has created with the same starting package (Python 2.7) just like the existing one, but all the files are missing. It actually create a blank application and not a clone of the existing.
Update 2
Here is the structure of the folder:
-.git
-.openshift
-wsgi
---static
---views
---application
---main.py
-requirements.txt
-setup.py
From what we've talked on IRC, your problem was around missing SSH configuration on Windows machine:
Creating application xxx ... done
Waiting for your DNS name to be available ...done
Setting deployment configuration ... done
No system SSH available. Please use the --ssh option to specify the path to your SSH executable, or install SSH.
I've double checked it, and it appears to be working without any problem.
The only requirement is to have the latest rhc client and putty or any other
SSH client. I'd recommend going through this tutorial once again and double-check everything to make sure everything is working properly.
Make sure you are using the newest version of the rhc gem with "gem update rhc" to make sure that you have access to that feature from the command line.
The --from-app will essentially do a 'rhc snapshot save & snapshot restore` (amoung other things) as you can see here from the source:
if from_app
say "Setting deployment configuration ... "
rest_app.configure({:auto_deploy => from_app.auto_deploy, :keep_deployments => from_app.keep_deployments , :deployment_branch => from_app.deployment_branch, :deployment_type => from_app.deployment_type})
success 'done'
snapshot_filename = temporary_snapshot_filename(from_app.name)
save_snapshot(from_app, snapshot_filename)
restore_snapshot(rest_app, snapshot_filename)
File.delete(snapshot_filename) if File.exist?(snapshot_filename)
paragraph { warn "The application '#{from_app.name}' has aliases set which were not copied. Please configure the aliases of your new application manually." } unless from_app.aliases.empty?
end
However this will not copy over anything in your $OPENSHIFT_DATA_DIR directory so if you're storing files there, you'll need to copy them over manually.
Hi I am using Hudson for source code management. I am able to correctly download the required code from my feature branch and successfully build it.
But I also require to trigger an .exe file once my build has been successful which I am unable to figure out.
Do I have to use some plugin or there is some other way? If it is a plugin please specify how to set up.
Additional Details: I can trigger the exe perfectly from the command prompt but when I write the same command in the Build step of my job, I just get a "Finished: Success" message but not exe has been triggered
You can use Post build task plugin : http://wiki.hudson-ci.org//display/HUDSON/Post+build+task.
To add this plugin in your project, just search for 'post build' on plugin's search page and install it.
After that you can configure on your job's page. It will appear a checkbox with this label: 'Post build task'.
How to enter subversion credentials in Hudson by shell?
I've tried to generate file hudson.scm.SubversionSCM.xml in HUDSON_HOME and reload configuration, but changes weren't applied.
The easiest way to enter a credential from the shell is to use "svn" executable. Hudson recognizes the ~/.subversion/auth directory that it creates.
Under Windows the global credenentials are stored under %APPDATA%\Subversion\auth. The following Groovy code helps generating these credentials:
SVNRepository repository = SVNRepositoryFactory.create(SVNURL.parseURIEncoded(url))
ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager(SVNWCUtil.defaultConfigurationDirectory,"AD\user","password",true)
repository.setAuthenticationManager(authManager)
repository.getDir("", -1, null ,(Collection)null) // or some random SVN operation
Libraries used in the code above (example in Gradle):
compile 'org.tmatesoft.svnkit:org.tmatesoft.svnkit:1.7.8'
compile 'net.java.dev.jna:jna:3.4.0' // so wincrypt is available
Make sure you run the code with the same user Hudson runs on the Windows machine.
Just start with the Hudson.
Install all required Plug-Ins.
Hit the link,EX:-localhost:8080/hudson
Click on the add job/Create job.
While choosing the options SVN will be present there,Give the SVN location.
Credentials link is present out there.Click on that link.
A form will get open,provide valid credentials for that location of SVN.
Observe the Success message on the screen and then get back to the Create job,Complete with Job creation and Build the task.