w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
While Sending Html Mails from my web application Recieved Mails contains Symbols like &ldquo,&rdquo, ‘
Check with another constructor for htmlView: ContentType mimeType = new System.Net.Mime.ContentType("text/html"); var htmlView = AlternateView.CreateAlternateViewFromString(bodyMessage, mimeType);

Categories : Asp Net Mvc

Is there a good example passing build parameters with Python jenkinsapi and why is the below example failing?
Looking at the code of job.py, it seems like it should be build_params, not params def invoke(self, securitytoken=None, block=False, skip_if_running=False, invoke_pre_check_delay=3, invoke_block_delay=15, build_params=None, cause=None):

Categories : Python

How to download one of the children of a zipped file
There are a bunch of examples in the php documentation : http://php.net/manual/en/function.zip-open.php Just open the file, unzip it to a directory and then server the one you want. This setup makes me question if you should just have the unzipped files on your server ready to go but that's you choice.

Categories : PHP

Unable to download the created zipped file correctly from server
See JSF 2.0 RenderResponse and ResponseComplete The problem is that you do not call FacesContext#responseComplete(). That's why JSF will still render the view after you attached the download and append that to the response. This will cause the zipfile to be broken.

Categories : JSF

How do I use the socks module in Python to download a webpage?
I'm guessing a bit here as I haven't used that socksipy module but... you probably need to send a header first s.send('GET / HTTP 1.1 / Host: localhost'); or some such.. "" might even work. and then read the buffer from socket as in: resp = s.recv(4096); while (len(resp) > 0): print(resp); resp = s.recv(4096);

Categories : Python

Retrieve id of Jenkins build started with the API using the "location" information in header (new feature of jenkins 1.529)
You need to add a header to your request: Accept: application/json And then it should work. Believe it or not, I had to read the source to figure this out... you can read the relevant snippet here. EDIT: Apparently, though this does return the information for the project, it doesn't return the job that has just been queued! It's a known issue. The bug is #13546.

Categories : Python

Jenkins- build fail with java.lang.NoClassDefFoundError: jenkins/mvn/GlobalMavenConfig
In general, NoClassDefFoundErrorin Java comes when Java Virtual Machine is not able to find a particular class at runtime which was available during compile time. You may take a look at javadoc and great blog post. It seems that version of maven-plugin in in <Full path to jenkins.war>/WEB-INF/plugins is newer than version of jenkins-core in <Full path to jenkins.war>/WEB-INF/lib and jenkins/mvn/GlobalMavenConfig was added in 1.515, so your maven-plugin version may be >= 1.515 and jenkins-core version may be < 1.515. Perhaps, you either followed steps that are mentioned here or there is something wrong with your jenkins.war. How to verify it: Check jenkins version and also jenkins-core-<your version>.jar. You may found jenkins-core-<your version>

Categories : Jenkins

python 2.7.5 failed to build module when install the gentoo prefix
Try this: mv $EPREFIX/tmp/usr/lib/libpython2.7.a $EPREFIX/tmp/usr/lib/_libpython2.7.a as mentioned from the following link: http://forums.gentoo.org/viewtopic-t-890016-start-0.html Also look at this post for resolving some of the modules if the above doesn't work: http://www.kelvinwong.ca/tag/python-2-7/

Categories : Linux

Jenkins run batch command only at periodically build and not at polling build
If you have two sets of actions to do, then you might really want two different jobs. This is in fact how most of the projects I have setup run. There are both periodic (daily) and polled scm (commit) jobs. The heavy lifting (clean build, code analysis, extensive testing, scm metric gathering) is only done for the daily builds. The commit builds are kept light weight (incremental build, smoke tests).

Categories : Batch File

Ant via Jenkins: "BUILD SUCCESSFUL" in Console Output while build is still running
That Build Successful message is from your Ant process completing. If you run Ant on the command line, you see the same message. Jenkins, will print out Finished: Success when it actually completes the entire build and does all post-build processing. If you do any post-build stuff (email on bad builds, run the CI game, archive artifacts, display unit test results, etc.) the Jenkins build will continue long after the Build Successful message. In one of my builds, Jenkins takes an extra three minutes to complete my build after that Build Successful message.

Categories : Java

Can I use jenkins to trigger Build on another jenkins
By the sounds of it you don't need another jenkins instance but a jenkins slave. This is used to build jenkins jobs on other platforms. I have slave that run on WinXP, Win7 32bit, Win7 64bit and Ubuntu. However my jenkins instance runs on Ubuntu (not the same as the slave). This way jobs can be created with specific labels that will correspond to labels on the slaves. Example: job 1, label: ios job 2, label: winxp jenkins master: label ubuntu jenkins slave1: label ios jenkins slave2: label winxp This way job 1 will only run on slave 1 and job 2 will only run on slave2 and you don't need to do anything about it.

