Re: Jenkins not able to launch the slave due to unrecognizable JAVA_HOME

2024-04-19 Thread 'Maciej Jaros' via Jenkins Users

Just do this on the agent:

 * Get JDK 17 from Adoptium
   
   (Linux x64 in my case).
 * Unpack to |/var/jenkins|.
 * Rename unpacked “jdk[version]” to “jdk”.
 * Check: |/var/jenkins/jdk/bin/java -version|

Jenkins agent will use |/var/jenkins/jdk/bin/java| over any other version.

Cheers,
Nux

Sai Bhargav Kottisa (2024-04-18 18:40):

Hi,

I have upgraded java on both the controller and agent machines to 
OpenJdk 17 and tried to launch again via ssh but still i am getting 
the same error


*Controller* machine(*/usr/lib/jvm/Openjdk_17.0.6.0/bin/java*
* drwxr-xr-x* 10 *root* *root* 131 Jan 13  2023 *Openjdk_17.0.6.0* )
*
*
*Agent* machine (*/etc/java/Openjdk_17.0.6.0/bin/java*
*drwxr-xr-x* 10 *root    root*      131 Jan 14  2023 *Openjdk_17.0.6.0*)

SSHLauncher{host='md1npdvlnx416.dev.corp.local', port=22, 
credentialsId='taf-jenkins', jvmOptions='', javaPath='', 
prefixStartSlaveCmd='', suffixStartSlaveCmd='', 
launchTimeoutSeconds=60, maxNumRetries=10, retryWaitTime=15, 
sshHostKeyVerificationStrategy=hudson.plugins.sshslaves.verifiers.NonVerifyingKeyVerificationStrategy, 
tcpNoDelay=true, trackCredentials=true} [04/18/24 12:27:46] [SSH] 
Opening SSH connection to md1npdvlnx416.dev.corp.local:22. [04/18/24 
12:27:46] [SSH] WARNING: SSH Host Keys are not being verified. 
Man-in-the-middle attacks may be possible against this connection. 
[04/18/24 12:27:46] [SSH] Authentication successful. [04/18/24 
12:27:46] [SSH] The remote user's environment is: Checking Java 
version in the PATH Java is not in the PATH nor configured with the 
javaPath setting, Jenkins will try to guess where is Java, this guess 
will be removed in the future. :Launch agents via SSH [04/18/24 
12:27:46] [SSH] Checking java version of /var/lib/jenkins/jdk/bin/java 
Couldn't figure out the Java version of /var/lib/jenkins/jdk/bin/java 
[04/18/24 12:27:46] [SSH] Checking java version of java Couldn't 
figure out the Java version of java [04/18/24 12:27:46] [SSH] Checking 
java version of /usr/bin/java Couldn't figure out the Java version of 
/usr/bin/java [04/18/24 12:27:46] [SSH] Checking java version of 
/usr/java/default/bin/java Couldn't figure out the Java version of 
/usr/java/default/bin/java [04/18/24 12:27:46] [SSH] Checking java 
version of /usr/java/latest/bin/java Couldn't figure out the Java 
version of /usr/java/latest/bin/java [04/18/24 12:27:46] [SSH] 
Checking java version of /usr/local/bin/java Couldn't figure out the 
Java version of /usr/local/bin/java [04/18/24 12:27:46] [SSH] Checking 
java version of /usr/local/java/bin/java Couldn't figure out the Java 
version of /usr/local/java/bin/java java.io.IOException: Java not 
found on hudson.slaves.SlaveComputer@3242743c. Install Java 8 or Java 
11 on the Agent. at 
hudson.plugins.sshslaves.JavaVersionChecker.resolveJava(JavaVersionChecker.java:83) 
at 
hudson.plugins.sshslaves.SSHLauncher.lambda$launch$0(SSHLauncher.java:460) 
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) 
at 
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) 
at 
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) 
at java.base/java.lang.Thread.run(Thread.java:829) [04/18/24 12:27:46] 
Launch failed - cleaning up connection [04/18/24 12:27:46] [SSH] 
Connection closed.




--
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/7fab73df-4486-1e10-a05a-5c846ac6a89c%40mol.com.pl.


