Launching a slave Jenkins node when a change is pushed to GitHub - github

I'm trying to build a project on Jenkins when a change is pushed to GitHub.
I'm using GitHub plugin and building on a slave node.
If the slave is online, everything works fine. However, if the slave is offline, Jenkins doesn't try to launch the slave node and ignores the notification from GitHub.
The following log is output to jenkins.log when the slave is online:
May 30, 2016 4:16:31 PM org.jenkinsci.plugins.github.webhook.subscriber.DefaultPushGHEventSubscriber onEvent
INFO: Received POST for https://github.com/myname/myproject
May 30, 2016 4:16:31 PM org.jenkinsci.plugins.github.webhook.subscriber.DefaultPushGHEventSubscriber$1 run
INFO: Poked MyProject
May 30, 2016 4:16:33 PM com.cloudbees.jenkins.GitHubPushTrigger$1 run
INFO: SCM changes detected in MyProject. Triggering #22
However, if the slave is offline, the build is not triggered:
May 30, 2016 4:15:58 PM org.jenkinsci.plugins.github.webhook.subscriber.DefaultPushGHEventSubscriber onEvent
INFO: Received POST for https://github.com/myname/myproject
May 30, 2016 4:15:58 PM org.jenkinsci.plugins.github.webhook.subscriber.DefaultPushGHEventSubscriber$1 run
INFO: Poked MyProject
Starting a build by clicking "Build Now" always makes the slave node online. How can I build a project by GitHub changes on a slave node which might be offline?
Update:
I found the following message on "GitHub Hook Log" of the project:
Started on May 30, 2016 6:00:46 PM
We need to schedule a new build to get a workspace, but deferring 561ms in the hope that one will become available soon (all_suitable_nodes_are_offline)
Done. Took 0.23 sec
No changes
Update(2016/06/01):
This is the current slave setting:
Contents of /var/lib/jenkins/bin/start-slave:
#!/bin/bash -eux
gcloud compute instances start ci-slave --zone us-central1-f
ssh ci-slave /var/lib/jenkins/bin/start

Related

Using Render hosting app to deploy my project- Error Cannot find module

Follows Heroku becoming a paid app, I am trying other options.
Does anyone have experience uploading a MongoDB server-based project to "Render" Application Hosting?
This is the repo I want to deploy:
https://github.com/myyoss/FUNDLE_A_WORDLE_CLONE
On the app settings I use for the Build Command: "yarn" (and it seems to works cause I get "Build successful" message).
But for the Start Command I can't get the correct command/path.
I keep getting this error:
==> Build successful :
Oct 7 06:41:33 PM ==> Deploying…
Oct 7 06:42:01 PM ==> Starting service with ‘node dist/server.js’
Oct 7 06:42:06 PM internal/modules/cjs/loader.js:888
Oct 7 06:42:06 PM throw err;
Oct 7 06:42:06 PM ^
Oct 7 06:42:06 PM
Oct 7 06:42:06 PM Error: Cannot find module ‘…/routes/userRoutes’
Can someone please take a look at the repo LINK and tell me what I'm doing wrong?
On an other project I used "node dist/server.js" for the Start Command and it worked just fine.
I think your problem may be here, where you use "../routes/userRoutes". You want to use "./routes/userRoutes" since the location of that file is relative to the root directory, ./
This answer may be helpful re: routing errors, and Render's quickstart for Node/Express is also worth a look.

Jenkins multibranch pipeline job CHANGE_ID not set

I have setup a job with Jenkins with MultiBranch pipeline.
Github is the SCM and is configured, with a webhook to fire a build on a PR commit. (Existing or new PR).
The build is triggered, all goes fine 1, however the CHANGE_ID is not set (null). We need the CHANGE_ID to pass on to Sonar.
I am struggling to understand, in which cases this parameter is set, and why it's null in our case.
Please consider this question from a Jenkins Multibranch perspective.
Our (git related) plugin installations is here [2] .
1 logging from Jenkins.
[Mon Jun 26 11:32:48 CEST 2017] Received Push event to branch BE-7394 in repository ServiceHouse/api UPDATED event from 172.18.0.1 ⇒ http://jenkins2.servicehouse.nl:8080/github-webhook/ with timestamp Mon Jun 26 11:32:43 CEST 2017
11:32:50 Connecting to https://api.github.com using shojenkinsuser/******
Looking up ServiceHouse/api
11:32:50 Connecting to https://api.github.com using shojenkinsuser/******
Looking up ServiceHouse/api
Getting remote branches...
Checking branch BE-7394
Getting remote branches...
Checking branch BE-7394
‘Jenkinsfile’ found
Met criteria
Changes detected: BE-7394 (01293286b6ee34056d8c92e21a6d39d18e537a81 → 35c16ef01bba5d27dd040a881cd3734fef271fd7)
Scheduled build for branch: BE-7394
0 branches were processed (query completed)
Done examining ServiceHouse/api
[2] Git related Installed plugins:
This variable sutup in the branch-api-plugin (setup source) and we have it working for pull requests or change requests.
For branches of the form -, it is not filled.
I can advise you to use:
BUILD_NUMBER
The current build number, such as "153"
BUILD_ID
The current build ID, identical to BUILD_NUMBER for builds created in
1.597+, but a YYYY-MM-DD_hh-mm-ss timestamp for older builds

