Re: Upgrade Jenkins from 1.580 to 2.32.2

2017-02-27 Thread Peter McNab

No to what?

Jenkins 1.608 made slaves require Java7, so it might impact Raj's 
upgrade attempts.


I know the Java8 change hasn't been made, but it's coming soon as well.

Java7 has been around a long time, but so have the platforms I support, 
and we we moved up to a version that supported pipelines a number of the 
older platform slaves stopped working and some users had to scramble to 
adjust their jobs.


Pete


On 2/27/2017 11:16 AM, Baptiste Mathus wrote:
Well, no. The Java 8 change hasn't been made yet, though it is coming 
according to the announced plan (first weekly should be on April, and 
first LTS requiring it should be around early June). And Java 7 has 
been around for a long time.


And we already discussed the fact that though some platforms may not 
have a JDK packaged with std distro, it's dead simple to download it 
directly from , uncompress and be done with it on the big majority of 
platforms (Centos 6 is not an issue at all for instance, I can relate).


2017-02-27 19:29 GMT+01:00 Peter McNab <mailto:pmc...@perforce.com>>:


I don't remember exactly when the change was made, but keep in
mind that Java7 is required for slave nodes with recent versions
of Jenkins.  If you have slave nodes without that available they
will be dead in the water.

Pete


On 2/27/2017 9:59 AM, Raj wrote:

Thank you for the feedback.

Sure. we can do that and more simply with a vm snapshot for
rollback.

but in case of staging upgrade how do you propose \ suggest to
manage the slave \ agents ? i ask since if i bring up the staging
with a rsynced config then the agents will try to connect too and
might cause a issue. or should we just make all slaves offline
when i take a snaphot so when they do comeback they will be not
connected to the master and that way we can test just the master
and once it is fine then just connect all agents to the new server ?



On Saturday, February 25, 2017 at 1:35:25 PM UTC-5, Raj wrote:

Hello,
We have been stuck to a very old version of Jenkins for a
while now. 1.580. we are on Centos 6.

I am wondering if any one has upgraded from 1.580 to 2.32.2
via yum and including all plugins ?

If someone could share their experience it will be really
appreciated.

apart from need for jdk 1.8, is there any other hard
dependency for the upgrade?
Regards,
Raj

-- 
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
<mailto:jenkinsci-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit

https://groups.google.com/d/msgid/jenkinsci-users/3f246128-6cea-4013-a175-c27bcce0e588%40googlegroups.com

<https://groups.google.com/d/msgid/jenkinsci-users/3f246128-6cea-4013-a175-c27bcce0e588%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout
<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
<mailto:jenkinsci-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit

https://groups.google.com/d/msgid/jenkinsci-users/0b283e4a-7b5f-a981-3dac-212d45358eec%40perforce.com

<https://groups.google.com/d/msgid/jenkinsci-users/0b283e4a-7b5f-a981-3dac-212d45358eec%40perforce.com?utm_medium=email&utm_source=footer>.


For more options, visit https://groups.google.com/d/optout
<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 
<mailto:jenkinsci-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CANWgJS5UFiUi-WGM7SkLx%3D1R49YadXmKUgV9g%3De7-UH8rognrQ%40mail.gmail.com 
<https://groups.google.com/d/msgid/jenkinsci-users/CANWgJS5UFiUi-WGM7SkLx%3D1R49YadXmKUgV9g%3De7-UH8rognrQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.

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 

Re: Upgrade Jenkins from 1.580 to 2.32.2

2017-02-27 Thread Peter McNab
I don't remember exactly when the change was made, but keep in mind that 
Java7 is required for slave nodes with recent versions of Jenkins.  If 
you have slave nodes without that available they will be dead in the water.


Pete


On 2/27/2017 9:59 AM, Raj wrote:

Thank you for the feedback.

Sure. we can do that and more simply with a vm snapshot for rollback.