Categories : IOS

When trying to build a Python executable with Pyinstaller, fails to find an existing scipy module
Not entirely sure why, but including the following definition in my code after the import statement fixed it: def fix_dependencies(): from scipy.sparse.csgraph import _validation

Categories : Python

Jenkins - Keep workspace permanently and update; Build separate jenkins jobs within that workspace
Yes, this should be possible. Set your primary job with a custom workspace and have it store the files in a networked location, and then set up the scripts from your smaller jobs to access those files directly. We use clearcase and i had set up something similar with snapshot views. Your first job will just have the scm step, and your smaller jobs will only pull the files for your project.

Categories : Jenkins

Access Jenkins build log within build script
You can do something like this in the Post Build section, but I don't think you can do it earlier in the job. With the groovy post build plugin you can get information from the console log: if(manager.logContains("text to find")) { do something }

Categories : Jenkins

In Jenkins, if next trigger build is in pending state then how to abort running build and start running next pending build?
Based on the comments, if sending too many emails is the actual problem, you can use Poll SCM to poll once in 15 minutes or so, or even specify quiet time for a job. This will ensure that build is taken once in 15 minutes. Users should locally test before they commit. But if Jenkins itself is used for verifying the commits I don't see anything wrong in sending an email if build fails. After all, they are supposed to know that, no matter even if they fixed it in a later update intentionally or unintentionally. But if you still want to abort a running job if there are updates, you can try the following. Lets call the job to be aborted as JOB A Create another job that listens on updates same as that of the job that needs to be aborted Add build step to execute groovy script In the groovy s

Categories : Jenkins

Change default source directory for perl module Module::Build
use Module::Build; use File::Copy 'cp'; my $class = Module::Build->subclass(code => <<''); sub process_EXTRALIB_files { my ($self, $target) = @_; while (my ($from, $to) = each %{ $self->{properties}{"${target}_files"} }) { cp $from, $to; $self->_add_to_manifest('MANIFEST', $to); } } my $self = Module::Build->new( ⋮ RESOURCES_files => {'RESOURCES/prepare/form.html' => 'RESOURCES/new/prepare/form.html'}, EXTRALIB_files => {'../../LIBS/perl/Private/DB.pm' => '../lib/Private/DB.pm'}, ); $self->add_build_element('RESOURCES'); $self->add_build_element('EXTRALIB'); $self->create_build_script; perl Build.PL ./Build ./Build manifest ./Build dist

Categories : Perl

The Jenkins "trigger build" Service on bitbucket doesn't trigger the build
I've had the same issue with the BitBucket POST hook and having Jenkins' "Prevent Cross Site Request Forgery exploits" checked under the Manage Jenkins => Configure Global Security Settings. Turning that off allows the POSTs to be recognized. You can use the Jenkins Hook in BitBucket if you need csrf support, but you then lose the flexibility of a custom POST hook.

Categories : GIT

Build a Jenkins plugin with Ant
Here is a way to build a Jenkins plugin using Ant. Let's make a script that builds a plugin skeleton which name is "awesome". Default plugin arborescence awesome-plugin/ -- awesome/ -- src/ -- pom.xml Instructions Add a lib/ folder which contains the following jars: to be found in your Jenkins home directory JenkinswarWEB-INFlib (note: you have to use the exact same versions that your current Jenkins use): access-modifier-annotation-1.4.jar bridge-method-annotation-1.4.jar commons-io-1.4.jar guava-11.0.1.jar jenkins-core-1.513.jar json-lib-2.4-jenkins-1.jar remoting-2.23.jar sezpoz-1.9.jar stapler-1.207.jar to be found on the web (you can choose the last version released): servlet-api-2.4.jar Replace the existing pom.xml with the following build.xml. In the Ant script, yo

Categories : Ant

Jenkins build issues
Let's get really, really simple: Jenkins has its own built in Application servlet. Let's try that, and eliminate any complexity due to Tomcat. Jenkins should come with built in Subversion plugin. I don't know if the Git plugin is built in or not. Jenkins installs its tools from the Manage Jenkins->Configure System. It installs the tools under JENKINS_HOME directory. We'll do that. Shut down Jenkins. and try running it directory from the command line: $ java -jar jenkins.jar Take the default Jenkins home (which I believe is .jenkins) and the default port (8080). We're just trying to get everything setup. Don't install any plugins. Don't install any security. We're just trying to get Jenkins to do a checkout now. If you can get Jenkins up and running, it's time to setup a test job.