Can no longer deploy to Bluemix Rules Engine Service

When I originally set up my Rules Engine service in Bluemix, I could deploy from my Eclipse Juno environment just fine. I just tried to deploy a new project this morning, and I got the following error in the deployment report in Eclipse:
ilog.rules.res.model.IlrAlreadyExistException: Unknown RuleApp: /RefillRulesApp/1.0. at
com.ibm.rules.res.internal.MutableRepositoryRESTAdapter.addRuleApp(MutableRepositoryRESTAdapter.java:86)
at
com.ibm.rules.decisionservice.internal.RESClient$3.execute(RESClient.java:332)
at
com.ibm.rules.decisionservice.internal.RESClient$3.execute(RESClient.java:1)
at
com.ibm.rules.decisionservice.internal.RESClient.safeInvokeRES(RESClient.java:132)
at
com.ibm.rules.decisionservice.internal.RESClient.deploy(RESClient.java:299)
at
com.ibm.rules.decisionservice.internal.DsResRestClient.deploy(DsResRestClient.java:168)
at
com.ibm.rules.studio.model.decisionservice.impl.Server.deploy(Server.java:310)
at
com.ibm.rules.decisionservice.DsRuleAppDeployManager.deploy(DsRuleAppDeployManager.java:38)
at
com.ibm.rules.decisionservice.DsDeployManager.deploy(DsDeployManager.java:88)
at
com.ibm.rules.studio.decisionservice.SDsXOMDeploymentJob.deploy(SDsXOMDeploymentJob.java:203)
at
com.ibm.rules.studio.decisionservice.SDsRuleAppDeploymentJob.deployRuleApp(SDsRuleAppDeploymentJob.java:101)
at
com.ibm.rules.studio.decisionservice.SDsRuleAppDeploymentJob.deploy(SDsRuleAppDeploymentJob.java:65)
at
com.ibm.rules.studio.decisionservice.SDsXOMDeploymentJob.runInWorkspace(SDsXOMDeploymentJob.java:81)
at
org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)**
I checked the RES console server log and there isn't any untoward messages in it
The Decision Server version infomation looks like this:
Version: Decision Server 8.7.0.1 , Decision Engine 1.10.0 Patch level: Build #2 on 2015-03-13 16:54:27 Release status: COMMERCIAL
Persistence Type: datasource (DB2/LINUXX8664 SQL10070) Startup
Time: Jan 29, 2016 4:17:18 PM GMT-05:00 Last Update Time: Feb 2, 2016
3:01:23 PM GMT-05:00
I checked for updates to the Eclipse plugin, and it looks like I am up to date.
If I check in the Explorer in the RES console, I can see that it partially deployed:
Deploy Picture
Notice how the rule app is greyed-out.
Any ideas? Thanks...
I found that if I deploy the RuleApp from a 'Rule project for Decision Service', I get the same error. Can you deploy it from a RuleApp project which references a 'Standard Rule Project'? That should fix the issue.

Not able to send/receive email from Jenkins using Email-ext plugin

