Run pipelines on multibranch project from Bitbucket Out of sandbox?

2019-03-08 Thread guybrush threepwood
Hello,
I am creating my pipelines asociating Jenkins with a in house bitbucket
using bitbucket webhook and bitbucket pipeline plugin type.
The problem is that When my Jenkins file is executed it is sandboxed
so I. not able to do many things.
For example I'm trying to load a json file which is in the repository
in order make actions in the pipeline based on the info in the file.
and I'm getting this error:

trace 
General[org.jenkinsci.plugins.scriptsecurity.sandbox.whitelists.StaticWhitelist.rejectNew(StaticWhitelist.java:184)
For this instruction:
File f = new File("python");


So my question is:
is there a way I can setup that project to run without sandbox restriction?
if the only option is white listing every "special class" how do I do that
since for this one is not going into the pending aproval sections.

I would like to be able to define privileges for this kind of project but 
not givin full access to any project only to those under my control 
sindeI'm the Jenkins admin.
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/9156a58e-0b08-4f3e-aafc-d73e2daf8d9f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins marking builds failed if any tests are skipped

2019-03-08 Thread iling
It looks like this is ACTUALLY a problem with Pytest.

Using Pytest 4.2.0, the JUnit XML contains the following line (seen above):

 time="2.548">


But with Pytest 3.6.2, this line is:

 time="2.271">
>
 
Notice the "skips" was changed to "skipped" at some point between Pytest 
3.6.2 and 4.2.0.

-- 
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/9da517d7-f29c-40d3-85d2-d1e573f35327%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins marking builds failed if any tests are skipped

2019-03-08 Thread iling
This appears to be a problem with the JUnit plugin. I switched to the XUnit 
plugin and it does not mark the build as failed when a test is skipped.

-- 
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/0ac28f6d-9fd2-42d4-871d-9595babaeb79%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


jenkins to point to custom /usr/local path of python

2019-03-08 Thread Turaco mobile
Hi, I have installed python 3.6 at /usr/local/ on CentOS7. Python script is
build script and able to run succesfully on teminal but not Jenkins.
How/where to specify in jenkins to execute python3.6 script.
In configure Job Under Build Execute shell it's specified as
python3.6 /root/jenkins/buildscripts/name.py

Output:

No emails were triggered.
$ /bin/sh -xe /tmp/jenkins739502728111804628.sh
+ python3.6 /root/jenkins/buildscripts/name.py
/tmp/jenkins739502728111804628.sh: line 2: python3.6: command not found
Build step 'Execute shell' marked build as failure


Pls let me know.

-- 
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/CAC3KZS864iaaLaKVPC_hsSe_bqkt7AjACJm3PZg43a420g7Rgg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Jenkins marking builds failed if any tests are skipped

2019-03-08 Thread iling
Hello,

I have a Jenkins build that runs two very simple tests using Pytest. Pytest 
outputs a JUnit XML file for Jenkins to parse after the tests to determine 
the results.

One of the tests is hard-coded to pass, and the other one is hard-coded to 
be skipped. When both tests are run, the Jenkins build gets labeled 
FAILURE. If the skipping test is removed entirely (meaning only the passing 
test gets run), the build is marked SUCCESS.

Here is the Jenkins console output at the end of the run. The first two 
lines are Pytest stdout, the rest are all from Jenkins.

 generated xml file: /home/jenkins/workspace/debug-test/results/results.xml 
> = 1 passed, 1 skipped in 2.54 seconds 
> ==
> Recording test results
> Archiving artifacts
> [JUnitReportPublisher] Compiling JUnit Html Reports ...
> [JUnit test report builder] Copying XML files from slave: 
> /home/jenkins/workspace/debug-test to master reports directory: 
> /var/lib/jenkins/jobs/debug-test/builds/19/junit-reports-with-handlebars
> [JUnitReportPublisher] Found 1 xml files.
> [JUnit test report builder] 0. Found a xml file: results/results.xml
> [JUnit test report builder] Generating HTML reports
> processing: 
> /var/lib/jenkins/jobs/debug-test/builds/19/junit-reports-with-handlebars/xmlData/results/results.xml
> Build step 'Publish JUnit reports generated with handlebars' changed build 
> result to FAILURE
> Finished: FAILURE
>
>
 And here is the results.xml file:


>name="test_jenkins2" time="0.001">
> debug_test.py:7: SKIP
>   
>name="test_jenkins" time="0.002"/>
>
>  
Is there a setting somewhere that tells either Jenkins, or the plugin that 
parses the XML file, not to mark builds as failed if a test is skipped?

Thank you.

-- 
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/8af8ceef-96ef-4eaf-96c3-bf86cc80d97a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins Installed on Docker Swarm Engine Cluster - How to Handle Slaves?

2019-03-08 Thread Liejun Tao
As far as I tried last year, there was no support to use a docker swarm
cluster to serve as slaves.
The reason is once you start many slaves there is no way to tear down a
specific slave (after it's done with its build) in the new swarm mode, per
my understanding.
I switched to use kubernetes cluster, and it worked well.


On Fri, Mar 8, 2019, 7:49 AM Justin Seiser  We just spun up a dedicated Docker Swarm environment.  I cant seem to find
> a clear answer on the best/preferred way to handle slaves in this style
> environment.
>
> docker-workflow - We use this in AWS, but with the EC2 Plugin, which spins
> up a AMI that has docker installed/configured. Thats not an option here.
> It only appears to semi support the Legacy Standalone swarm, not the actual
> Swarm Mode.
>
> docker-plugin - States it doesnt support Swarm mode, just legacy Swarm
> Standalone
>
> docker-swarm - This appears to be what I want, but there is 0
> documentation i can find on how to use it in pipelines.  It also isnt clear
> if this can run any docker container, or if it requires we build containers
> off of a JNLP enabled container.
>
> There are countless others listed as well.  Some wanting agents installed
> on the docker servers themselves, which is a no go in this environment.
>
> Im really just looking for how other people are handling this, and if it
> is the docker-swarm plugin, any link to any documentation on the pipeline
> syntax.
>
> 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/72970f7f-dd0e-4760-bd00-ad9dfdfbc65e%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/CAMRm5jaB%3DSnrY9e%3DpJGyEhdvn0pbZLMdRdd47OLfdJajRpyF-A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Jenkins Installed on Docker Swarm Engine Cluster - How to Handle Slaves?

2019-03-08 Thread Justin Seiser
We just spun up a dedicated Docker Swarm environment.  I cant seem to find 
a clear answer on the best/preferred way to handle slaves in this style 
environment.

docker-workflow - We use this in AWS, but with the EC2 Plugin, which spins 
up a AMI that has docker installed/configured. Thats not an option here.  
It only appears to semi support the Legacy Standalone swarm, not the actual 
Swarm Mode.

docker-plugin - States it doesnt support Swarm mode, just legacy Swarm 
Standalone

docker-swarm - This appears to be what I want, but there is 0 documentation 
i can find on how to use it in pipelines.  It also isnt clear if this can 
run any docker container, or if it requires we build containers off of a 
JNLP enabled container.

There are countless others listed as well.  Some wanting agents installed 
on the docker servers themselves, which is a no go in this environment.

Im really just looking for how other people are handling this, and if it is 
the docker-swarm plugin, any link to any documentation on the pipeline 
syntax.

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/72970f7f-dd0e-4760-bd00-ad9dfdfbc65e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Build Triggers - Build periodically plugins

2019-03-08 Thread Simon Richter
Hi,

On 07.03.19 22:39, Andrew Poage wrote:

> Anyone know of any plugins that can replace the cron job scheduler with
> simpler more robust scheduler. Essential looking to run jobs every 2nd
> and every 4th Saturday of the month. Since that tends to fluctuate a lot
> using the cron scheduler gets pretty dicey.

The 2nd Saturday of the month must be between the 8th and the 14th,
inclusive, so a range constraint on the day should express this nicely:

# every 2nd and 4th Saturday
H H 8-14 * 6
H H 22-28 * 6

   Simon

-- 
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/516fd546-5505-bb75-6e9e-d1c1eb6546ca%40hogyros.de.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: OpenPGP digital signature


Jenkins in AWS not responding to LB (nor port 8080)

2019-03-08 Thread Arnau Bria
Dear all,

my name is Arnau and I'm new to Jenkins.

We are trying to install  a Jenkins server using cloudformation templates 
from widdix people (https://templates.cloudonaut.io/en/stable/jenkins/). We 
deplyoed it initially using both public/private networks and the jenkins 
server was installed properly. We're now deploying it using our own VPC and 
using Internal networks only and we're facing some issues,

After some debugging we can say that the AWS network settings are working 
and the Load Balancer can talk to the Jenkins EC2 instance to port 8080. In 
logs we see lines like:

[08/Mar/2019:08:41:55 +] "GET /login HTTP/1.1" 200 829 "-" 
"ELB-HealthChecker/2.0"

(we also deployed an apache listening inport 8080 and the LB did respond as 
expected).

But, and here comes the problem, when we put the LB URL in the browser we 
get a ERR_EMPTY_RESPONSE from Jenkins:

Taking a look at the access logs we see lines like:

[08/Mar/2019:08:52:07 +] "GET / HTTP/1.1" 403 677 "-"

so we're reaching the Jenkins Master but it is not responding (well, 
there's a 403 response).

When we restart the service we do see the Jenkins message:

Please wait while Jenkins is getting ready to work ...

Your browser will reload automatically when Jenkins is ready.



And we could even configure it using a ssh tunnel to the port 8080.


So,at this point we're quite lost and we don't understand why jenkins does 
not respond when we contacting it from from anyplace different to the 
master itself.


Could someone give us some help?


System infomation:


Amazon AMI.


- jenkins-2.150.3-1.1.noarch


/etc/sysconfig/jenkins

JENKINS_HOME="/var/lib/jenkins"

JENKINS_JAVA_CMD=""

JENKINS_USER="jenkins"

JENKINS_JAVA_OPTIONS="-Djava.awt.headless=true"

JENKINS_PORT="8080"

JENKINS_LISTEN_ADDRESS="0.0.0.0"

JENKINS_HTTPS_PORT=""

JENKINS_HTTPS_KEYSTORE=""

JENKINS_HTTPS_KEYSTORE_PASSWORD=""

JENKINS_HTTPS_LISTEN_ADDRESS=""

JENKINS_DEBUG_LEVEL="500"

JENKINS_ENABLE_ACCESS_LOG="yes"

JENKINS_HANDLER_MAX="100"

JENKINS_HANDLER_IDLE="20"

JENKINS_ARGS=" --httpListenAddress=0.0.0.0"


config.xml





  

  2.150.3

  NEW

  0

  NORMAL

  true

  

true

  

  

true

false

  

  false

  

  ${JENKINS_HOME}/workspace/${ITEM_FULL_NAME}

  ${ITEM_ROOTDIR}/builds

  

  

  

  

  0

  



  

  all

  false

  false

  



  

  all

  49817

  master

  

false

  

  

  



TIA,
Arnau

-- 
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/53d133d7-fc1f-499e-bf2a-f5928e8baca7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.