Re: Need IP address of Jenkins

2024-02-23 Thread 'Maciej Jaros' via Jenkins Users

|# You can check like so: dig +short domain.com|

|nslookup domain.com|

Or other tools you have handy.

surabhi vinchurkar (2024-02-23 08:30):

Hello Team,
I need list of common Jenkins IP addresses or please confirm does such 
common IP addresses available or not, or we have to check on our local 
server?

Regards,
Surabhi

On Thursday, February 22, 2024 at 10:53:35 PM UTC+5:30 
alan.l...@gmail.com wrote:


This looks like you're asking for information from us that is
private and specific for your company.  We can't provide
information on your IP addresses or configuration.  You need to
reach out to whomever manages your Jenkins server at your company.

On Thursday, February 22, 2024 at 7:56:40 AM UTC-7
surabhivi...@gmail.com wrote:

Hello team,

Please consider it as *urgent *and guide me to whom I have to
reach out for this.
Surabhi

On Wednesday, February 21, 2024 at 1:03:04 PM UTC+5:30 surabhi
vinchurkar wrote:

Hello Team,

Waiting for your response.

Thank you

On Tuesday, February 20, 2024 at 7:10:21 PM UTC+5:30
surabhi vinchurkar wrote:

Hi Team,

We are trying to migrate the Flosum Pipeline (with
Jenkins WebHook for Selenium scripts) setup from Azure
to AWS machine.

The Setup is working fine in the Azure machine and we
need to do the same setup in AWS machine.But we are
getting the below error in AWS. We recently changed
the Jenkins URL from HTTP to HTTPS.

Error message: System.CalloutException: Read timed out

I have whitelisted Salesforce IP addresses for inbound
rule. But for outbound rule, required Salesforce IP
addresses and Jenkins IP addresses.

*Requesting you to provide me the list of Jenkins IP
addresses and port. *(For setup I have used port 8080
and 8443)

**

Note: The inbound rule specifies from where the server
can be accessed. The outbound configuration determines
where the server can obtain access. In the inbound
rule you should have Salesforce IP addresses, and in
the outbound rule you should have Salesforce IP
addresses and Jenkins IP addresses.

--
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/e02ef0dc-c5e6-4069-a658-2c77b2fbfa75n%40googlegroups.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/30b059be-7cb0-4849-f5d4-5174c5951851%40mol.com.pl.


Re: id_rsa" is not a valid key file.

2023-10-12 Thread 'Maciej Jaros' via Jenkins Users

praveen@gmail.com (2023-10-11 06:40):
We are setting up gerrit trigger in jenkins & getting id_rsa" is not a 
valid key file error

Verified the file permission
drwx--   2 x xx 4.0K Oct 11 04:39 .ssh
-rw---  1 x xx 2.6K Oct 11 04:23 id_rsa --


That key seems a bit short for RSA, maybe jenkins-gerrit requires longer 
one?


Another option I would see is that the client is old and will not be 
able to use RSA at all. OpenSSH 8.8 disables RSA using SHA-1 and so you 
might need to use ECDSA key. ECDSA might work in clients as far back as 
in OpenSSH 5.x and be able to connect event to OpenSSH 9.x based servers.


So you might want to generate a new key (and configure the key with gerrit):
ssh-keygen -t "ecdsa-sha2-nistp521"

Regards,
Maciej Nux.

--
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/aac8bd13-13da-e90e-fe7a-9bb83c1e19c7%40mol.com.pl.


Re: How does one deploy to webdav server?

2023-08-28 Thread 'Maciej Jaros' via Jenkins Users

'Kari Cowan' via Jenkins Users (2023-08-28 14:11):

I was looking for a plugin to deploy over WebDav - any such thing?

How about example over pipeline?


By WebDav you mean an SVN server? Don't think I've ever used WebDav 
without SVN, but if you have a WebDav then you should be able to setup 
SVN on it.


You can use SVN to publish build artificats to it. SVN is pretty good in 
handling large files (contrary to a basic Git server). So you can build 
stuff and commit files to an SVN repo. And then download the files in 
another jobs. That should be fairly easy as long as you don't need 
authorization.


Cheers,
Nux