but in case of staging upgrade how do you propose \ suggest to manage 
the slave \ agents ? i ask since if i bring up the staging with a 
rsynced config then the agents will try to connect too and might cause 
a issue. or should we just make all slaves offline when i take a 
snaphot so when they do comeback they will be not connected to the 
master and that way we can test just the master and once it is fine 
then just connect all agents to the new server ?




On Saturday, February 25, 2017 at 1:35:25 PM UTC-5, Raj wrote:

Hello,
We have been stuck to a very old version of Jenkins for a while
now. 1.580. we are on Centos 6.

I am wondering if any one has upgraded from 1.580 to 2.32.2 via
yum and including all plugins ?

If someone could share their experience it will be really
appreciated.

apart from need for jdk 1.8, is there any other hard dependency
for the upgrade?
Regards,
Raj

--
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/3f246128-6cea-4013-a175-c27bcce0e588%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/0b283e4a-7b5f-a981-3dac-212d45358eec%40perforce.com.
For more options, visit https://groups.google.com/d/optout.


Re: Pipeline - stage, node

2017-01-26 Thread Peter McNab
I think the things missing from those docs are more explanation behind 
some of the design choices, and what the benefits and drawbacks could be.


The mention of the major limitations of the pipeline scripts are either 
not documented or buried in obscure comments in Jira issues.  For 
example, an explanation of the need for serialization, what methods are 
whitelisted, the fact that you can't import a jar file, etc.  I've spend 
weeks fighting those issues, and perhaps if I understood the underlying 
logic, use case, and design intention I'd not have wasted my time.


I keep seeing the same questions being asked on this list, on Stack 
Overflow, and other places, but none of that seems to make it back to 
the first docs someone will see when they're trying to use the pipeline.


Pete


On 1/26/2017 7:03 AM, Daniel Beck wrote:

On 21.01.2017, at 19:24, Sharan Basappa  wrote:

I am stuck with conceptual understanding of pipeline.

Have you read https://jenkins.io/doc/book/pipeline/ ? Most of what you're 
asking is being answered there.



--
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/2c19c9c7-5d19-25ba-d479-c7c00578c5b3%40perforce.com.
For more options, visit https://groups.google.com/d/optout.


Re: Running SQL queries from a pipeline script?

2017-01-16 Thread Peter McNab
Just completing the loop in case anyone else is looking into this.  My 
colleague tried my solution in his instance and it didn't work.


After doing some more archeology I realized that I at one point printed 
out the system java.ext.dirs, which included 
/usr/java/packages/lib/ext.  I then created that path and copied the 
mysql-connector-java-5.1.38.jar there.  After a restart of Jenkins I 
could now import and use groovy.sql.Sql quite happily, not just on the 
master but on remote nodes.


So while this functions, it seems hard to consider this as a working 
production solution.


Pete



On 1/16/2017 10:47 AM, Peter McNab wrote:
Oddly enough, after sending this I found I *was* able to skip the 
extra wrapper and make this work.


I swear I had tried that earlier with no luck.

(As it happens, I need to use the wrapper for other purposes)

Pete


On 1/16/2017 10:44 AM, Peter McNab wrote:

On 1/12/2017 1:53 PM, Peter McNab wrote:
Has anyone got a working solution for running SQL queries from a 
pipeline script (specifically MySQL?)


Pete

Answering my own post...I've found a method that functions, although 
it's not ideal.


1) Install the "Pipeline Classpath Step Plugin

2) Make my pipeline script (from SCM) be essentially a small wrapper:
  pipelinePath = 
  addToClasspath pipelinePath
  node('master') {
load "${pipelinePath}/Jenkinsfile"
  }

3) In the Jenkinsfile, add "import groovy.sql.Sql"

4) Add this into the Jenkinsfile:
  stage ('SQL Test') {
node('remote_node') {
def sql = Sql.newInstance("jdbc:mysql://DBHOST/DBSCHEMA", 
"DBUSER", "DBPASSWORD", "com.mysql.jdbc.Driver")

query = "SELECT * from myTable"
println sql.rows(query)
sql.close()
}
}

