Getting the following Error (ENOENT: no such file or directory, scandir)

2017-03-06 Thread Muhammad Waqas Javed


Hi All,


I am new to test automation and currently encountering the following error. I 
am stuck and can't move forward with the test automation. I am using Jenkins

to develop the test automation framework and after running the SHELL code, I am 
getting the following error. I have already searched a lot on different

websites but am unable to get a satisfactory answer. I will really appreciate 
if anyone can help me in this regard. Please note that I really don't know 

much about programming. I am getting the following error (the code is that I 
execute is given in the last).


=> Errors while initializing project:

While reading package from
`/home/ubuntu/workspace/BuildRocketChatOnNode/Rocket.Chat-master/packages/rocketchat-katex`:
native: ENOENT: no such file or directory, scandir
'packages/rocketchat-katex/node_modules/katex/dist/fonts/'
at Error (native)
at Object.fs.readdirSync (fs.js:808:18)
at package.js:27:27


Build step 'Execute shell' marked build as failure
Finished: FAILURE




I run the following code. I have also asked for help from the developer of this 
code but didn't get any answer. 


# clean up if any left overs from last
build

   SCREEN_RUNNING='/usr/bin/pgrep SCREEN'

   if $SCREEN_RUNNING; then

  
pkill SCREEN

  
echo $SCREEN_RUNNING

   fi

NODE_RUNNING='/usr/bin/pgrep node'

   if $NODE_RUNNING; then

  
pkill node

  
echo $NODE_RUNNING

   fi

   if [ -f master.zip ]; then

   rm
-f master.zip

   fi

   INSTDIR=./Rocket.Chat-master

   if [ -d $INSTDIR ]; then

   rm
-Rf $INSTDIR

   fi

   MONDIR=/home/ubuntu/db

   if [ -d $MONDIR ]; then

rm -Rf /home/ubuntu/db

fi

   pwd

   

   # Install packages we need for the build

   sudo apt-get install unzip

   curl https://install.meteor.com/ | sh

   sudo npm install -g n

   sudo n 0.10.40

 

#
Configure Mongo Database

   MONDIR=/home/ubuntu/db

   if [ ! -d $MONDIR ]; then

mkdir /home/ubuntu/db

fi

   pwd

 

   # Build and install Rocket Chat

   export PUBLIC_HOSTNAME="$(curl
http://169.254.169.254/latest/meta-data/public-hostname 2>/dev/null)"

   wget
https://github.com/RocketChat/Rocket.Chat/archive/master.zip

   unzip -o master.zip

   cd ./Rocket.Chat-master

   meteor build --server $PUBLIC_HOSTNAME
--directory .

   cd ./bundle/programs/server

   npm install

   cd ../..

 

   # make sure processes continue to run when
Jenkins script completes

   echo -e "\n"

   ps -ef

   export BUILD_ID=dontKillMe 

   echo -e "\n"

 

   # start mongo DB and Rocket Chat

   screen -d -m
/home/ubuntu/.meteor/packages/meteor-tool/.1.1.10/mt-os.linux.x86_64/dev_bundle/mongodb/bin/mongod
--bind_ip localhost --dbpath /home/ubuntu/db/ --smallfiles

   sleep 10

   export
MONGO_URL=mongodb://localhost:27017/rocketchat 

export ROOT_URL="http://$(curl
http://169.254.169.254/latest/meta-data/public-hostname
2>/dev/null):3000"

   export PORT=3000 

   screen -d -m node
/home/ubuntu/workspace/BuildRocketChatOnNode/Rocket.Chat-master/bundle/main.js

   sleep 10

 

   # list system details and what's running on
the system before we complete script

   echo -e "\n"

   pwd

   echo -e "\n"

   env

   echo -e "\n"

   ps -ef 



Thanks 

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/81b0079a-a45e-45a7-8fcf-556fa3b3b7f0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Interactive input with new DSL

2017-03-06 Thread Andrew Bayer
Actually, "agent none" on a stage does nothing. I'm still trying to find an
effective way to solve this use case in Declarative.

A.

On Mon, Mar 6, 2017 at 2:25 PM R. Tyler Croy  wrote:

