Re: Prevent Archiving In a Pipeline

2019-01-22 Thread Cuong Tran
It seems to me you're leaving out some important details. If you don't use "mvn install" in pipelineA and not sharing maven repo, I don't see how jobB would be getting the out generated by pipelineA. On Monday, January 21, 2019 at 7:47:56 AM UTC-8, Ricardo Torres wrote: > > I have an upstream

Re: How to SET BUILD_USER variable from REMOTE API CALL to Jenkins Job

2018-11-16 Thread Cuong Tran
I don't think Jenkins has BUILD_USER var. If you're using a plugin to generate it, you may want to check there. On Friday, November 16, 2018 at 2:57:24 AM UTC-8, rohit verma wrote: > > Hello, > > I am calling a Jenkins Job from remote system by following command. > > curl -k -v -H -XPOST >

Where to find progress on the new pipeline engine?

2018-11-08 Thread Cuong Tran
I just watched the presentation from Jenkins World 2018 titled "Solving Pipeline Performance Problems with Systems Theory and How to Apply it to DevOps" [1] and it refers to the new implementation of the pipeline engine that seems to solve many the pain points I experience. Does anyone know

Re: How to use environment variable in Jenkins Pipeline build?

2018-11-08 Thread Cuong Tran
Where do you define your "environment variable"? It should work as ${BRANCH_TO_BUILD} if you define BRANCH_TO_BUILD under global environment variables, folder, inside your pipeline, etc. On Thursday, November 8, 2018 at 8:56:38 AM UTC-8, ZillaYT wrote: > > Someone suggested using

Re: Best way to set the job description for multi branch pipelines

2018-10-18 Thread Cuong Tran
Try this: currentBuild.description = "You description" On Wednesday, October 17, 2018 at 7:39:59 AM UTC-7, Lee, David wrote: > > Hi Jenkins users – > > > > I am not seeing a really easy and clean way to set the Jenkins job > description for multi branch pipelines. > > > > The following

Re: Problems with ENV variables in jenkins 2.1.41?

2018-09-06 Thread Cuong Tran
I would try to verify this with a FreeStyle job to see if the problem is somewhere else. On Wednesday, September 5, 2018 at 9:55:21 AM UTC-7, Gorgonz ola wrote: > > [UPD]Nope, its not that simple, Returning to version 2.1.40 did not help. > Its likely a problem, that results from the newer

Re: How to list pipeline tools from Global Tool Configuration?

2018-09-06 Thread Cuong Tran
Yes, you must be able to access that area to see a list. On Thursday, September 6, 2018 at 5:11:51 AM UTC-7, Mr. Laubrino wrote: > > While going through this pipeline documentation section > https://jenkins.io/doc/book/pipeline/syntax/#tools - how can one know > possible pre-configured tools if

Is it possible to re-run init.groovy.d scripts whilst Jenkins is running?

2018-08-03 Thread Cuong Tran
Can't you run your script under script console /script? -- 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

Re: I would like to downgrade the version of Python that Jenkins is using.

2018-05-18 Thread Cuong Tran
I don't believe Jenkins uses python. On Monday, May 14, 2018 at 9:41:13 AM UTC-7, Patricia Sandt wrote: > > The Ubuntu 16.04 version of Python is 2.7. My build depends on this. > Jenkins is apparently using a newer version (3?), which doesn't work with > _html5lib.py in my build. Is there a way

Re: How to create a pipeline job from inside a jenkinsfile?

