At work we have recently started using Jenkins.
I would like to be able to see the basic status of builds from within Vim.
Is there a typical or standard way of doing this?
Currently i am using my own script which interacts with the jenkins API but it seems unlikely to me that there would be no more common ways of doing something which i think rather a lot of people would want to do.
You can use this vim plugin, which I have developed;
https://github.com/burnettk/vim-jenkins
Since most apps that use Jenkins going forward will use Jenkinsfiles, I decided to use that as the hook. So what you do is add a comment anywhere in your Jenkinsfile with the path to its build plan, like this:
// BUILD_PLAN_PATH: /view/Sweetapps/job/hot-app/job/master
This comment is theoretically useful even apart from this feature as documentation, but its purpose is for the plugin to parse it to figure out how to interact with the jenkins API to fetch the build status (FAILURE/SUCCESS/etc) for the build plan that goes with this Jenkinfile. Once the comment is in place, fetch your build status by running:
:JenkinsShowLastBuildResult
Or its shortcut ("jenkins build"):
<Leader>jb
The build status will be echo'ed into your vim window.
My favorite feature is still Jenkinsfile validation. I use it multiple times a day.
:JenkinsValidateJenkinsFile
or the shortcut (short for "jenkins Jenkinsfile"):
<Leader>jj
Hopefully people like the features, and maybe get some ideas about other features that might be useful to add. Pull requests are of course welcome. I intend to add a feature to open the same build plan that is already documented in the Jenkinsfile in a browser window (using mac "open", but probably if anyone cares to make it work on linux or windows, it would be possible).
Related
I have an API that checks for holiday and runs/not runs a build based on the result. The problem now is that I have to manually change Jenkins jobs to include that logic which is obviously very inefficient. Is there a way/tool to quickly add/remove that check or any other checks in the future to specific jobs quickly without going through them one-by-one? I could see maybe using Jenkins API as one option, is there anything else?
Thanks.
User JobDSL you can programmatically solve your problems in one place with a Groovy DSL.
https://wiki.jenkins-ci.org/display/JENKINS/Job+DSL+Plugin
I've just started to get to grips with Jenkins. It currently performs the following tasks:
Pulls the latest codebase from git
Uploads the codebase via sftp to my environment
Sends a notification email to the testers and the PM to inform them of a completed deployment.
However for it to be truly useful I need it to perform two more tasks:
Delete the robots.txt and .htaccess file which exists in the git repo and replace it with a predefined version which is specific for the server
Go through all the code and remove specific code-blocks (perhaps something in between comments: eg. /** Dev only **/ Code to be removed goes here /** Dev only **/ or something like that).
Are there any plugins which can accomplish these things or would I have to read up on writing groovy scripts for this sort of thing (I don't know anything about those yet).
On a related note: I'd also love it if it could combine kit and SASS files, however I can't see a plugin for these things, however I assume I can just install compass on my build server and then run it via command line in the build process. Is that correct?
Instead of putting your build tasks directly into the Jenkins job, I recommend writing a build script to accomplish your publishing/deployment tasks.
Jenkins is great for having a single point of automation that is easy to run, can publish build results, and can track successes and failures. In my experience though, you're better off not putting your individual tasks and configuration steps into the Jenkins job configuration. At some point, you'll want to be able to run this job without Jenkins, either because you want to test local changes, or you want to handle multiple jobs and trying to keep job configurations in sync is not fun, or because you're moving to another build/deployment system. Also, putting the build script into a file allows you to put it into your source control system and track changes.
My advice: choose a scripting language (Python, Ruby, Perl, whatever you're comfortable with) or build system (SCons and Rake are options) and write a build script. In Python Ruby, and Perl, it's easy to manipulate files (#1) and all have a wide choice of templating systems that will accomplish #2. Then the Jenkins job becomes running your build script on the command line (or executing through a language-specific builder). And the build script can include running any of the tasks that you decide to put in your build (compass, etc).
How can I schedule a build without tag over Windows, Linux and WCE in Hudson using a shell script and generate a report that will be sent to a specified server?
And so the conditions are :
1. How can I create the build without creating a new tag?
2. How is it possible to excute .sh over windows and WCE (Windows Mobile), is it simply by going through Cygwin? Moreover, having a cross-platform (3 platforms) build does it mean that I must run the build 3 times?
3. How to generate a report and save it in a directory of a server that I'm authorized to access to?
I know that I asked many questions at once. It is because this is my first use of Hudson and these are kind of details. Moreover, I don't want to make a mistake by creating new tags during my tests. The 1st and 3rd questions are the most important. If anyone gives me the right answer to them, I'll choose it as the right answer.
Thank you a lot.
first, people nowadays mostly use jenkins instead of hudson (open source, better support)
build can be started manually in hudson / jenkins, just click the green arrow. It will create a new build but won't change your repository (unless the last step of your build is creating a tag, in that case, just remove that step for testing)
Usually, .sh scripts run in shell excecutables (ash, sh, bash, csh...) and are not supported of the shell on windows. You'll have to go through cygwin or have a platform specific build command
kind of not clear for me. If you use jenkins to build a matric build (with the matrix axis being your target platform), you'll have automatically a nice report in jenkins itself (status of each build). You can keep artifacts (use post-build action : archive the artifacts) or use another plugin to publish the file you like (exemple : ftp reporting)
Sorry not being able to be more precise, that's how far I understand your questions.
This question made me crazy!Please help me.
I use the buildbot, VC tool is perforce 2010.
Waterfall: ok
but console view cannot work right.
just print "No revisions available"
If you are using the Periodic scheduler, then buildbot isn't made aware of the revisions in your repository, it just checks every time, and builds the most recent version. Since it doesn't know anything about revisions, it can't display anything sensible for the console view.
To get the console view, you need to tell buildbot about your revisions, either using buildbot.changes.p4poller.P4Source, buildbot send-change or contrib/post-build-request.py. And then trigger your builds using a regular scheduler, rather than a periodic one.
It's probably something environmental in the configuration, such as the Perforce username or the Perforce client spec. The tool is probably issuing a 'changes' or 'sync' command, and since it's not using the workspace definition that you expect, it isn't finding any code in that workspace.
I have a couple of dependencies in my Java project on 3rd party libs, and some of them are undergoing development that I would like to track.
I would like to be able to be notified, (By email, desktop popup, or otherwise) when changes are committed to the remote svn repo so I can examine their impact etc.
I looked at svnmailer, but it would seem to require the repo to be local (I think??)
also I found some windows tools that do the job, but I am running linux desktop. so no go there.
worst case, I can do some cron script to poll for remote changes using the command line tools, but I would prefer some existing tool.
Sounds like a good use for a continuous integration server. Something like CruiseControl or Hudson are designed for this use case - the whole point of them is to to check your source control regularly, retrieve any changes, build the project and notify someone. In this case, it sounds like you don't even need to build the project, just send an email anyway.
If you don't already have a CI server this might seem like a little overkill but I bet once you've got one set up you'll find yourself using it again.