Re: Debian update overwrites environment settings

2024-01-10 Thread Jochen Wiedmann

Thanks, Mark,

your suggestion works perfectly. For the record, I now have a 
file /etc/systemd/system/jenkins.service.d/override.conf with the following 
content:

[Service]
Environment="JAVA_HOME=/usr/lib/jvm/temurin-17-jdk-amd64"
Environment="JENKINS_PORT=8008"

This changes both the JVM, that is used to run Jenkins, and the port number.

Jochen
 

On Tuesday, January 2, 2024 at 8:30:08 PM UTC+1 Mark Waite wrote:

> On Tuesday, January 2, 2024 at 12:22:51 PM UTC-7 Jochen wrote:
>
>
> Hi,
>
> I am using the Jenkins Debian packages from
>
> https://pkg.origin.jenkins.io/debian/
>
> to install, and update Jenkins. In general, I'm quite happy with that. 
> There is one exception, though:
>
> My setup requires changing of two environment variables, JENKINS_PORT, and 
> JAVA_HOME. Right now, I have configured those by editing jenkins.service. 
> In other words, I am advising systemd to set the proper values.
>
> The problem with that: Any update of Jenkins (of which there are quite a 
> few, thankfully) replaces the jenkins.service file, thus overwriting my 
> changes. In other words: After each update, I need to reapply my changes to 
> jenkins.service.
>
> Is there any better location for those values, that survives updates?
>
>
> There is a better location for those values and it will survive updates.  
> The "Managing systemd services" 
>  
> page describes the "systemctl edit jenkins" command that creates a local 
> copy of the overrides file .  That copy is preserved across upgrades.
>
> Mark Waite
>  
>

-- 
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/1d618ff3-a490-4c7b-ae5b-04d5c7824b4bn%40googlegroups.com.


Debian update overwrites environment settings

2024-01-02 Thread Jochen Wiedmann

Hi,

I am using the Jenkins Debian packages from

https://pkg.origin.jenkins.io/debian/

to install, and update Jenkins. In general, I'm quite happy with that. 
There is one exception, though:

My setup requires changing of two environment variables, JENKINS_PORT, and 
JAVA_HOME. Right now, I have configured those by editing jenkins.service. 
In other words, I am advising systemd to set the proper values.

The problem with that: Any update of Jenkins (of which there are quite a 
few, thankfully) replaces the jenkins.service file, thus overwriting my 
changes. In other words: After each update, I need to reapply my changes to 
jenkins.service.

Is there any better location for those values, that survives updates?

Thanks,

Jochen


-- 
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/c40ced17-30ad-4082-98a3-8b96ff30cf42n%40googlegroups.com.


Re: Combine a multi-branch, and a multi-configuration project

2023-11-15 Thread Jochen Wiedmann
Thanks, Mark,

The scripted pipeline approach sounds fine for me.

Jochen

On Tuesday, November 14, 2023 at 5:09:42 PM UTC+1 Mark Waite wrote:

> On Tuesday, November 14, 2023 at 7:26:38 AM UTC-7 jochen wrote:
>
>
> Hi,
>
> is it possible to combine multi-branch pipeline, and a multi-config 
> project?
>
> Or, in other words: I have a multi-branch pipeline project, which uses a 
> fixed JDK, and a fixed Maven version. What I would like to have, would be a 
> matrix of builds for every branch with different JDK's, and Maven versions.
>
>
> How about a matrix build with declarative Pipeline as described in 
> https://www.jenkins.io/blog/2019/11/22/welcome-to-the-matrix/
>
> If you use scripted Pipeline, then you could consider a matrix build with 
> scripted Pipeline as described in 
> https://www.jenkins.io/blog/2019/12/02/matrix-building-with-scripted-pipeline/
>
> Darin Pope created a video that illustrates the ideas in 
> https://www.youtube.com/watch?v=HsvO2nDlDSI
>
> Mark Waite
>

-- 
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/8c7b2f2c-2489-4e29-a879-8ccf8a61de29n%40googlegroups.com.


Combine a multi-branch, and a multi-configuration project

2023-11-14 Thread Jochen Wiedmann

Hi,

is it possible to combine multi-branch pipeline, and a multi-config project?

Or, in other words: I have a multi-branch pipeline project, which uses a 
fixed JDK, and a fixed Maven version. What I would like to have, would be a 
matrix of builds for every branch with different JDK's, and Maven versions.

Thanks,

Jochen

-- 
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/5dad9d57-3b1b-4a18-b956-8f369f553aa7n%40googlegroups.com.