5) Note that you will need to whitelist the various Sql methods you 
call using the script security plugin






--
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/13d06493-11a2-e842-0978-82e003480956%40perforce.com.
For more options, visit https://groups.google.com/d/optout.


Re: Running SQL queries from a pipeline script?

2017-01-16 Thread Peter McNab
Oddly enough, after sending this I found I *was* able to skip the extra 
wrapper and make this work.


I swear I had tried that earlier with no luck.

(As it happens, I need to use the wrapper for other purposes)

Pete


On 1/16/2017 10:44 AM, Peter McNab wrote:

On 1/12/2017 1:53 PM, Peter McNab wrote:
Has anyone got a working solution for running SQL queries from a 
pipeline script (specifically MySQL?)


Pete

Answering my own post...I've found a method that functions, although 
it's not ideal.


1) Install the "Pipeline Classpath Step Plugin

2) Make my pipeline script (from SCM) be essentially a small wrapper:
  pipelinePath = 
  addToClasspath pipelinePath
  node('master') {
load "${pipelinePath}/Jenkinsfile"
  }

3) In the Jenkinsfile, add "import groovy.sql.Sql"

4) Add this into the Jenkinsfile:
  stage ('SQL Test') {
node('remote_node') {
def sql = Sql.newInstance("jdbc:mysql://DBHOST/DBSCHEMA", 
"DBUSER", "DBPASSWORD", "com.mysql.jdbc.Driver")

query = "SELECT * from myTable"
println sql.rows(query)
sql.close()
}
}

5) Note that you will need to whitelist the various Sql methods you 
call using the script security plugin




--
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/ae5f5bf0-5f86-092a-a09e-4c4f5f704b2f%40perforce.com.
For more options, visit https://groups.google.com/d/optout.


Re: Running SQL queries from a pipeline script?

2017-01-16 Thread Peter McNab

On 1/12/2017 1:53 PM, Peter McNab wrote:
Has anyone got a working solution for running SQL queries from a 
pipeline script (specifically MySQL?)


Pete

Answering my own post...I've found a method that functions, although 
it's not ideal.


1) Install the "Pipeline Classpath Step Plugin

2) Make my pipeline script (from SCM) be essentially a small wrapper:
  pipelinePath = 
  addToClasspath pipelinePath
  node('master') {
load "${pipelinePath}/Jenkinsfile"
  }

3) In the Jenkinsfile, add "import groovy.sql.Sql"

4) Add this into the Jenkinsfile:
  stage ('SQL Test') {
node('remote_node') {
def sql = Sql.newInstance("jdbc:mysql://DBHOST/DBSCHEMA", 
"DBUSER", "DBPASSWORD", "com.mysql.jdbc.Driver")

query = "SELECT * from myTable"
println sql.rows(query)
sql.close()
}
}

5) Note that you will need to whitelist the various Sql methods you call 
using the script security plugin


--
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/83eccabf-a68f-d756-1a89-505d6337e13a%40perforce.com.
For more options, visit https://groups.google.com/d/optout.


Running SQL queries from a pipeline script?

2017-01-12 Thread Peter McNab
Has anyone got a working solution for running SQL queries from a 
pipeline script (specifically MySQL?)


Pete

--
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/626085ee-8401-73ba-d512-3bb8f9371a1c%40perforce.com.
For more options, visit https://groups.google.com/d/optout.


Re: Running Job from pipleline - old code is excuted

2017-01-11 Thread Peter McNab
I saw a case like then after I changed the name of my Jenkinsfile, but 
forgot to update the filename in the "script to execute" part of the job 
configuration.


Somewhat surprised to see that my workspace wasn't being cleaned between 
jobs, but it had me scratching my head for a bit.


Pete