> (replies inline)
>
> On Mon, 06 Mar 2017, Travis Camechis wrote:
>
> > So if you define an agent of none within a stage it will override the
> > higher level pipeline stage ?
>
>
> Correct, the previously linked documentation has an example of a
> stage-level
> "agent" directive.
>
>
> > On Monday, March 6, 2017 at 2:39:42 PM UTC-5, R Tyler Croy wrote:
> > >
> > > (replies inline)
> > >
> > > On Mon, 06 Mar 2017, Travis Camechis wrote:
> > >
> > > > With scripted DSL your not supposed to ask for input inside a node so
> > > you
> > > > don't tie up an executor while waiting for user input.  How is this
> same
> > > > thing accomplished in the new DSL ?  It seems like everything runs
> > > inside a
> > > > node with the new DSL ?
> > > >
> > >
> > >
> > > A single stage can use "agent none"
> > > http://jenkins.io/doc/book/pipeline/syntax/#agent
> > >
> > >
> > >
> > > - R. Tyler Croy
> > >
> > > --
> > >  Code: 
> > >   Chatter: 
> > >  xmpp: rty...@jabber.org 
> > >
> > >   % gpg --keyserver keys.gnupg.net --recv-key 1426C7DC3F51E16F
> > > --
> > >
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups "Jenkins Users" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to jenkinsci-users+unsubscr...@googlegroups.com.
> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/c59b475a-35c5-41cd-b7b0-dc2a8b1029c6%40googlegroups.com
> .
> > For more options, visit https://groups.google.com/d/optout.
>
>
> - R. Tyler Croy
>
> --
>  Code: 
>   Chatter: 
>  xmpp: rty...@jabber.org
>
>   % gpg --keyserver keys.gnupg.net --recv-key 1426C7DC3F51E16F
> --
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/20170306222514.j22tdxz6wv552ft4%40blackberry.coupleofllamas.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAPbPdObjTBXJD0MQ%2BFg4M5B9z2SDqxBVtBX%2Bxyo-a_5Mv6sg4g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Unable to get NodeName in pipelines for WorkflowJob

2017-03-06 Thread Zeeshan Maqbool
Simplified code which is easier to read :

def mJenJobs = jenkins.model.Jenkins.getActiveInstance()..getAllItems()
def mJenJobsSize = mJenJobs.size()
def mResult = [] as Set

for (i = 0; i < mJenJobsSize; i++)
{
def locJob = mJenJobs[i]
def running = locJob.getLastBuild().isBuilding()
if (running)
{
def build = locJob.getLastBuild()

println "[Node " + locJob.getLastBuiltOn().getDisplayName()+ "] " 
// Option 1
println "[Node " + build.getExecutor().getOwner().getName()+ "] " 
// Option 2
}
}