Re: Shared Library: Converting a complete pipeline to a single step.

2023-01-18 Thread Jochen Wiedmann
Okay, is there anything that I could use as a reference to the code
directory instead?


On Wed, Jan 18, 2023 at 3:17 PM 'Xavier Raynaud' via Jenkins Users <
jenkinsci-users@googlegroups.com> wrote:

> Hi,
>
> AFAIK, WORKSPACE is defined per agent, not for a global pipeline.
> For instance, if you run a pipeline on two distincts agents, each of them
> will have its own WORKSPACE
>
>
>
> *Xavier Raynaud*
> *Integration & Release Manager • Kalray*
> Phone: +33 6 32 19 22 56
> *xrayn...@kalrayinc.com * • *www.kalrayinc.com*
> <https://www.kalrayinc.com>
>
> [image: Kalray logo] <https://www.kalrayinc.com>
>
> * Please consider the environment before printing this e-mail.*
> This message contains information that may be privileged or confidential
> and is the property of Kalray S.A. It is intended only for the person to
> whom it is addressed. If you are not the intended recipient, you are not
> authorized to print, retain, copy, disseminate, distribute, or use this
> message or any part thereof. If you receive this message in error, please
> notify the sender immediately and delete all copies of this message.
>
>
> --
> *From: *"Jochen Wiedmann" 
> *To: *"Jenkins Users" 
> *Sent: *Wednesday, January 18, 2023 3:00:00 PM
> *Subject: *Shared Library: Converting a complete pipeline to a single
> step.
>
> Hi,
>
> I have a build job with the following pipeline, which works just fine:
>
> @Library('isccr-addons')_
> pipeline {
> agent any
> stages {
> stage ('init') {
> steps {
> isccrExec "${ISCCR_ADDONS_CONFIG}", "${WORKSPACE}
> }
> }
> }
>
> The "isccrExec" is a step, that's specified in my shared library.
> I expect to have quite a lot of these build jobs. So, I am thinking
> about moving as much code as possible to the shared library.
> I have tried to create a new step "isccrPipeline" with the following
> definition:
>
>  pipeline {
> agent any
> stages {
> stage ('init') {
> steps {
> isccrExec "${ISCCR_ADDONS_CONFIG}", "${WORKSPACE}
> }
> }
> }
>
> Basically, that's just the same. Now I am trying to use that step with this
> new build pipeline:
>
> @Library('isccr-addons')_
> isccrPipeline "${ISCCR_ADDONS_CONFIG}", "${WORKSPACE}
>
> Unfortunately, that fails with this error message:
>
> groovy.lang.MissingPropertyException: No such property: WORKSPACE for
> class: groovy.lang.Binding
>
> Any ideas, what's wrong?
>
> Thanks,
>
> Jochen
>
> --
> 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/09e51da7-e421-44f7-b1c9-d169f9c19fc2n%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/09e51da7-e421-44f7-b1c9-d169f9c19fc2n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> --
> 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/655303093.2695969.1674051462757.JavaMail.zimbra%40kalray.eu
> <https://groups.google.com/d/msgid/jenkinsci-users/655303093.2695969.1674051462757.JavaMail.zimbra%40kalray.eu?utm_medium=email&utm_source=footer>
> .
>


-- 
Philosophy is useless, theology is worse. (Industrial Disease, Dire Straits)

-- 
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/CAF8HOZ%2BAq0Fi67FWjyX141t6k%2BPtfPtLg0Wru%3Dm5%3DAiyqFVMeA%40mail.gmail.com.


Shared Library: Converting a complete pipeline to a single step.

2023-01-18 Thread Jochen Wiedmann

Hi,

I have a build job with the following pipeline, which works just fine:

@Library('isccr-addons')_
pipeline {
agent any
stages {
stage ('init') {
steps {
isccrExec "${ISCCR_ADDONS_CONFIG}", "${WORKSPACE}
}
}
}

The "isccrExec" is a step, that's specified in my shared library.
I expect to have quite a lot of these build jobs. So, I am thinking
about moving as much code as possible to the shared library.
I have tried to create a new step "isccrPipeline" with the following
definition:

 pipeline {
agent any
stages {
stage ('init') {
steps {
isccrExec "${ISCCR_ADDONS_CONFIG}", "${WORKSPACE}
}
}
}

Basically, that's just the same. Now I am trying to use that step with this
new build pipeline:

@Library('isccr-addons')_
isccrPipeline "${ISCCR_ADDONS_CONFIG}", "${WORKSPACE}

Unfortunately, that fails with this error message:

groovy.lang.MissingPropertyException: No such property: WORKSPACE for 
class: groovy.lang.Binding

Any ideas, what's wrong?

Thanks,

Jochen

-- 
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/09e51da7-e421-44f7-b1c9-d169f9c19fc2n%40googlegroups.com.


HTML pages as archived artifacts

2023-01-13 Thread Jochen Wiedmann

Hi,

one of my build jobs is creating a few reports (HTML pages), that are being 
archived as artifacts.

The created pages appear to be perfectly fine: If I download, and open 
them, then thy look exactly as expected.

Unfortunately, they don't look the same, if I view them within Jenkins by 
clicking on the respective artifact. I'm not enough of a web developer to 
tell, what's wrong, exactly, but the problem appears to be in the gray area 
of CSS / JavaScript.

Any ideas, what might be wrong, or suggestion, what I might do different?

Thanks,

Jochen 

-- 
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/0fd05823-0066-4797-86b5-b2ddff4d2bcbn%40googlegroups.com.


Private jar file in a shared library

2022-10-27 Thread Jochen Wiedmann

Hi,

reading through https://www.jenkins.io/doc/book/pipeline/shared-libraries/
I get the impression, that @Grab is bound to a (possibly local) Maven 
repository. Which is alright, if I am using jar files from Maven central, 
or something like that.

In my case, I'd much rather do something like

  @Grab('lib/myPrivate.jar')

Is that possible, or must I impose the shared library users to somehow 
create a local Maven repository?

And, while we're at it: Is it possible, to distribute the shared library as 
a zip file, or whatever, rather than as a Git repository?


Thanks,

Jochen

P.S: In case, you are asking: I anicipate, that a lot of shared library 
consumers will be in a secure environment, with no access to external 
repositories.



-- 
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/46c11068-51f3-48de-a0c5-11e9b926429dn%40googlegroups.com.


Properties in a pipeline

2022-05-17 Thread Jochen Wiedmann

Hi,

I've got a build job with a pipeline, like below. (Lots of details omitted, 
obviously.)

Now, according to the "Pipeline Utility Steps", I understand, that I can 
use something
like

  def props = readProperties file: 'dir/my.properties', text: 
'other=Override'

to read a property file from the workspace. Questions:

  1.) Where in the pipeline script would I place the above statement?
(Preferrably at a central location, like right at the beginning.)
  2.) How can I use these properties? What I would like to have would be
   something like
   if (props["build.host"]) {
   ssh ${build.host} sh "Some Command"
} else {
sh "Some Command"
}

Thanks,

Jochen



pipeline {
agent any
tools { 
maven 'Maven3' 
jdk 'Java8' 
}
stages {
stage ('build') {
steps {
withMaven(
) {
script {
}
}
}
}
stage ('collect profiler data') {
steps {
}
}
}
}

-- 
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/56a1cf68-fc40-47df-b30b-95c2ce02bd8bn%40googlegroups.com.


Re: overwrite an environment variable

2021-04-15 Thread Jochen Wiedmann
How about writing the value to a temporary file instead? A shell
script could use the file later on (in another stage) to set the
environment variable.

On Wed, Apr 14, 2021 at 9:01 PM webde...@gmail.com
 wrote:
>
> hey, all!
>
> Here's what I would like to do:
>
> 1. in the pipeline itself, create an environment variable.
> 2. pass that environment variable to a job
> 3. that job will overwrite the environment variable's value at the top level
> 4. a later job will use this new value within its execution.
>
> something like:
>
> pipeline {
> agent {
> label 'Computer'
> }
>
> environment {
> 1.pipelineVariable = "15"3. (after the changeVariableValue job, 
> variable value is now 7)
> }
>
> stages {
> stage('change variable value') {
> steps {
> script {
> 2build job: changeVariableValue
> parameter: [[$class: 'StringParameterValue', name: 
> 'PipelineVariable', """${pipelineVariable}"""]]
>}
> }
> }
> stage('new variable value') {
> steps {
> script {
> 4build job: newVariableValue  
>   
>   parameter: [[$class: 'StringParameterValue', name: 'PipelineVariable', 
> """${pipelineVariable}"""]]
>}
> }
> }
> }
> }
>
> The jobs are written in Powershell.
>
> Is there a way 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/13fe1896-18d5-4566-99b6-5b1044b7934cn%40googlegroups.com.



-- 

Look, that's why there's rules, understand? So that you think before
you break 'em.

-- (Terry Pratchett, Thief of Time)

-- 
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/CAF8HOZJF0xeVXFagZwxDQvgrWroi%3DC%2BsQXhDkQ5KJmnDcHWteQ%40mail.gmail.com.


Automatically create initial admin user

2021-03-11 Thread Jochen Wiedmann

Hi,

I am trying to set up a docker image, which should be ready to use. In 
particular, I wouldn't want the image user to read the contents of the 
initial_admin_password file from the Docker log or from the running 
container. Instead, I would want something like "Read the initial admin 
details from a file, which I specify be setting an environment variable." 
Or, whatever works.

How would you do that?

Thanks,

Jochen

-- 
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/bb7ef044-d9f0-484d-9c44-1433d2a9decfn%40googlegroups.com.


Re: Portable Maven launch

2021-01-24 Thread Jochen Wiedmann
Thanks,

sounds like what I was looking for. But then: Any ideas, what's wrong in my 
script?

pipeline {
agent any
tools { 
maven 'Maven3' 
jdk 'Java8' 
}
stages {
stage ('afw-core') {
steps {
withMaven(
 // Maven installation declared in the Jenkins "Global 
Tool Configuration"
 maven: 'Maven3',

// Use `$WORKSPACE/.repository` for local repository 
folder to avoid shared repositories
mavenLocalRepo: '.repository',
) {
if (isUnix()) {
sh 'mvn -fafw/afw-core/pom.xml -Pjacoco 
-Dmaven.test.failure.ignore=true clean install'
} else {
bat 'mvn.cmd -fafw/afw-core/pom.xml -Pjacoco 
-Dmaven.test.failure.ignore=true clean install'
}
}
}
}
stage ('afw-bootstrap') {
steps {
withMaven(
 // Maven installation declared in the Jenkins "Global 
Tool Configuration"
 maven: 'Maven3',

// Use `$WORKSPACE/.repository` for local repository 
folder to avoid shared repositories
mavenLocalRepo: '.repository',
) {
if (isUnix()) {
sh 'mvn -fafw/afw-bootstrap/pom.xml -Pjacoco 
-Dmaven.test.failure.ignore=true clean install'
} else {
bat 'mvn.cmd -fafw/afw-bootstrap/pom.xml -Pjacoco 
-Dmaven.test.failure.ignore=true clean install'
}
}
}
}
}
}

The error message I am getting:


org.codehaus.groovy.control.MultipleCompilationErrorsException: startup 
failed:
WorkflowScript: 17: Expected a step @ line 17, column 9.
if (isUnix()) {
   ^
WorkflowScript: 34: Expected a step @ line 34, column 9.
if (isUnix()) {
   ^

On Sunday, January 24, 2021 at 5:54:26 PM UTC+1 geoffroy...@gmail.com wrote:

> Hello
> you probably want to use 
> https://www.jenkins.io/doc/pipeline/steps/workflow-basic-steps/#isunix-checks-if-running-on-a-unix-like-node
>
>
> On Saturday, 23 January 2021 at 21:19:43 UTC+1 jochen@gmail.com wrote:
>
>>
>> Hi,
>>
>> I've got a pipeline file, that should be executable on a Windows build 
>> server, and on a Linux build server. The pipeline is launching Maven as 
>> follows:
>>
>> On Linux:
>>
>> sh "mvn "
>>
>> But on Windows, this appears not to work, so I've got to use:
>>
>>bat "mvn.cmd " 
>>
>> Right now, I can use either of these steps, so have to choose between 
>> Windows, and Linux. Is there any possibility to get this portable? I am 
>> thinking something like
>>
>>if (isWindows()) {
>>bat "mvn.cmd " 
>>} else {
>> sh "mvn "
>>}
>>
>> Thanks,
>>
>> Jochen
>>
>>
>>
>>

-- 
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/e083204b-5dcd-4765-bbad-d9fa0d96878fn%40googlegroups.com.


Portable Maven launch

2021-01-23 Thread Jochen Wiedmann

Hi,

I've got a pipeline file, that should be executable on a Windows build 
server, and on a Linux build server. The pipeline is launching Maven as 
follows:

On Linux:

sh "mvn "

But on Windows, this appears not to work, so I've got to use:

   bat "mvn.cmd " 

Right now, I can use either of these steps, so have to choose between 
Windows, and Linux. Is there any possibility to get this portable? I am 
thinking something like

   if (isWindows()) {
   bat "mvn.cmd " 
   } else {
sh "mvn "
   }

Thanks,

Jochen



-- 
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/20d737c4-3763-421a-9e54-1b414f93169an%40googlegroups.com.