--
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/566d1d35-2f6b-a5b5-b450-f5d019a25b28%40mol.com.pl.


Re: Enquiry: Reliability of "Plugin Usage" Tool and Alternatives

2023-08-24 Thread 'Maciej Jaros' via Jenkins Users

The plugin seems like a good starting point...
https://stackoverflow.com/a/36279537/333296

...but if you use pipeline you would have to analyse it yourself probably:
Plugins Usage Plugin isn't very useful IMO because it doesn't detect 
plugin usage from pipeline jobs. I installed this months ago and the 
Plugin only reports that 4/100 of my installed plugins are used and I 
know this to be false. Then I found their own docs admit this as well: 
"Plugins used in pipeline scripts would not be listed normally as used 
by jobs, because they are used dynamically in Jenkinsfiles." 


Also it would be nice if there was some dependency tree for the 
installed plugins. Pipeline has a lot of dependencies and you cannot 
uninstall most of the plugin if you use that (e.g. Folders seem to be 
required).


Cheers,
Maciej Nux

Onkar Kadam (2023-08-22 08:01):


Hi,

Our team is looking to optimize our Jenkins environment by removing 
unused plugins. We came across the "Plugin Usage" tool and wonder 
about its reliability. Any insights? Also, could you help us with any 
alternative suggestions.



Thanks,

Onkar Kadam



--
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/93db96cc-733b-6d5c-939f-6367b62716e8%40mol.com.pl.


Re: Executing external Groovy script in Jenkins 2

2023-08-02 Thread 'Maciej Jaros' via Jenkins Users

'Maciej Jaros' via Jenkins Users (2023-08-02 11:55):


Can I load a groovy class in some other way? Or maybe I can enable 
some standalone/single-user/single-admin mode or something that 
disables all this security checks?


Posted to the community forum/Q too
https://community.jenkins.io/t/executing-external-groovy-script-in-jenkins-2/8802?u=nux

--
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/559048a1-9ecd-3917-cd35-1c68b407dbdb%40mol.com.pl.


Executing external Groovy script in Jenkins 2

2023-08-02 Thread 'Maciej Jaros' via Jenkins Users

Hi.

I have some Groovy scripts that worked just fine in Jenkins 1.x but are 
now broken in 2.x. This is actually blocking my update, so I would be 
grateful for any suggestions on how to proceed.


I run the script in a post build step.


I already used Permissive Script Security to try and disable additional 
security added in Jenkins 2.x (which honestly I don't need as I'm the 
only person editing jobs).


It now breaks on this code I think:
```
// load class
def scriptDir = "/var/www/jenkins-groovy-helpers/JenkinsBuildHelper";
def parent = getClass().getClassLoader();
def loader = new GroovyClassLoader(parent);
def buildLogChecker = loader.parseClass(new File(scriptDir, 
"BuildLogChecker.groovy")).newInstance();

```

Jenkins 2.x says:

[PostBuildScript] - [INFO] Executing post build scripts.
ERROR: Build step failed with exception
groovy.lang.MissingMethodException: No signature of method: 
java.lang.Class.newInstance() is applicable for argument types: 
(java.util.LinkedHashMap) values: [[ignoreMode:false, ignoreLevels:[], 
maxLevel:error]]
Possible solutions: newInstance(), newInstance(), 
newInstance([Ljava.lang.Object;), isInstance(java.lang.Object)
    at 
org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:159)




Can I load a groovy class in some other way? Or maybe I can enable some 
standalone/single-user/single-admin mode or something that disables all 
this security checks?


As you can imagine `BuildLogChecker` is used to check log, but also 
needs access to job description as it sets descriptions based on errors 
in the job log (`build.setDescription(...)`). It also sets results:

```
if (!buildLogChecker.firstLogLines.error.isEmpty()) {
    build.setResult(Result.FAILURE);
} else if (!buildLogChecker.firstLogLines.warn.isEmpty()) {
    build.setResult(Result.UNSTABLE);
}
```

Regards,
Maciej Nux.

--
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/2a5df42a-b21d-8c9a-987c-602a89b08374%40mol.com.pl.


What happens to tasks on disconnected slaves?

2018-02-02 Thread 'Maciej Jaros' via Jenkins Users