I am using Jenkins ver. 1.463 running on 32-bit Windows Server. I have installed Email-ext plugin version 2.30.2.
I am unable to get any email notifications.
What i am trying to do - is send an email after every job - irrespective of whether the operation is success, failure, abort, not-build, etc..
I am using Jenkins to run Automated Test Suites.
The way i have configured a test job is "In the Post-Build Actions , have selected Editable Email Notification", and filled in the required fields(recipient list,etc). In the Advanced - selected all the triggers from dropdown such as "Success, Failure, Aborted, Regression, Fixed, Not-Built, Stable.
i have verified the smtp server, recipients, Still I am unable to get any email,
in the Console Output of the job i see the following lines
Email was triggered for: Success
Sending email for trigger: Success.
In the Jenkins Server, in the "jenkins.err.log", see the following error message / exception being thrown, but dont know the exact cause
Aug 27, 2013 5:41:57 PM hudson.model.Run run
INFO: TestJob-for-Email #7 main build action completed: SUCCESS
Aug 27, 2013 5:41:58 PM hudson.model.Executor run
SEVERE: Executor threw an exception
java.lang.NoSuchMethodError: hudson.model.AbstractBuild.getPreviousBuild()Lhudson/model/AbstractBuild;
at hudson.plugins.emailext.plugins.content.BuildStatusContent.evaluate(BuildStatusContent.java:71)
at org.jenkinsci.plugins.tokenmacro.DataBoundTokenMacro.evaluate(DataBoundTokenMacro.java:177)
at org.jenkinsci.plugins.tokenmacro.TokenMacro.expand(TokenMacro.java:177)
at org.jenkinsci.plugins.tokenmacro.TokenMacro.expandAll(TokenMacro.java:219)
at hudson.plugins.emailext.plugins.ContentBuilder.transformText(ContentBuilder.java:63)
at hudson.plugins.emailext.ExtendedEmailPublisher.setSubject(ExtendedEmailPublisher.java:687)
at hudson.plugins.emailext.ExtendedEmailPublisher.createMail(ExtendedEmailPublisher.java:485)
at hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:319)
at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:311)
at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:271)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:710)
at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:685)
at hudson.maven.MavenModuleSetBuild$RunnerImpl.cleanUp(MavenModuleSetBuild.java:1018)
at hudson.model.Run.run(Run.java:1478)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:477)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:239)
Could someone please help,Thanks a lot!
You need to upgrade Jenkins. Your version is too old for the version of the email-ext plugin that you're using. See https://issues.jenkins-ci.org/browse/JENKINS-18728

I can't seem to integrate youtrack and github

Actually it seems pretty straightforward.
Here is the things I have done:
Already have a project on Github
Create a project on Youtrack
Create "MD-Committers" group on Youtrack, give admin privileges on all projects.
Add myself to the group.
Create post-commit service hook for Youtrack with following options
.
url: http://myusername.myjetbrains.com/youtrack
committers: MB-Committers
username: root
password: ******
active: True
with these settings, I Test Hook button says Payload sent successfully which means, I presume, I have set it correctly.
Then,
Create an issue: MD-2 integration test
Commit and push to dev branch with comment: #MD-2 Fixed integration-test
At this point, I should be able to see the issue status set to Fixed and see the commit in the history. However, no status updates, no commits in the history.
My-email address on Youtrack and Github are the same, the only thing different is that, in commits, I use my full name rather than my nickname.
Here is the git log results:
commit 3e91ec7021b2a87a7e4b1b79e0f53e67707e8bf4
Author: Umur Kontacı <fastreload#gmail.com>
Date: Mon Jul 9 21:10:04 2012 +0300
#MB-2 Fixed integration-test
commit 48686795be37aa69ca2dd7b2cd176b57945dc229
Author: Umur Kontacı <fastreload#gmail.com>
Date: Mon Jul 9 21:05:14 2012 +0300
#MB-2 fixed integration-test
commit 8faa55c0589e3d0f91a9988fa5aa60126651ba69
Author: Umur Kontacı <fastreload#gmail.com>
Date: Mon Jul 9 21:04:11 2012 +0300
#MB-2 finished integration-test
commit 4b41acfd17fbeba6b220adaef7b0dd113130a037
Author: Umur Kontacı <fastreload#gmail.com>
Date: Mon Jul 9 20:55:13 2012 +0300
[Finished MB-2] integration-test
None of the commits has made to Youtrack.
What the heck I am missing here?
YouTrack parses GitHub comments as following form [some comment text] #issueID <command_1> [command_2] ...[command_n] as this link mentioned.
The rule of thumb is that, any comments should be placed before #issueID and acknowledgeable YouTrack commands should be placed after the #issueID.
So, integration-test may not be properly acknowledged in YouTrack, because integration-test is just handled as unknown YouTrack command.
Some comment #MD-2 Fixed should work, or #MD-2 Fixed tag integration-test may change your issue to Fixed status and integration-test tagging.
Example commands can be found at http://confluence.jetbrains.com/display/YTD5/Command+Grammar
Note 1: recommend you to see the walkthrough video http://www.youtube.com/watch?v=0iK1J_fWhns
Note 2: You may mistype MB-Committers in your post. probably MD?
Try to use your JetBrains account login instead of root.