On 1/11/2017 8:00 AM, Boaz Nahum wrote:

Hi.

I'm using Jenkins 2.32.1 running on WIndows Server

The jenkinsfile that describe the pipeline is something like this:
|
node('boaz'){
|

println "Hello from node ${env.NODE_NAME}"

stage('preparation') {

node('boaz') {

def parameters = [

[$class: 'StringParameterValue', name: 
'param_sandbox_path', value: '${sandboxPath}']



];

build job: "periodic-build-1-preparation", parameters: 
parameters

}
}
}

I'm not using SCM to create workspace.

The job "periodic-build-1-preparation" The job is freestyle job with 
one build step which is shell script
The job started and run as expected. Then I change it, but no matter 
what I tried to do -*the old job code is running*. I know it because 
it is shell script that echo the commands before running.


Thanks
Boaz





--
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/7bed6558-fce2-4c26-a7c9-1fb91a3ab02d%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/3d1f8f92-241d-69cd-ce1d-d6a2da198eee%40perforce.com.
For more options, visit https://groups.google.com/d/optout.


Re: Pipeline: Hos to test them locally

2016-12-12 Thread Peter McNab
The (far from perfect) method we've been using is to use a "testing" 
pipeline job.  Rather than fetching the project from source, it is an 
explicit script that uses a "load" to load in the "real" pipeline script 
from my development environment (which is available via NFS).


sourcepath = '
node('master') {
  load "${sourcepath}/Jenkinsfile"
}

That allows me to just save locally and run the job.

Even better, I can then run the job using the jenkins-cli.jar and see 
the output in my shell which removes the need to interact with the 
jenkins UI altogether.


java -jar jenkins-cli.jar -s $JENKINS_URL build $JOB_NAME -s -v

Of course you have to be disciplined about checking in WIP and making 
sure that all files your pipeline is trying to use checked in 
eventually, and there are some cases where the above method acts a 
little differently than when pulling from SCM.  Also be sure to check 
"Use Groovy Sandbox" since pipeline scripts coming from SCM have that set.


Pete

On 12/10/2016 9:59 AM, Michael Kobit wrote:
You can use the "Replay" option, which might help you iterate a little 
bit faster. There isn't really a good way to test and validate that 
your pipeline is correct other than just running it.


https://issues.jenkins-ci.org/browse/JENKINS-33925 is open for a test 
framework for Jenkinsfile.


On Fri, Dec 9, 2016 at 1:20 AM Victor Martinez 
mailto:victormartinezru...@gmail.com>> 
wrote:


Hi there,

Just wondering if there is any new supported feature of testing
Jenkinsfile, aka pipelines, locally, if so, where can i find some
examples/docs? I want to get rid of the manual and tedious process
of pushing changes to my repo then look at the jebkibs job andsee
whether it does what i coded. I'd like to speed up my development
with lets say some TDD. If no, will it be supported in the near
future? Or it doesnt make sense?

Thanks guys

--
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
<mailto:jenkinsci-users%2bunsubscr...@googlegroups.com>.
To view this discussion on the web visit

https://groups.google.com/d/msgid/jenkinsci-users/c6122b07-85f3-407b-8e81-ae23651e0b27%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 
<mailto:jenkinsci-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CALELY9HHZ1wnJq6fvXgBS5DZGxTjMRZo%2B_PxpRZNQDHBJ5ubsQ%40mail.gmail.com 
<https://groups.google.com/d/msgid/jenkinsci-users/CALELY9HHZ1wnJq6fvXgBS5DZGxTjMRZo%2B_PxpRZNQDHBJ5ubsQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.

For more options, visit https://groups.google.com/d/optout.



--
Peter McNab | Engineering Tools Tech Lead
T: +1 510-473-3124 | M: +1 408-203-7114
http://www.perforce.com

--
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/584EDC1C.4080604%40perforce.com.
For more options, visit https://groups.google.com/d/optout.