Categories : Maven

Using ANT properties in Jenkins build job
As it seems there is no solution for my problem, so i built a workarounded for it. I put the output of my ruby script into a file, and send the file via email (as attachment) to a recipient list.

Categories : Ant

Jenkins: build one job after another with some delay
There is a "Quiet Period" option in the Advanced Project Options available. You can enter a value of 300 (its in seconds) to delay the start of the job by 5 mins.

Categories : Jenkins

Triggering Jenkins after TFS build
You have a few options: You could use a GenericTest to trigger Jenkins and include as part of the Build Definition. This also allows your script to communicate pass/fail information back to the build. You could just include an InvokeProcess workflow activity to trigger Jenkins. The process would be similar to this or this. Or you could use a tool that would trigger after a Team Build has finished. Normally people would use tools that then deploy stuff. Most of these tools trigger a Powershell script at some point, which would allow you to trigger the test run: Octopus Deploy TFS Deployer

Categories : Selenium

Repeat build n times in Jenkins
Well, there is no easy solution for this problem, but it can be easily scripted. And there are couple of ways to do that: Using a Build Flow Plugin This plugin will let you script the way that the project build flow is being executed. You can script you builds to run in parallel, to retry the failed builds for as many times as you desire, and much more. I would give it a try and create a script with desired number of retries. I think it'll be your best option to try. You can try using Fail the Build Plugin and either Retry Failed Builds or Periodic Reincarnation Plugin It will enable you to break the build on purpose and then the other plugin will try to build it again and again. It will not be easy to control the number of retries here - you would have to change the status of the buil

Categories : Jenkins

Android jenkins build error
So the below is probably wrong but I'll leave it for posterity. I initially thought this was an ORMLite error but now I think it is a compiler error. I think you should look at this question/answer: Why does the compiler state no unique maximal instance exists? This may be an ORMLite error if part of the exception tree may have have some message to the effect of: Could not find OpenHelperClass because none of the generic parameters of class YourActivityClass extends OrmLiteSqliteOpenHelper. You should use getHelper(Context, Class) instead. The simple ORMLite pattern for Android applications is to have activity extend OrmLiteBaseActivity<YourDatabaseHelper>. Something like: public class HelloAndroid extends OrmLiteBaseActivity<DatabaseHelper> { Then when you c

Categories : Android

Jenkins EnvInject build step
Your problem is that whatever variables you set in the shell script, they don't make it out. This is true for any process: child process (your shell script) can never directly affect environment of parent process (Jenkins executor client). If you need the data to persist, you need to store it outside the script; there are many options like uploading it to a server or storing it in a database, the most obvious and easiest option is to save it to a file. You can even save the value to a "properties file" in the syntax supported by EnvInject and specify path in "Properties File Path" field.

Categories : Jenkins

Get build information from Jenkins API with jenkins_api_client
If you are missing a functionality in the jenkins_api_client rubygem, please open up an issue with detailed description and I'll get that implemented as soon as possible. Thanks, Kannan (author of jenkins_api_client)

Categories : Ruby On Rails

Jenkins Job - Build If SQL Condition True
Of course you can.It can be pretty simple actually. Make a new job in Hudson which automatically runs every 10 minutes.As for the job content,write some shell script to do the sql search. Then if the code returns true, continue with the 2nd step,if not,just end the job.It will be started by Hudson 10 minutes later.

Categories : SQL

Failing a jenkins build for coverage going down
This is a feature that would be available if you used Sonar to host your metrics. How do I make Hudson/Jenkins fail if Sonar thresholds are breeched? Much more flexible solution and Sonar is a very useful tool in its own right, with a plugin available for Jenkins.

Categories : Jenkins

Jenkins - Get last completed build status
Try http://$host/job/$jobname/lastSuccessfulBuild/api/json Jenkins (and Hudson) expose multiple different builds, such as lastBuild, lastStableBuild, lastSuccessfulBuild, lastFailedBuild, lastUnstableBuild, lastUnsuccessfulBuild, lastCompletedBuild.

Categories : Api

Modifying Jenkins Description for a build
I played around with this for a long while... First, instead of doing this: new_description="$new_description<br/> $old_description" to append or prepend the line, I used printf: new_description="$(printf "$new_description $old_description")" By using printf, I put a <CR><LF> instead of just a <LF> in my description line separator. This way, I don't have a jumble of <NL> and <CR><NL> and I'm no longer dependent upon the operating system's definition of the line break. The sed command took me a long, long time to figure out. I tried all sorts of things: old_description=$(sed 's/\r\n/ /g' <<<$old_description) But, nothing seemed to work... I tried the -E flag which allows me to use the extended regular expressions, but it ke