Hi.

I'm wondering if using Jenkins slaves is the right solution for long 
running tasks on remote servers.


I want to run a long running task (like e.g. restoring databases), but 
I'm worried about temporary connection issues. Note that my Jenkins 
server is non-public and it has a one way connection to the deployment 
server. So I'm planning to use SSH to connect from Jenkins to slave 
(using SSH Slaves plugin).


So... What happens if a Jenkins slave is disconnected from master while 
running my restore task?
Will the task keep on running (i.e. run commands that restore databases 
and run other build steps)?
Will I be able to see log of the tasks from master (i.e. will Jenkins 
automatically re-connect to slave and download logs from slave)?
If not will I be able to at least retrieve a log form the slave (e.g. by 
downloading files manually)?


Regards,
Nux.

--
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/24f23029-6c60-b052-af7d-717e987fc08b%40mol.com.pl.
For more options, visit https://groups.google.com/d/optout.


Re: A job to update other jobs

2017-05-16 Thread 'Maciej Jaros' via Jenkins Users

Morgan Blackthorne (2017-05-12 20:05):
So I'm a little confused as to setting job to a value, but then 
referencing build.setDescription afterwards... or should that be 
job.setDescription?


// loop over jobs (possible also in Script Console)
for (item in hudson.model.Hudson.instance.items) {
  println("Saving " + item);
  item.save();
}

Do I need to save them all, or just the one I modified? Like job.save(); ?


I don't think you need to save jobs after doing something with them. 
That was just an example action in the loop. Just test your commands in 
the script console and see if it works. Make sure you you have backup of 
at least config.xml of your jobs ;-).


Regards,
Nux.

PS: I actually use this loop in our Jenklins installation. I do this to 
re-fresh configs after plugin updates. Doing `save` forces plugins to 
verfiy job config and possibly insert defaults.


--
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/2e786696-48d8-87ca-7d1e-1b2c732bc70b%40mol.com.pl.
For more options, visit https://groups.google.com/d/optout.


Re: A job to update other jobs

2017-05-10 Thread 'Maciej Jaros' via Jenkins Users

Morgan Blackthorne (2017-05-08 19:56):
We're using Chef automation around configuring our Jenkins jobs. 
Basically chef clones a git repo with the job XML files, and then 
tells Jenkins to use them.


What we want to have is:

 1. One job to edit other jobs description to say "FROZEN by 
at " or to remove the FROZEN line (basically a toggle)
 2. Chef will then be updated to look at the job XML currently on the
Jenkins server
 1. If the description includes FROZEN, skip that job and leave it
alone
 2. If the description does not include FROZEN, update the job
from the XML file

I'm not really up to speed on Groovy, so what's the simplest way to 
approach this? (I already know how to do the XML check for step 2, we 
can just look at the XML over HTTP.)


This should get you started...

Install Groovy plugin 
. Use Groovy 
system step -- allows running scripts in Jenkins context (with 
Jenkins.instance available).


Java/Groovy API reference:
http://javadoc.jenkins.io/

// getting any job:
def job = Jenkins.instance.getItem("some-job-name");
// BUT`job` here is not just a Job 
, it is an 
AbstractProject 
.


// set desc. for current build
build.setDescription(someDescriptionString);

// loop over jobs (possible also in Script Console)
for (item in hudson.model.Hudson.instance.items) {
  println("Saving " + item);
  item.save();
}

--
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/08353e5a-6d3e-f01a-1b44-99dd15a3ae4c%40mol.com.pl.
For more options, visit https://groups.google.com/d/optout.


Re: svn error 'ISVNAuthentication provider did not provide credentials'

2017-05-02 Thread 'Maciej Jaros' via Jenkins Users
There is bug in Subversion Plugin. It seem that new versions of this 
plugin cannot handle svn:externals well.


See:
https://issues.jenkins-ci.org/browse/JENKINS-32167

David Aldrich (2017-04-11 14:52):


Hi

Since upgrading:

SCM API plugin from 1.3 to 2.1.1

Subversion Plugin 2.7.1 to 2.7.1

we are seeing the following exception occurring occasionally:

svn: E200015: ISVNAuthentication provider did not provide credentials; 
HTTP authorization cancelled.
at 
org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:66)
at 
org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:57)
at 
org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:798)
at 
org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:391)
at 
org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:379)
at 
org.tmatesoft.svn.core.internal.io.dav.DAVConnection.performHttpRequest(DAVConnection.java:862)
at 
org.tmatesoft.svn.core.internal.io.dav.DAVConnection.exchangeCapabilities(DAVConnection.java:698)
at 
org.tmatesoft.svn.core.internal.io.dav.DAVConnection.open(DAVConnection.java:118)
at 
org.tmatesoft.svn.core.internal.io.dav.DAVRepository.openConnection(DAVRepository.java:1049)
at 
org.tmatesoft.svn.core.internal.io.dav.DAVRepository.getLatestRevision(DAVRepository.java:189)
at 
org.tmatesoft.svn.core.internal.wc2.ng.SvnNgRepositoryAccess.getRevisionNumber(SvnNgRepositoryAccess.java:119)
at 
org.tmatesoft.svn.core.internal.wc2.SvnRepositoryAccess.getLocations(SvnRepositoryAccess.java:195)
at 
org.tmatesoft.svn.core.internal.wc2.ng.SvnNgRepositoryAccess.createRepositoryFor(SvnNgRepositoryAccess.java:46)
at 
org.tmatesoft.svn.core.internal.wc2.remote.SvnRemoteLog.run(SvnRemoteLog.java:160)
at 
org.tmatesoft.svn.core.internal.wc2.remote.SvnRemoteLog.run(SvnRemoteLog.java:35)
at 
org.tmatesoft.svn.core.internal.wc2.SvnOperationRunner.run(SvnOperationRunner.java:21)
at 
org.tmatesoft.svn.core.wc2.SvnOperationFactory.run(SvnOperationFactory.java:1235)
at 
org.tmatesoft.svn.core.wc2.SvnOperation.run(SvnOperation.java:294)
at 
org.tmatesoft.svn.core.wc.SVNLogClient.doLog(SVNLogClient.java:968)
at 
org.tmatesoft.svn.core.wc.SVNLogClient.doLog(SVNLogClient.java:873)
at 
hudson.scm.SubversionChangeLogBuilder.buildModule(SubversionChangeLogBuilder.java:194)
Caused: hudson.util.IOException2: revision check failed on 
/GlobalRegs.tcl 

at 
hudson.scm.SubversionChangeLogBuilder.buildModule(SubversionChangeLogBuilder.java:208)
at 
hudson.scm.SubversionChangeLogBuilder.run(SubversionChangeLogBuilder.java:138)

at hudson.scm.SubversionSCM.calcChangeLog(SubversionSCM.java:725)
at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:860)
at hudson.scm.SCM.checkout(SCM.java:496)
at 
hudson.model.AbstractProject.checkout(AbstractProject.java:1280)
at 
hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604)
at 
jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at 
hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)

at hudson.model.Run.execute(Run.java:1733)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at 
hudson.model.ResourceController.execute(ResourceController.java:97)

at hudson.model.Executor.run(Executor.java:405)

The credentials for the job are correct – they worked fine before the 
upgrade.


The exception occurs following a svn commit.  If I then run the job 
manually it succeeds.


Any advice please?

Best regards

David

--
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/9838a10cbeff41b982300a1aac1daf90%40EUX13SRV1.EU.NEC.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/dffbc5dd-b58c-db9b-c8eb-1ca7a16bef7d%40mol.com.pl.
For more options, visit 

Re: Add the version after the app name (Deploy to Container Plugin)

2017-04-07 Thread 'Maciej Jaros' via Jenkins Users

Elcio Junior (2017-04-06 16:00):

Hi,
I use Jenkins with the Deploy to Container Plugin and I can deploy to 
my server (glassfish).

The app looks like this:

Test.war

But I want to add the version after the app name.
Example:

Test-1.0.war

Could someone tell me what configuration is needed so that when 
accessing the glassfish control panel (4848) the app name is with the 
version?


Not sure about Glasfish, but Tomcat supports war versions with `##`.

E.g. revision 1 app would be:
ROOT##1.war

