Re: Jenkins configuration in JCAS

2021-06-18 Thread Liejun Tao
The JCasC doc is here. https://github.com/jenkinsci/configuration-as-code-plugin/blob/master/docs/features/secrets.adoc It depends on whether you already have an external secret system. On Thu, Jun 17, 2021 at 11:49 PM Anu S wrote: > Hi Liejun* Tao,* > > let me check on this secret m

Re: Jenkins configuration in JCAS

2021-06-17 Thread Liejun Tao
I assume when you put full configurations into JCasc, you already have a way to inject secrets into the config. You may treat the (changeable) global variable as a secret which could be changed from outside (the secret management system). On Thu, Jun 17, 2021 at 2:51 AM Anu S wrote: > Hi Everyo

Re: [Kubernetes Plugin] PVC for each build agent with defined size.

2020-11-22 Thread Liejun Tao
It should be doable by extending this: Dynamic Jenkins Agent from Kubernetes On Sat, Nov 21, 2020 at 6:49 AM Nadir Mouhoubi wrote: > Hello, > > I'm looking for a simple solution without implementing a mutating K8S > Webhook t

Re: Jenkins Kubernetes plugin - scheduling hangs when there are more than 1000 builds in queue

2020-06-06 Thread Liejun Tao
Have you tried this? -Dhudson.slaves.NodeProvisioner.initialDelay=0 \ -Dhudson.slaves.NodeProvisioner.MARGIN=50 \ -Dhudson.slaves.NodeProvisioner.MARGIN0=0.85 \ In the jenkins.log, is there anything interesting when you expect an agent get provi

Re: Kubernetes plugin + vanilla node/agent - classcast exception

2020-05-07 Thread Liejun Tao
You may start the pipeline with agent none, the do one stage with the k8s node, another stage with the other node. On Thu, May 7, 2020, 9:02 AM David Karlsen wrote: > I have a pipeline which uses the Kubernetes Jenkins plugin: > > pipeline { > agent { > kubernetes { > cloud 'icp-gl

Re: Error using gerrit-rest-java-client

2020-04-25 Thread Liejun Tao
rogram and run them from a shell step, > you can test them independently and run them without risking surprises > inside the Jenkins master. > > Mark Waite > > On Tue, Apr 21, 2020 at 9:27 AM Liejun Tao > wrote: > >> Hi, >> >> I'm seeking some

Error using gerrit-rest-java-client

2020-04-21 Thread Liejun Tao
Hi, I'm seeking some help to use gerrit-rest-java-client in Jenkins Shared library. It seems more suitable to seek help in Gerrit forum, but I think there are many Jenkins experts here and if someone uses Gerrit-Jenkins interaction could he

How to analyze a Jenkins Pipeline code with "method code too large" problem

2020-04-09 Thread Liejun Tao
Hi, I see there are many discussions about the pipeline code hit the "method code too large" error. While the simple answer about how to resolve the problem is to "make the pipeline simple", I'm wondering if there is a way to analyze the code to get an understanding what kind of code/function/s

Re: Jenkins Build Timeout

2020-04-07 Thread Liejun Tao
The error itself means the Agent has had no response. Check the Agent side log/status. For example, I've seen one time the Agent is executing an command waiting for user input, causing this error. On Monday, April 6, 2020 at 12:08:00 PM UTC-5, David Foley wrote: > > Hi All, > > Currently I'm ha

How to query out the Jenkins userid from Full name or email address

2020-04-06 Thread Liejun Tao
Hi, I'm trying to resolve userid in pipeline code. I can get the user's full name, or email address, how do I get the corresponding Jenkins userid? The userid is not the one who start the build, as the build is triggered from remote event. The userid/full name/email address match ok in the Jenki

Re: Jenkins Docker Plugin - How to configure to connect to Docker host with TLS

2020-03-26 Thread Liejun Tao
Generate a client certificate which could connect to the Docker host with tls. In Jenkins, add a credential of "Docker Host Certificate Authentication" type with the client certificate. Use the credential in Docker plugin. On Thu, Mar 26, 2020 at 7:58 AM Gil wrote: > Hello All - > > On the Docke

Re: Jenkins + Kubernetes - Cache .m2 for jobs

2020-03-25 Thread Liejun Tao
This is my solution for a little different purpose: use a .m2 cache for common libs. https://github.com/liejuntao001/jenkins-k8sagent-lib/blob/a6ced3975e37fe559c0ae8a918ed01b6920f1efa/resources/podtemplates/base.yaml#L24 The idea is to make a docker image with the most used artifacts(external depen

Re: Kubernetes pligin for jenkins

2020-02-09 Thread Liejun Tao
pod in my cluster exec the pod and ping my jenkins with no issue. > > > On Thu, Feb 6, 2020 at 1:24 PM Liejun Tao wrote: > >> Suggest to run a test pod from your cluster and check network >> connectivity to your jenkins, >> http://ec2-18-140-64-62.ap-southeast-1.compute.am

Re: Kubernetes pligin for jenkins

2020-02-05 Thread Liejun Tao
Suggest to run a test pod from your cluster and check network connectivity to your jenkins, http://ec2-18-140-64-62.ap-southeast-1.compute.amazonaws.com:8080/ On Wed, Feb 5, 2020 at 7:57 PM adrian lee wrote

Re: Declarative script syntax: Archive from specific stage?

2020-01-23 Thread Liejun Tao
According to doc this is supported: https://jenkins.io/doc/book/pipeline/syntax/#post Syntax is like this https://code-maven.com/slides/jenkins-intro/pipeline-post On Thu, Jan 23, 2020 at 11:45 AM David Aldrich wrote: > > > Did you try to write post after stage? > > > It seems that is not allowe

Re: Declarative script syntax: Archive from specific stage?

2020-01-23 Thread Liejun Tao
Did you try to write post after stage? stages { stage(‘S1’) { agent { label “A” } steps { } post { xxx } stage(‘S2’) { agent { label “B” } steps { } } On Thu, Jan 23, 2020 at 10:35 AM David Aldrich wro

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 clust

Re: One Jenkins, Multiple Kubernetes Clusters

2019-03-07 Thread Liejun Tao
kubectl describe pod would tell why the pod can't start. If you are using private registry, "pull image secret" is required. Sometimes a manual "docker logout" on the worker node help with image pull. On Thu, Mar 7, 2019 at 12:05 PM Steve Garrett wrote: > Hi, was able to figure that out, thanks