2018-05-18 Thread Cuong Tran
Yes, you can use the job-dsl plugin (https://plugins.jenkins.io/job-dsl) to do that. On Friday, May 18, 2018 at 2:00:45 AM UTC-7, John Lonergan wrote: > > Is it possible to create a multiranch pipeline job from a script in > another pipeline job. > All driven by Jenkinsfiles? > -- You

Re: Jenkins Failure for initial Build

2018-01-16 Thread Cuong Tran
It looks like the project you referenced in the job doesn't exist. On Sunday, November 26, 2017 at 4:32:51 AM UTC-8, Sridhar Babu wrote: > > Hi I am new to Jenkins and started Learning and for my trail getting below > Failure message. > Could you please tell me what could be the issue > >

Re: Configuration that works for PRs and master

2018-01-16 Thread Cuong Tran
If you use Jenkinsfile, you can use BRANCH_NAME environment to detect whether it's from a PR or not. What you describes is pretty straight forward to do with Jenkins file. Check out: https://jenkins.io/doc/book/pipeline/syntax/#when On Tuesday, January 16, 2018 at 7:52:57 AM UTC-8, Hiesgen,

Re: [Announce] Gerrit CI workflow to become a brand-new Jenkins plugin

2017-09-01 Thread Cuong Tran
Hi Luca, Have you had a chance to publish this to github? On Friday, August 18, 2017 at 2:17:00 AM UTC-7, Luca Milanesio wrote: > > Posting to the jenkinsci-users mailing list as well: even if I mainly > needed feedback from the plugins developers, feedback from a > user-perspective of the new

Re: Pipeline - how to copy a directory of files from outside of workspace into a workspace using groovy?

2017-08-02 Thread Cuong Tran
You can't use normal groovy api since it only works on master. Since you're already using unix slaves, just use a normal shell step will save you headaches. On Wednesday, August 2, 2017 at 7:26:01 AM UTC-7, bbyjenkns wrote: > > We have a somewhat different use case where we have a bunch of

Re: How to get access to a Maven POM version in a Freestyle build?

2017-07-27 Thread Cuong Tran
Make sure to use "-q" to get just the version: VERSION=$(mvn -q -N -Dexec.executable="echo" -Dexec.args='${project.version}' org.codehaus.mojo:exec-maven-plugin:1.3.1:exec) On Thursday, July 27, 2017 at 12:17:33 PM UTC-7, Cuong Tran wrote: > > Eric, > > You

Re: How to get access to a Maven POM version in a Freestyle build?

2017-07-27 Thread Cuong Tran
Eric, You certainly can run groovy script if you have the EnvInject plugin. Another way to obtain the pom version is to run shell command: mvn -N -Dexec.executable="echo" -Dexec.args='${project.version}' org.codehaus.mojo:exec-maven-plugin:1.3.1:exec On Wednesday, July 26, 2017 at

Re: How to set environment variable in multibranch pipeline?

2017-06-14 Thread Cuong Tran
Why? On Wednesday, June 14, 2017 at 5:33:26 AM UTC-7, Mark Allison wrote: > > Thanks for the reply, but I need to set the variable outside the pipeline > script similar to the Environment Injector plugin. Is there a way to do > that? > > On Tuesday, 13 June 2017 13:36:07 UTC+1, Kevin Burnett

Re: Jenkins 2.0 pipeline as code executor question

2017-05-11 Thread Cuong Tran
:40:31 PM UTC-7, Marslo Jiao wrote: > > What "avoid using locations outside of the workspace" means? > > On Thursday, May 11, 2017 at 1:10:59 AM UTC+8, Cuong Tran wrote: >> >> You should make your build commands work correctly when running inside >>

Re: Jenkins pipeline files present in sh blocks not present in later steps

2017-05-10 Thread Cuong Tran
The docs says you can only archive files in your workspace. Try to write to the workspace instead: --output-dir=${WORKSPACE}/report On Wednesday, May 10, 2017 at 4:52:04 AM UTC-7, Berndt Jung wrote: > > I'm pretty new at this, but I'm stumped. > > > Here is my stage block > >

Re: Jenkins 2.0 pipeline as code executor question

2017-05-10 Thread Cuong Tran
You should make your build commands work correctly when running inside the same node (avoid using locations outside of the workspace). On Wednesday, May 10, 2017 at 4:52:06 AM UTC-7, Marslo Jiao wrote: > > Is there anyway that I can manage the executor number for the same Jenkins > job (using

Re: How do I set env variable to currentBuild property in declarative pipeline environment.

2017-05-10 Thread Cuong Tran
Does it work with this? withEnv(["BUILD_REVISION=${env.BUILD_REVISION}"]) { sh "env | sort" } On Wednesday, May 10, 2017 at 8:20:45 AM UTC-7, JG wrote: > > I'm trying to set an env variable globally in my *pipeline {} *with a > concatenation of build details like this > > #!groovy >

Check to see if a Pipeline step exist?

2017-04-14 Thread Cuong Tran
All, I need to be able to run the same pipeline code under Jenkins 1.x and Jenkins 2.x servers so I want to detect if a step exists and provide alternative. For example, the "archiveArtifacts" step doesn't exist in Jenkins 1.x. Does anyone have a similar problem? Thanks. -- You received

Re: Run pipeline only when new commits for a specific tag

2017-03-23 Thread Cuong Tran
Tags are mostly read-only, so I'm not sure what you're trying to do with "detect new commits" in specific tag. You can probably say "trigger builds for any new tag that matches tags/develop/*" and your tags have to be "develop/v1", "develop/v2", etc. On Thursday, March 23, 2017 at 2:45:05 AM

Re: Avoid activation of github webhook for pipeline shared library in the application job

2017-03-21 Thread Cuong Tran
I haven't tried this yet but can you add the "Don't trigger a build on commit notifications" in the scm configuration of the library definition? On Saturday, March 18, 2017 at 6:42:31 PM UTC-7, Evgenii Pomnikov wrote: > > Hi! > > We call pipeline shared libraries in our Jenkinsfile via standard

Re: Declarative pipelines vs scripted

2017-03-21 Thread Cuong Tran
The declarative option is nice but you will lose the ability to extract out reusable code via the shared library. For example, you can't do this yet: MyCompanyStandardPipeline { ... // which will plugin standard sections... } On Thursday, March 16, 2017 at 8:55:48 PM UTC-7, Nick Le Mouton

Re: Trouble using MarkupBuilder DSL within Pipeline DSL

2017-03-21 Thread Cuong Tran
You need to approve it in the "In-process Script Approval" page under /manage. On Tuesday, November 15, 2016 at 9:24:48 AM UTC-8, David Karr wrote: > > In my Jenkinsfile, I'm trying to use MarkupBuilder to construct a simple > XML message. I first discovered that there are default security >

Re: How to make Jenkins build something on pushing to GitHub?

2017-03-21 Thread Cuong Tran
Your job need to have a scm configuration for it to be triggered on commits. Either configure it as Multibranch Pipeline job or add a "git" or checkout step in your normal pipeline. On Tuesday, March 21, 2017 at 12:52:30 PM UTC-7, Yuri Kanivetsky wrote: > > Hi, > > I have a pipeline job. It

Re: How to call a function defined within my Jenkinsfile

2017-03-21 Thread Cuong Tran
You can call any function the normal way: *stage (build) {* * buildProject(meta)* *}* *def buildProject(meta) {* * node {* * //whatever i need to do* * }* *}* On Tuesday, March 21, 2017 at 10:02:34 AM UTC-7, ishan jain wrote: > > Probably i am being silly, but seriously

Re: Declarative pipeline: access JenkinsLocationConfiguration.getAdminAddress()?

2017-03-21 Thread Cuong Tran
You can access it via: hudson.model.JenkinsLocationConfiguration.get().getAdminAddress() You could also define a global variable on Jenkins and access it as "env.JENKINS_EMAIL". To take it a step further, you can encapsulate the whole thing in a library using Global Shared Library plugin:

Re: Jenkinsfile for monorepo?

2017-03-10 Thread Cuong Tran
You can specify the path to the Jenkinsfile, "projectA/Jenkinsfile". Doesn't work for multi-branch pipeline though. On Friday, March 10, 2017 at 6:30:54 AM UTC-8, robert...@dealertrack.com wrote: > > Anyone using pipeline/Jenkinsfile for a repository having several child >

Re: I need to know Bundled Plugins version numbers for Jenkins 2.5

2016-10-28 Thread Cuong Tran
The version number are embedded inside the files. Unzip them to find out. On Friday, October 28, 2016 at 12:26:18 PM UTC-7, Robert Kruck wrote: > > For Jenkins 2.5 I know which are its bundled plugins by examining the > *.hpi files associated with Jenkins 2.5, but I don't know the versions of

Re: Maintaining a unique Build Number across multiple build servers

2016-09-20 Thread Cuong Tran
It doesn't exist. On Monday, September 19, 2016 at 12:54:15 PM UTC-7, Robert Kruck wrote: > > Is it possible to preserve the integrity of build numbers (NO DUPLICATES > and build numbers in order) while building in multiple Jenkins build > servers? > > If this capability exists in Jenkins,

Re: terminate pipeline parallal on first failure

2016-09-20 Thread Cuong Tran
The reference link is right on any pipeline job. You should see a "Pipeline Syntax" link, click on that will give a list of known steps, the click on the question icon will give you an example. On Tuesday, September 20, 2016 at 1:57:43 PM UTC-7, asmundo wrote: > > Thank you Baptiste! > >

Re: create jobs automatically after the code commits to the repository

2016-09-19 Thread Cuong Tran
Have you looked at job-dsl plugin? https://github.com/jenkinsci/job-dsl-plugin On Monday, September 19, 2016 at 8:10:32 AM UTC-7, Luciano Matte wrote: > > Hi all, > > Does anyone have any hint or suggestion plugin for creating jobs > automatically > after the code commits to the repository? >

Re: Is there any variable for total build time in pipeline plugin?

2016-09-19 Thread Cuong Tran
How about: currentBuild.getDuration() https://github.com/jenkinsci/workflow-support-plugin/blob/master/src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/RunWrapper.java On Monday, September 19, 2016 at 1:34:38 AM UTC-7, Denis Kot wrote: > > I would like to send message from

Re: Best Practices for Pipeline Global Function Args (Maps vs Closures)

2016-09-19 Thread Cuong Tran
I'd stick with map arguments for simple cases. Even the example from the wiki is simpler if you use map. Move to the closure option once you have more experience or complex usage. For example, the new (simplified) syntax for pipleline can be implemented as closure: pipeline { stages {

Groovy code to access full path to a job, ie "Org/Project/branch" name

2016-08-11 Thread Cuong Tran
Try getFullName() -- 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

Re: Jenkins crashes when I try to add scriptler as a post-build action

2016-05-10 Thread Cuong Tran
I don't think you can add a scriptler script as a post-build action. You must have done it via "Use Publisher from another project". On Tuesday, May 10, 2016 at 8:33:33 AM UTC-7, Guy Matz wrote: > > Hi! I'm getting a Stack trace > when

Re: How to group jobs into project in Jenkins

2016-05-04 Thread Cuong Tran
You can use the folder plugin to group jobs. On Saturday, April 30, 2016 at 7:34:03 PM UTC-7, Tony wrote: > > Hi, > > Does anyone know how to group jobs into project in Jenkins? Also, is there > any plugin to display such projects (which consist of jobs) in Jenkin > Dashboard? > > Thanks! >

Execute multi modules project in parallel with Pipeline job and view test result per module

2016-05-03 Thread Cuong Tran
All, I'm experimenting with the new pipeline job to execute tests in a multi-module project. I'm able to execute individual modules in parallel and collecting test results. One thing I'm looking for is the ability to view the test results of each module separately. Is this possible with the

Re: Templates Plugin (Jenkins Enterprise)

2015-10-02 Thread Cuong Tran
Martin, We use the Templates plugin to simplify the job creation interface and standardize common job types. Combined with the folder plugin, we can restrict what can be created within a folder, making it even simpler for end users. The xml transformation isn't bad since you can just create a