On Monday, March 6, 2017 at 4:33:52 PM UTC-8, Zeeshan Maqbool wrote:
>
> Setup - Latest Jenkins with pipeline job set to run from MultiBranch 
> Pipeline (bitbucket)
> Library Function - Its replacing the block plugin where you can specify 
> when this job should wait for other jobs running on a node
>
> I havent seen issues with other functions but I am unable to get NodeName 
> for jobs running through MultiBranch pipelines. 
>
> def call(pattern)
> {
> def mJInstance = Jenkins.getActiveInstance()
> def mJenInstance = mExternalConst.getJenkinsInst()
> def mJenJobs = mJenInstance.getAllItems()
> def mJenJobsSize = mJenJobs.size()
> def mResult = [] as Set
> def mBoolAnswer = false
> def mJobPattern = pattern;  
>
> if (pattern?.trim())
> {
> println "\nTotal jobs running on Jenkins - [Size $mJenJobsSize 
> ]\nList of Jobs with pattern [ $mJobPattern ] "
> if (mJenJobsSize > 0)
> {
> def running
> def build
> for (i = 0; i < mJenJobsSize; i++)
> //mJenJobs.each
> {
> def locJob = mJenJobs[i]
>
> if (locJob.getDisplayName() =~ mJobPattern)
> {
> if (locJob.lastBuild != null)
> {
> if (!(locJob.getDisplayName() =~ env.JOB_BASE_NAME 
> )) //Skip the job itself
> {
> running = locJob.getLastBuild().isBuilding()
> if (running)
> {
> build = locJob.getLastBuild()
> println "\t" + 'JOB: ' + "[NAME " + 
> locJob.getName() + " - " + locJob.getClass() + "] " +
> //"\n\t[InProgress " + 
> build.isInProgress() + "] " +
> "\n\t[Node " + 
> locJob.getLastBuiltOn().getNodeName() + "] " + //    
> LINE WITH ISSUE ***
> "\n\t[Node " + 
> build.getExecutor().getOwner().getName() + "] " + //    
> LINE WITH ISSUE ***
> "\n\t[Build# " + build.getNumber() + "] " +
> "\n\t[EstTimeRemain " + 
> build.getExecutor().getEstimatedRemainingTime() + "] " +
> "\n\t[Progress " + 
> build.getExecutor().getProgress() + "/100] "
> mResult.add(locJob.getName())
> }
> }
> }
> }
> }
> } else
> println "\tNo jobs on this Jenkins box"
>
> mResultSize = mResult.size()
>
> if (mResultSize > 0)
> {
> println "\nFound [ $mResultSize ] jobs matching [ $pattern ] 
> on this Jenkins"
> mBoolAnswer = true
> } else
> println "\nNo jobs found matching [ $pattern ] on this Jenkins"
> } else
> println "Please provide a pattern to this function. e.g\n 
> jobRunning('OdinPlugin.*-')"
>
> return mBoolAnswer
> }
>
> Here's the output I am getting :
> -
>
> *15:28:39*JOB: [NAME First-Test - class 
> org.jenkinsci.plugins.workflow.job.WorkflowJob] 
>
> *15:28:39*[Node ] 
>
> *15:28:39*[Node ] 
>
> *15:28:39*[Build# 191] 
>
> *15:28:39*[EstTimeRemain N/A] 
>
> *15:28:39*[Progress 99/100] 
>
> -
>
> You can see here the Node name is not getting printed, one reason I can 
> see for Option2 [build.getExecutor().getOwner().getName()] was its class 
> [hudson.model.Hudson$MasterComputer] 
> which has empty nodeName.
>
> Does anyone know how to get nodeName for a MultiBranchPipeline job, the 
> same thing works for older style FreeFlowJobs
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/11b47c5e-7a2f-4597-8a2b-5f129b571c13%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Unable to get NodeName in pipelines for WorkflowJob

2017-03-06 Thread Zeeshan Maqbool
one more thing to add which is pretty important and where the issue seems 
to be, if I check class for [locJob.getLastBuiltOn()] it comes out to be 
[hudson.model.Hudson], 
whereas it should be Node according to this documentation 
http://javadoc.jenkins.io/plugin/workflow-job/org/jenkinsci/plugins/workflow/job/WorkflowJob.html#getLastBuiltOn--


On Monday, March 6, 2017 at 4:33:52 PM UTC-8, Zeeshan Maqbool wrote:
>
> Setup - Latest Jenkins with pipeline job set to run from MultiBranch 
> Pipeline (bitbucket)
> Library Function - Its replacing the block plugin where you can specify 
> when this job should wait for other jobs running on a node
>
> I havent seen issues with other functions but I am unable to get NodeName 
> for jobs running through MultiBranch pipelines. 
>
> def call(pattern)
> {
> def mJInstance = Jenkins.getActiveInstance()
> def mJenInstance = mExternalConst.getJenkinsInst()
> def mJenJobs = mJenInstance.getAllItems()
> def mJenJobsSize = mJenJobs.size()
> def mResult = [] as Set
> def mBoolAnswer = false
> def mJobPattern = pattern;  
>
> if (pattern?.trim())
> {
> println "\nTotal jobs running on Jenkins - [Size $mJenJobsSize 
> ]\nList of Jobs with pattern [ $mJobPattern ] "
> if (mJenJobsSize > 0)
> {
> def running
> def build
> for (i = 0; i < mJenJobsSize; i++)
> //mJenJobs.each
> {
> def locJob = mJenJobs[i]
>
> if (locJob.getDisplayName() =~ mJobPattern)
> {
> if (locJob.lastBuild != null)
> {
> if (!(locJob.getDisplayName() =~ env.JOB_BASE_NAME 
> )) //Skip the job itself
> {
> running = locJob.getLastBuild().isBuilding()
> if (running)
> {
> build = locJob.getLastBuild()
> println "\t" + 'JOB: ' + "[NAME " + 
> locJob.getName() + " - " + locJob.getClass() + "] " +
> //"\n\t[InProgress " + 
> build.isInProgress() + "] " +
> "\n\t[Node " + 
> locJob.getLastBuiltOn().getNodeName() + "] " + //    
> LINE WITH ISSUE ***
> "\n\t[Node " + 
> build.getExecutor().getOwner().getName() + "] " + //    
> LINE WITH ISSUE ***
> "\n\t[Build# " + build.getNumber() + "] " +
> "\n\t[EstTimeRemain " + 
> build.getExecutor().getEstimatedRemainingTime() + "] " +
> "\n\t[Progress " + 
> build.getExecutor().getProgress() + "/100] "
> mResult.add(locJob.getName())
> }
> }
> }
> }
> }
> } else
> println "\tNo jobs on this Jenkins box"
>
> mResultSize = mResult.size()
>
> if (mResultSize > 0)
> {
> println "\nFound [ $mResultSize ] jobs matching [ $pattern ] 
> on this Jenkins"
> mBoolAnswer = true
> } else
> println "\nNo jobs found matching [ $pattern ] on this Jenkins"
> } else
> println "Please provide a pattern to this function. e.g\n 
> jobRunning('OdinPlugin.*-')"
>
> return mBoolAnswer
> }
>
> Here's the output I am getting :
> -
>
> *15:28:39*JOB: [NAME First-Test - class 
> org.jenkinsci.plugins.workflow.job.WorkflowJob] 
>
> *15:28:39*[Node ] 
>
> *15:28:39*[Node ] 
>
> *15:28:39*[Build# 191] 
>
> *15:28:39*[EstTimeRemain N/A] 
>
> *15:28:39*[Progress 99/100] 
>
> -
>
> You can see here the Node name is not getting printed, one reason I can 
> see for Option2 [build.getExecutor().getOwner().getName()] was its class 
> [hudson.model.Hudson$MasterComputer] 
> which has empty nodeName.
>
> Does anyone know how to get nodeName for a MultiBranchPipeline job, the 
> same thing works for older style FreeFlowJobs
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/1b136da2-7933-46d4-aba8-96c7cdb05db7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Unable to get NodeName in pipelines for WorkflowJob

2017-03-06 Thread Zeeshan Maqbool
Setup - Latest Jenkins with pipeline job set to run from MultiBranch 
Pipeline (bitbucket)
Library Function - Its replacing the block plugin where you can specify 
when this job should wait for other jobs running on a node

I havent seen issues with other functions but I am unable to get NodeName 
for jobs running through MultiBranch pipelines. 

def call(pattern)
{
def mJInstance = Jenkins.getActiveInstance()
def mJenInstance = mExternalConst.getJenkinsInst()
def mJenJobs = mJenInstance.getAllItems()
def mJenJobsSize = mJenJobs.size()
def mResult = [] as Set
def mBoolAnswer = false
def mJobPattern = pattern;  

if (pattern?.trim())
{
println "\nTotal jobs running on Jenkins - [Size $mJenJobsSize 
]\nList of Jobs with pattern [ $mJobPattern ] "
if (mJenJobsSize > 0)
{
def running
def build
for (i = 0; i < mJenJobsSize; i++)
//mJenJobs.each
{
def locJob = mJenJobs[i]

if (locJob.getDisplayName() =~ mJobPattern)
{
if (locJob.lastBuild != null)
{
if (!(locJob.getDisplayName() =~ env.JOB_BASE_NAME 
)) //Skip the job itself
{
running = locJob.getLastBuild().isBuilding()
if (running)
{
build = locJob.getLastBuild()
println "\t" + 'JOB: ' + "[NAME " + 
locJob.getName() + " - " + locJob.getClass() + "] " +
//"\n\t[InProgress " + build.isInProgress() 
+ "] " +
"\n\t[Node " + 
locJob.getLastBuiltOn().getNodeName() + "] " + //    
LINE WITH ISSUE ***
"\n\t[Node " + 
build.getExecutor().getOwner().getName() + "] " + //    
LINE WITH ISSUE ***
"\n\t[Build# " + build.getNumber() + "] " +
"\n\t[EstTimeRemain " + 
build.getExecutor().getEstimatedRemainingTime() + "] " +
"\n\t[Progress " + 
build.getExecutor().getProgress() + "/100] "
mResult.add(locJob.getName())
}
}
}
}
}
} else
println "\tNo jobs on this Jenkins box"

mResultSize = mResult.size()

if (mResultSize > 0)
{
println "\nFound [ $mResultSize ] jobs matching [ $pattern ] on 
this Jenkins"
mBoolAnswer = true
} else
println "\nNo jobs found matching [ $pattern ] on this Jenkins"
} else
println "Please provide a pattern to this function. e.g\n 
jobRunning('OdinPlugin.*-')"

return mBoolAnswer
}