E.g. revision 123 app would be:
ROOT##123.war

Not sure what if you can only use numbers after `##` or any alpha-numerics.

Regards,
Nux.

--
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/1b9d88a6-a887-c4d2-c8a6-d6885874b569%40mol.com.pl.
For more options, visit https://groups.google.com/d/optout.


Re: Disable new jobs if a build fails

2017-04-04 Thread 'Maciej Jaros' via Jenkins Users

Idan Adar (2017-04-03 15:11):

Hello,

I received a request, which sounds kinda far-fetched to me, but maybe 
I wrong.


Lets assume there is a job that is scheduled to run 3 times ago. End 
to end sort of tests. And at some point one of the job runs fails.
The request here is to block all future PRs for any repository in 
GitHub from triggering their respective jobs (each repo has a 
Jenkinsfile, a PR triggers it).


Is this at all possible? Blocking all jobs until an error is fixed?


I think you would have to manually enable builds after the error is 
fixed, but you can disable builds with Groovy:

def job = Jenkins.instance.getItem("your-job-name");
job.disable()
//job.enable()

Regards,
Nux.

--
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/f5fecaad-dbc3-d665-c35f-15e97345d2fa%40mol.com.pl.
For more options, visit https://groups.google.com/d/optout.


Re: scp files located outside of workspace

2017-04-03 Thread 'Maciej Jaros' via Jenkins Users

t3knoid (2017-03-31 19:50):
Is it possible to scp files located outside of a workspace simply 
using existing Jenkins plugins? I am currently using a Python script 
to this currently by calling the scp command-line. The SCP plugin nor 
Publish over SSH does not appear to support this. Maybe in conjunction 
with another plug-in it is possible.


You can simply run `scp` command from shell execute step. Why would you 
need Python for that? You just need to configure ssh connection to 
whatever server you need to connect with. So basicaly you simply need to 
run `ssh-keygen` on your Jenkins to generate keys and `ssh-copy-id 
your-server` to copy key to your-server. And then...


Copy file to remote:
scp /some/local/file.sh root@your-server:/some/remote/file.sh

Copy dir from remote:
scp -r root@your-server:/some/remote/dir /some/local/dir/

--
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/91f0a3d7-613c-7876-3f5f-c8d701412973%40mol.com.pl.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins plugin for merge.

2017-02-24 Thread 'Maciej Jaros' via Jenkins Users

RRoy (2017-02-22 11:15):

Hi All,

Currently we are using parallel development approach for development 
process in our organization.Please considered the below scenario of 
our build process.


Build Tool -- ant
CI Tool --  Jenkins.
Repository Tool - SVN

We want multiple SVN branches to checkout and code merging between 
this branches should be happen before performing the whole build.


Please suggest us, is there any plugin available in jenkins for 
fulfilled above scenario and implementation for the same.


You can't merge automatically (not just with Jenkins, in general). In 
many cases you have to resolve conflicts before you merge and that 
cannot be done automatically.


Regards,
Nux.

--
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/643f478c-d79d-b9fb-2c1a-718ad783aec0%40mol.com.pl.
For more options, visit https://groups.google.com/d/optout.


Re: multi text parameter