Categories : Bash

Trigger a build in Bamboo from a Jenkins job
It hasn't been updated for a while and I'm not using it currently, thus can't confirm it is still working as desired (the download statistics suggest it being used though), but given there's not much to it, you should be able to achieve the first part of your use case with the Bamboo Notifier, which allows you to Trigger a Bamboo build upon successful completion of a Jenkins job. The second part should be covered by the Bamboo TestNG Parser task, though you'll need to push your existing test result files to Bamboo by some means of course, possibly by Using the SCP task in Bamboo.

Categories : Rest

jenkins uiautomator build always green
You need to check the exit code of every adb statement you are running before moving onto the next This post here details checking exit codes with bash Bash Beginner Check Exit Status which includes this (changed for your example) function test { "$@" status=$? if [ $status -ne 0 ]; then echo "error with $1" exit "$status" fi return $status } test adb shell uiautomator runtest myTest.jar -c com.myTest.TestClass1 test adb shell uiautomator runtest myTest.jar -c com.myTest.TestClass2 You can also tell Jenkins to use bash by adding a shebang to the first line of your script #!/bin/bash

Categories : Android

jenkins error after build successfull
As I see, the problem comes at a post-build action! Maybe, you don't have any data in the input file for JDepend, as I see from the error log. You must see if you give the correct path to the file and also, you must be sure that the file have some content... maybe the path is correct but the file is empty...

Categories : Jenkins

Unknown assertion failure in jenkins build
The finally found reason is that innocent line: GmbH' '' -showBuildSettings The double quote '' is a remnant of an accidentally unset environment variable which is filled correctly in the other cases. Problem solved.

Categories : IOS

Tycho build fails on Jenkins only for SCM Trigger
I have heard repeatedly of vague problems with Tycho builds on Jenkins. The reason for these problems seems to be that some Jenkins plugin triggering these builds hooks into the Maven lifecycle and this somehow collides with what Tycho does in the Maven internals. For the problem that you are describing, it seems that the Jenkins plugin that you are using is changing the module build order. This may be okay for a normal Maven build (where all dependencies are declared in the POMs), but may fail for a Maven/Tycho build, where dependencies are computed by Tycho during the build. To avoid this problem, you should trigger the Maven build in a way that is closer to a normal command line build. I found that the Invoke top-level Maven targets build step from the Maven Integration plugin works w

Categories : Maven

Jenkins: Use Archived Artifact in Promoted Build
You can use the Copy Artifact plugin. Set it to copy artifacts from the main project, and choose Specified by permalink where the permalink is Latest promotion: this promotion process. (Note that since the promotion configuration refers to itself here, you cannot add such a promotion in one step: you must add the promotion with no build step, save, then go back and add the build steps.)

Categories : Java

Jenkins share build number across jobs?
You could look at the multijob plugin where you can add multiple parameterised jobs in to a containing job https://wiki.jenkins-ci.org/display/JENKINS/Multijob+Plugin You could also look at artifact archiving Archive the artifacts in hudson / jenkins and then pick the files up later

Categories : Jenkins

Issue in locating build binaries from jenkins
I would advise configuring your build to push artifacts to a dedicated binary repository like Nexus. This is the best way to expose such files to other tools like Maven. Another alternative to look at s the Maven Repository plugin which turns your Jenkins server into a Maven repository.

Categories : Jenkins

Jenkins logs for a perl build file
A few things you should understand about Jenkins: Jenkins shows STDOUT as the log of the Job, so if you redirect it to a file - nothing will be shown in the log. Depending on how you have set it up, Jenkins may run as its own user, which may change the behavior of your scripts. You can confirm this by echo-ing the username at the beginning of your Execute Shell block, for example: echo $USER Each Jenkins-Job is run from its own workspace - you can confirm that location by simply printing the current working directory at the beginning of your Execute Shell block, for example: echo my current directory is pwd

Categories : Jenkins

parameterized build configuraion in jenkins with git Commit id
Yes you can parameterize your build with two string paramaters (BRANCH_NAME and COMMIT_ID). You should enter a default for the branch, so that whatever branch you use most (hopefully master) is automatically populated. Defining parameters is discussed in detail here. In the branch specifier section (under branches to build) enter the following: */$BRANCH_NAME $COMMIT_ID This will make it so instead of "Build" you will have "Build with Parameters". Manually triggering the build will cause you to be prompted to enter the branch name and commit. For the commit, you can either enter the whole hash or just the first 7 characters.

Categories : GIT



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.