Here's the output I am getting :
-

*15:28:39*  JOB: [NAME First-Test - class 
org.jenkinsci.plugins.workflow.job.WorkflowJob] 

*15:28:39*  [Node ] 

*15:28:39*  [Node ] 

*15:28:39*  [Build# 191] 

*15:28:39*  [EstTimeRemain N/A] 

*15:28:39*  [Progress 99/100] 

-

You can see here the Node name is not getting printed, one reason I can see 
for Option2 [build.getExecutor().getOwner().getName()] was its class 
[hudson.model.Hudson$MasterComputer] 
which has empty nodeName.

Does anyone know how to get nodeName for a MultiBranchPipeline job, the 
same thing works for older style FreeFlowJobs

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/53ed3df7-a767-476c-a748-1b701100a780%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


global option to always build with clean a workspace when using pipelines

2017-03-06 Thread sleipnir
Hi

I want to start building with a clean workspace in my pipelines, and I 
can't find a way to do it globally.
I did a bit of research, and saw the step 'deleteDir()' is the proposed way 
of doing it.
My problem with that is I need to add a call to this step for every nodes 
(I have parralel work and several stages) and it leads to a deleteDir() 
clutter in my Jenkins files.

Is there a better way that I missed to always build from scratch ? (using 
pipelines and organization folders in my case)

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/178139d7-43a6-4a15-b207-a2c69c05744f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


getting variables from a downstream job

2017-03-06 Thread Alexander Drobst


We have a build and deploy process for every artifact(it is not a maven 
build, and not a maven arifact). If build or deploy for a single artifact 
fails it should not stop the whole process.


We have a separate jobs for build and deploy. Build jobs can work in 
parallel on a slaves, deploy not.


The results of a build job should be used by deploy job. I need somehow to 
get a workspace location of a build and set it as a parameter of a deploy 
job, that deploy job can use ear files from build job and deploy them on a 
server.


The place where I need to put a workspace is marked with a question mark.


def branches = [:]
def artifactsToDeploy = []
node{
workspace = pwd()
echo "Workspace:${workspace}"

//read artifact names from file
def appFile=readFile(workspace+"@script/artifacts.txt")
def artifactNames = appFile.tokenize()

//prepare parallel jobs
for (int i=0 ; i < artifactNames.size ; i++) {
def artifactName=artifactNames[i]
branches[artifactName]={

//start build job
def buildResult = build job: 'build-artifact', parameters: 
[[$class: 'StringParameterValue', name: 'ARTIFACT', value:artifactName],
[$class: 'StringParameterValue', name: 'SVN_TAG', value:SVN_TAG]]

//need to read workspace from a build job, that was running on a 
slave

artifactsToDeploy[artifactsToDeploy.size]=[artifact:artifactName,workspace:?]
}
}

echo 'pipeline begin'
stage('build'){
parallel branches
}

stage('deploy'){

//read artifacts from a list and deploy 
for (int i=0;i

Re: Interactive input with new DSL

2017-03-06 Thread R. Tyler Croy
(replies inline)

On Mon, 06 Mar 2017, Travis Camechis wrote:

> So if you define an agent of none within a stage it will override the 
> higher level pipeline stage ?


Correct, the previously linked documentation has an example of a stage-level
"agent" directive.


> On Monday, March 6, 2017 at 2:39:42 PM UTC-5, R Tyler Croy wrote:
> >
> > (replies inline) 
> >
> > On Mon, 06 Mar 2017, Travis Camechis wrote: 
> >
> > > With scripted DSL your not supposed to ask for input inside a node so 
> > you 
> > > don't tie up an executor while waiting for user input.  How is this same 
> > > thing accomplished in the new DSL ?  It seems like everything runs 
> > inside a 
> > > node with the new DSL ? 
> > > 
> >
> >
> > A single stage can use "agent none" 
> > http://jenkins.io/doc/book/pipeline/syntax/#agent 
> >
> >
> >
> > - R. Tyler Croy 
> >
> > -- 
> >  Code:  
> >   Chatter:  
> >  xmpp: rty...@jabber.org  
> >
> >   % gpg --keyserver keys.gnupg.net --recv-key 1426C7DC3F51E16F 
> > -- 
> >
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jenkinsci-users/c59b475a-35c5-41cd-b7b0-dc2a8b1029c6%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.


- R. Tyler Croy

--
 Code: 
  Chatter: 
 xmpp: rty...@jabber.org

  % gpg --keyserver keys.gnupg.net --recv-key 1426C7DC3F51E16F
--

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/20170306222514.j22tdxz6wv552ft4%40blackberry.coupleofllamas.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


Controlling a MultiBranch Pipeline Change log

2017-03-06 Thread Brian Weiner
I'm setting up a chain of projects, where when Project A finishes building, 
I invoke Project B using the "build" command.  However, the build command 
always sync's to whatever HEAD is currently set to on the remote.  My 
Jenkinsfile, later syncs to the hash I want.  However, at this point the 
change log is already polluted.

I.e. in Project B I want to build at hash X, however, at spin up Project B 
clones to hash Y, where Y is newer than X.  All the changes between X and Y 
are now part of the change log.

Any way to get around this?

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/952355a3-e715-49d1-8398-3b2776d917ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Interactive input with new DSL

2017-03-06 Thread Travis Camechis
So if you define an agent of none within a stage it will override the 
higher level pipeline stage ?

On Monday, March 6, 2017 at 2:39:42 PM UTC-5, R Tyler Croy wrote:
>
> (replies inline) 
>
> On Mon, 06 Mar 2017, Travis Camechis wrote: 
>
> > With scripted DSL your not supposed to ask for input inside a node so 
> you 
> > don't tie up an executor while waiting for user input.  How is this same 
> > thing accomplished in the new DSL ?  It seems like everything runs 
> inside a 
> > node with the new DSL ? 
> > 
>
>
> A single stage can use "agent none" 
> http://jenkins.io/doc/book/pipeline/syntax/#agent 
>
>
>
> - R. Tyler Croy 
>
> -- 
>  Code:  
>   Chatter:  
>  xmpp: rty...@jabber.org  
>
>   % gpg --keyserver keys.gnupg.net --recv-key 1426C7DC3F51E16F 
> -- 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/c59b475a-35c5-41cd-b7b0-dc2a8b1029c6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Jenkins running docker container with uid/gid that do not exist

2017-03-06 Thread Ashok Modi
Hi,

I have a Jenkinsfile with the following docker step:

  agent {
dockerfile {
  filename "Dockerfile"
}
  }
  steps {
  sh 'cd sites/all/themes/custom/zen; npm install; gulp'
  }


And my Dockerfile consists of: 

FROM node:7.7

RUN npm install gulp gulp-cli -g



Which installs the npm packages that are required by the project and runs 
the necessary gulp commands as well. When I try doing the step without 
Jenkins (manually docker run) the script runs correctly. However, when I 
run via Jenkins and the Jenkinsfile, I get permission denied errors with 
the files the attempted install paths being quite different from where they 
would normally be. On further investigation of the jenkins command:

docker run -t -d -u 110:115 -w /workspace-dir -v 
/workspace-dir:/workspace-dir:rw ...


I found that the -u flag was using the uid/gid of my Jenkins user on the host 
(which does not exist in my image). Currently, my jenkins install is not via 
jenkins (its installed via apt on an ubuntu server). So I'm not entirely sure 
of what would be the best approach to this issue. Should I be creating a user 
with the same uid/gid via docker? Or is there some other recommended approach 
to do this?


-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/e0ec06df-b645-46a1-b7c8-9b38ea807601%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Interactive input with new DSL

2017-03-06 Thread Travis Camechis
With scripted DSL your not supposed to ask for input inside a node so you 
don't tie up an executor while waiting for user input.  How is this same 
thing accomplished in the new DSL ?  It seems like everything runs inside a 
node with the new DSL ?

Thanks
Travis

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/67e1e3d6-4d3b-45be-bcf7-89e299ec3b66%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins2 BlueOcean loading jobs fails

2017-03-06 Thread James Dumay
Hi there,

I believe you are likely hitting the bug described in JENKINS-40088 
. Do you have any 
exceptions in your Jenkins server log after clicking the "Show More" button?

Thanks,
James

On Monday, March 6, 2017 at 3:55:33 AM UTC-8, GS_L wrote:
>
> Hi
> I installed Jenkins 2.48 and blueOcean beta plugin.
> When I press the 'show more' button it works only on the first time.
> Pressing the button the second time or more (to see all the jobs) the 
> button is stuck on loading. 
> It's look like the big amount of the jobs caused that.
> Is there a work around so I can get all the jobs?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/9a3a2e80-9497-44ca-8ca0-6196849564d0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error getting the SSL context object

2017-03-06 Thread raghavendra . br436
Thanks for the post steven, I had the same issue i.e. different password 
for keystore and key. recreating the keystore and key with the same 
resolved it.


On Friday, December 19, 2014 at 2:05:59 PM UTC-5, Steven Erat wrote:
>
> I encountered the same exception.  The short answer is that the privateKey 
> password did not match the keyStore password, at first.   When I realized 
> this could be a problem, I tried setting the JENKINS_ARG option 
> —httpsPrivateKeyPassword to in addition to the --httpsKeyStorePassword, but 
> I got a "Unrecognized option" from Winstone which didn't make sense.
>
> Here's a snippet of correspondence when I was describing the situation to 
> a colleague:
> -
>
> Looking at the Winstone class where the last exception came from: 
>
> https://github.com/jenkinsci/winstone/blob/master/src/java/winstone/HttpsConnectorFactory.java
>
> There was the following comment block:
>
> // There are many legacy setups in which the KeyStore password and the
> // key password are identical and people will not even be aware that these
> // are two different things
> // Therefore if no httpsPrivateKeyPassword is explicitely set we try to
> // use the KeyStore password also for the key password not to break
> // backward compatibility
> // Otherwise the following code will completely break the startup of
> // Jenkins in case the --httpsPrivateKeyPassword parameter is not set
> privateKeyPassword = Option.HTTPS_PRIVATE_KEY_PASSWORD.get(args, 
> keystorePassword);
>
> Then I found the Winstone options class, which also showed that a 
> ‘httpsPrivateKeyPassword’ option could be passed.  So I changed the 
> /etc/sysconfig/jenkins to use this instead:
>
> JENKINS_ARGS="--httpsPort=443 
> --httpsKeyStore=/usr/lib/jenkins/certs/jenkins.jks  
> --httpsKeyStorePassword=abc --httpsPrivateKeyPassword=xyz"
>
> However, starting Jenkins still failed, but this time with 
> “java.lang.IllegalArgumentException: Unrecognized option: 
> —httpsPrivateKeyPassword”, and that doesn’t make sense at all.
>
> I going try to recreate the jenkins.jks keystone that I’m using, but match 
> the private key password that I used originally.If they both have the 
> same password, then I don’t have to pass in "—httpsPrivateKeyPassword” 
> separately.
>
> Ok,  recreating the jks file with the same password used for the private 
> key password worked.  Jenkins would start and the SSL cert was verified in 
> the browser. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/15a04278-8d23-4796-a8e9-2fb5f33a373d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins2 pileline poll scm

2017-03-06 Thread jerome
You can set your pipeline project configure like the following:

Build Triggers
Poll SCM
Schedule H 22 * * *

This will consider the pipeline scripts checkout and the checkout done into 
the pipeline. The later need at least a single run manually started to 
register the code checkout with the first execution of the jenkinsfile. I 
haven't tested this with multi branch.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/fa2d7164-e029-4292-aef0-ee26e661be26%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Is there any way for a jenkins project to use the Gitlab plugin but only be built periodically and not when a change is pushed?

2017-03-06 Thread Oded Badt
Here is my config xml file

Thanks!
   Oded

On Thu, Mar 2, 2017 at 5:01 PM, suresh kumar  wrote:

> Could you share the full config of Job and Check the Gitlab hooks.
>
> -Suresh
>
> On Thursday, March 2, 2017 at 2:47:39 AM UTC+5:30, Oded Badt wrote:
>>
>> Actually I tried with it both checked and unchecked and played arouns
>> with it back and forth and no matter what I do it still it rebuilds with
>> every push to the repository
>>
>> On Wed, Mar 1, 2017 at 6:45 PM, suresh kumar  wrote:
>>
>>> I think you have checked Poll SCM option in Build Triggers section.
>>> Uncheck Poll SCM and Check the checkbox Build periodically.
>>>
>>> [image:
>>> http://lh3.ggpht.com/-_t31sX5XYBU/VQXVt6PucQI/Bt0/gjCgub_9nH0/jenkins009_thumb%25255B1%25255D.png?imgmax=800]
>>>
>>> -Suresh
>>>
>>> On Wednesday, March 1, 2017 at 8:09:42 PM UTC+5:30, Oded Badt wrote:

 Note that:

 "Build when a change is pushed to GitLab. GitLab CI Service URL:"

 is UNCHECKED,
 yet Jenkins keeps building the project every time I push a change to it
 even though my intention is for it to be built periodically (with the code
 snapshot of that moment) due to build side effects I prefer to avoid on
 every push to my repo

>>> --
>>> You received this message because you are subscribed to a topic in the
>>> Google Groups "Jenkins Users" group.
>>> To unsubscribe from this topic, visit https://groups.google.com/d/to
>>> pic/jenkinsci-users/zwbqxC196dM/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> jenkinsci-use...@googlegroups.com.
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/jenkinsci-users/02243e9c-7f5e-457f-8ae0-f92bdbdc0107%
>>> 40googlegroups.com
>>> 
>>> .
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Jenkins Users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/jenkinsci-users/zwbqxC196dM/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/jenkinsci-users/b4a7815a-5bb9-4ede-808c-9caa3b586e04%40googlegroups.
> com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAHQ5-_RiiVBt2NRkYWY-NSsmpZmFPNC2A9LW9Q2NkiP-YUrVkQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


  
  
  false
  

  false
  GLOBAL
  DISABLED
  


  false


  false


  false


  0
  0
  false
  project

  
  
2

  
g...@git.infinidat.com:host-internal/research-notebooks.git
  


  
develop
  

false


  
  ipynb-slave
  false
  false
  false
  false
  

  0 0 * * *


  
  true

  
  false
  

  

  
  

  ob...@infinidat.com
  false
  false

  
  


Jenkins2 BlueOcean loading jobs fails

2017-03-06 Thread GS_L
Hi
I installed Jenkins 2.48 and blueOcean beta plugin.
When I press the 'show more' button it works only on the first time.
Pressing the button the second time or more (to see all the jobs) the 
button is stuck on loading. 
It's look like the big amount of the jobs caused that.
Is there a work around so I can get all the jobs?

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/cf1f3f78-4021-4adc-aa43-a19c378beca7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Pipeline send email to committer

2017-03-06 Thread GS_L
Hi
How can I send e-mails to individuals who broke the build?
This is my post mail code:

post {

failure {
  mail(from: "...",
   to: "...",
   subject: "UI build failed!",
   body: "For more information see the build log.")
}
  }


-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/486a39c7-e388-4152-a04d-93172c8aae2d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Starting Eclipse in the foreground

2017-03-06 Thread Kev James
Hi all,

Running on Windows 10, Jenkins 2.32.2

I'm using Jenkins to automate Jubula tests of an Eclipse Plugin I'm 
writing. I currently have two issues that I'm hoping someone can help with.

Firstly, when I have Jenkins running as a service, when I try to run 
Eclipse from the ant script that my Jenkins job runs, eclipse starts 
(according to Task Manager) but will not appear in my task bar or on the 
desktop. It just hangs.
I have tried as 'Local System Account' with the 'Allow service to interact 
with desktop' checked, and also with 'This account', specifying the 
credentials of the user who is logged in, but neither makes any difference.
Is there a way to run GUI executables from the Ant script in a Jenkins job 
when it's a service?

I worked around this for now, but running Jenkins from a command prompt. 
When I do this, Eclipse will start correctly, but it does not become the 
focused app. This causes a problem for the Jubula testing framework, 
because the framework simulates mouse clicks and typing on the AUT 
(Application Under Test) - so if that application is not in the foreground, 
the test will fail.

I have verified that the test works ok by (a) running it from the Jubula 
app itself and (b) clicking on the Eclipse tab in the taskbar while the 
splash screen is displayed, manually bringing it to the foreground.

Does anyone know a way to launch the application in the foreground?

Cheers,
KEv.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/0c69b740-7631-485e-836f-2c33ada50de4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins2 pileline poll scm

2017-03-06 Thread GS_L
Hi
The triggers - pollscm doesn't work on the checkout step.
I want that the pollscm will trigger a build in every push in - 
checkout([$class: 
'GitSCM', branches: [[name: '*/master']], ...
This didn't work for me:

pipeline {
triggers {
pollSCM('*/5 * * * *')
}
agent { label 'web-ui-0427' }

stages {


stage('Build') {
steps {
checkout([$class: 'GitSCM', branches: [[name: '*/master']], 
doGenerateSubmoduleConfigurations: false, extensions: [[$class: 
'RelativeTargetDirectory', relativeTargetDir: 'cloudify-stage']], submoduleCfg: 
[], userRemoteConfigs: [[credentialsId: '5006a20b-84d4-4681-ae49-886247acd47b', 
url: 'https://github.com/cloudify-cosmo/cloudify-stage.git']]])
dir('cloudify-stage') {
sh '''sudo npm install
  sudo npm install webpack -g
  sudo npm install bower -g
  sudo npm install gulp -g
  sudo npm install grunt-cli -g
  bower install'''
dir('semantic') {
sh 'gulp build'
}
sh 'grunt build'
dir('backend') {
sh 'npm install'
}
sh 'webpack --config webpack.config-prod.js --bail'
sh 'sudo chown jenkins:jenkins -R .'
}
}
}

}


On Sunday, March 5, 2017 at 4:40:05 PM UTC+2, Bill Dennis wrote:
>
> If your Jenkinsfile is in the same repo, using declarative pipeline you 
> can have triggers in the pipeline to do this:
>
> pipeline {
>  triggers {
> pollSCM('*/5 * * * *')
>  }
> ...
> }
>
> It works for me using subversion.
>
> Bill
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/ceb9345b-1af2-492d-9550-060bb0efe89c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Pass parmas from one stage to anohter

2017-03-06 Thread GS_L


Hi

I read environment variables from file. 

The following works, but there is a code duplication:

(

. ${JENKINS_HOME}/jobs/credentials.sh > /dev/null 2>&1
curl -u $GITHUB_USERNAME:$GITHUB_PASSWORD 
https://raw.githubusercontent.com/cloudify-cosmo/cloudify-premium/master/packages-urls/common_build_env.sh
 -o ./common_build_env.sh
. $PWD/common_build_env.sh

)

Where can I read the file so both of the stages will recognize the variables?


pipeline {

agent { label 'web-ui-0427' }


stage('Pack') {
steps {
dir('cloudify-stage') {
sh 'sudo npm run zip'
}
sh '''. ${JENKINS_HOME}/jobs/credentials.sh > /dev/null 2>&1
  curl -u $GITHUB_USERNAME:$GITHUB_PASSWORD 
https://raw.githubusercontent.com/cloudify-cosmo/cloudify-premium/master/packages-urls/common_build_env.sh
 -o ./common_build_env.sh
  . $PWD/common_build_env.sh
  mv cloudify-stage/stage.tar.gz  
cloudify-stage-$VERSION-$PRERELEASE.tgz'''

}
}

stage('Upload package to S3') {
steps {
sh '''set +x
  . ${JENKINS_HOME}/jobs/credentials.sh > /dev/null 2>&1
  curl -u $GITHUB_USERNAME:$GITHUB_PASSWORD 
https://raw.githubusercontent.com/cloudify-cosmo/cloudify-premium/master/packages-urls/common_build_env.sh
 -o ./common_build_env.sh
  . $PWD/common_build_env.sh
  s3cmd put --access_key=${AWS_ACCESS_KEY_ID_UPLOAD_TEMP} 
--secret_key=${AWS_ACCESS_KEY_UPLOAD_TEMP} --human-readable-sizes --acl-public 
\\
  cloudify-stage-$VERSION-$PRERELEASE.tgz \\
  s3://$AWS_S3_BUCKET/$AWS_S3_PATH/'''
}
}

}

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/d1510f9f-d313-4700-80d0-81f535fac9a6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.