2017-02-20 Thread 'Maciej Jaros' via Jenkins Users
You might want to use Groovy System Script to process those parameters 
(note that /System/ script is not an OS script, it's Jenkins script). It 
will be much easier to process strings in it.


Here is something to get you started. This is a script that schedules 
"Some-job-name" to be run with some parameters. If you use string 
parameters you might want to trim and validate values passed by users to 
avoid some security/consistency problems.


// start
//--
import hudson.model.*

//
// run
//
def appServersString = 
build.buildVariableResolver.resolve("parameterOfCurrentJob")
def appServersList = appServersString.split(',')
for (appServer in appServersList) {
  scheduleAppRollout(appServer)
}

/**
Schedule rollout helper
*/
def scheduleAppRollout(dstServer) {
  def job = Hudson.instance.getJob("Some-job-name")

  // prepare parameters
  def params = []
  params += new StringParameterValue('dstServer', dstServer)
  params += new BooleanParameterValue('somBooleanParamOfTheJobToBeStarted', 
true)
  params += new BooleanParameterValue('imABot', true)
  def paramsAction = new ParametersAction(params)

  //preapre cause
  def cause = new Cause.UpstreamCause(build)
  def causeAction = new CauseAction(cause)

  // run
  println("[INFO] Scheduling rollout to `" + dstServer + "`");
  Hudson.instance.queue.schedule(job, 0, causeAction, paramsAction)
}
//--
// EOF

--
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/22393ccf-5398-d10f-80c8-9f49e42b6a33%40mol.com.pl.
For more options, visit https://groups.google.com/d/optout.


Re: Conditional build parameter

2017-02-14 Thread 'Maciej Jaros' via Jenkins Users

Danny Wong (2017-02-14 07:33):


*Hi All,*

*Is there a way in Jenkins where if I have 2 radio buttons 
(yes/no) as a build parameter. if the user selects “yes”, then a 
dropdown will display and gets populated with data. If no, the 
dropdown disappears from the UI? Is there a way to implement this? 
Thanks!*




There is no built-in way to do that. But you can vote fore a feature 
request here:

https://issues.jenkins-ci.org/browse/JENKINS-19002

There is also a bit hacky script that allows to do what you are asking for:
https://github.com/Eccenux/jenkins-scripts/blob/master/theme/nux-js/parameter-grouping.js

Regards,
Nux.

--
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/97dd6589-995c-ff4c-f91b-157e368b5287%40mol.com.pl.
For more options, visit https://groups.google.com/d/optout.


Build and jump to console in one click?

2017-02-09 Thread 'Maciej Jaros' via Jenkins Users

Hi.

Is it possible to build and jump to console in one click?Most of the 
time when I build jobs I want to see what is going on (observe log).


So is there some plugin that provides "Build and View Log" action. That 
would be very handy. Or maybe something similar is available on Jenkins 2.x?


Regards,
Nux.

--
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/d15f935e-35b7-033f-6b46-c80af7a75895%40mol.com.pl.
For more options, visit https://groups.google.com/d/optout.


Re: Force result change in Groovy

2017-02-09 Thread 'Maciej Jaros' via Jenkins Users

Daniel Beck (2017-02-08 16:01):

On 08.02.2017, at 15:48, 'Maciej Jaros' via Jenkins Users 
<jenkinsci-users@googlegroups.com> wrote:

But that throws `cannot change build result while in COMPLETED`. So can I 
somehow force the result?

While there's probably a way to accomplish that, it's likely other things will 
break as a result of this as (obviously) Jenkins components don't expect build 
results to change after a build is finished.

This looks a lot like an X/Y problem kind of situation. What are you actually 
trying to accomplish?


The problem is the build in question should have failed as it is not 
functional (some artifacts don't work). Other jobs take artifacts from a 
last stable build from this job and deploy this to test (staging) 
server. So this works like so:

build job --stable artifacts--> deploy job --> test server

I ended up doing manual change which seems to work (at least in Jenkins 
1.x):


1. Go to `[jenkins-data]/jobs/[YOUR-job]/builds/[number]/`.
2. Open `build.xml`.
3. Find `` tag.
4. Change resolution to `UNSTABLE`.
5. Reload Jenkins configuration from disk.
6. Make sure `Last stable build (#[number])...` is correct (not the 
one you just changed).


And it seems to work (at least it works if artifacts wasn't removed for 
the older build).


Regards,
Nux.

--
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/b1fdbaed-5911-a3e9-5303-6580b8430c4c%40mol.com.pl.
For more options, visit https://groups.google.com/d/optout.


Force result change in Groovy

2017-02-08 Thread 'Maciej Jaros' via Jenkins Users

Hi.

I wanted to manully change last build from stable to unstable. Is it 
possible? I tried using Groovy


def job = Jenkins.instance.getItem("GOPAC-build-alfa");
def build = job.getLastStableBuild();
build.setResult(Result.UNSTABLE);

But that throws `cannot change build result while in COMPLETED`. So can 
I somehow force the result?


Regards,
Nux.

--
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/c8c7921f-5f72-8931-a91f-ff3184c4cc12%40mol.com.pl.
For more options, visit https://groups.google.com/d/optout.