Re: Is there a yaml checker/sanitizer for Jenkins pipeline jobs?

2019-10-13 Thread Tony Cappellini
Because it needs to be changed when the user runs the job

On Sun, Oct 13, 2019 at 10:31 AM Casey Vega  wrote:

>
> Why embed YAML into the Jenkinsfile when you can read it as a file? What
> Ivan is describing is the correct answer. Prevent this type of mistake from
> ever entering the codebase at the time of commit. If you absolutely have to
> validate inline YAML it might look something like this (which purposely
> fails due to a missing colon for size key):
>
> pipeline {
>   agent any
>   stages {
> stage("read yaml") {
>   steps {
> script {
>   try {
> readYaml text: """
> something: 'my datas'
> size 3
> isEmpty: false
> """
>   } catch (Exception err) {
> currentBuild.result = 'ABORTED'
> error("Malformed YAML detected:\n${err}")
>   }
> }
> echo "YAML verified"
>   }
> }
>   }
> }
>
> Errors look like this in the console output, this happens before anything
> is built (next echo step) based on the example above:
>
> ERROR: Malformed YAML detected:
> while scanning a simple key
>  in 'reader', line 4, column 1:
> size 3
> ^
> could not find expected ':'
>  in 'reader', line 5, column 1:
> isEmpty: false
> ^
>
> Finished: ABORTED
>
>
> Again, I highly recommend looking into Ivan's suggestion and decoupling
> your YAML from your Jenkinsfile so you're not adding complexity to your
> pipeline.
>
> On Saturday, October 12, 2019 at 1:08:37 PM UTC-7, Tony Cappellini wrote:
>>
>> Thanks- this might work for yank files  but
>> I can’t see how it would work for pipeline jobs that have embedded yaml.
>> This yaml gets edited just before the use clicks the BUILD button.
>> Essentially, I need to call the yaml sanitizer just after BUILD is clicked,
>> but before Jenkins parses it.
>>
>> On Sat, Oct 12, 2019 at 11:29 AM Ivan Fernandez Calvo <
>> kuisat...@gmail.com> wrote:
>>
>>> We use pre-commit on a stage, pre-commit has a bunch of linters, syntax
>>> check, YAML linter, JSON linter, best practices check on code and scripts,
>>>  https://pre-commit.com/ also you can configure it to run locally
>>> as a git hook to check your project before commit something
>>>
>>> --
>>> You received this message because you are subscribed to a topic in the
>>> Google Groups "Jenkins Users" group.
>>> To unsubscribe from this topic, visit
>>> https://groups.google.com/d/topic/jenkinsci-users/uFsC3geutC0/unsubscribe
>>> .
>>> To unsubscribe from this group and all its topics, send an email to
>>> jenkins...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/jenkinsci-users/2a832ccd-303c-448b-b83a-cc15a7c26603%40googlegroups.com
>>> .
>>>
>> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Jenkins Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/jenkinsci-users/uFsC3geutC0/unsubscribe.
> To unsubscribe from this group and all its topics, 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/00356736-acae-4314-99dc-207d919d4fed%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/00356736-acae-4314-99dc-207d919d4fed%40googlegroups.com?utm_medium=email_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/CABRXM4nXyTU3GXVRQ3mRbh_zMeAXUs4CiL%2B9vYXjRJ%3DvoxQQZg%40mail.gmail.com.


Re: Is there a yaml checker/sanitizer for Jenkins pipeline jobs?

2019-10-12 Thread Tony Cappellini
Thanks- this might work for yank files  but
I can’t see how it would work for pipeline jobs that have embedded yaml.
This yaml gets edited just before the use clicks the BUILD button.
Essentially, I need to call the yaml sanitizer just after BUILD is clicked,
but before Jenkins parses it.

On Sat, Oct 12, 2019 at 11:29 AM Ivan Fernandez Calvo <
kuisathave...@gmail.com> wrote:

> We use pre-commit on a stage, pre-commit has a bunch of linters, syntax
> check, YAML linter, JSON linter, best practices check on code and scripts,
>  https://pre-commit.com/ also you can configure it to run locally as
> a git hook to check your project before commit something
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Jenkins Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/jenkinsci-users/uFsC3geutC0/unsubscribe.
> To unsubscribe from this group and all its topics, 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/2a832ccd-303c-448b-b83a-cc15a7c26603%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/CABRXM4kDLEZNte_HyXYsapsjCgYRt8vBwXw-UvPtrS3mHwZbNA%40mail.gmail.com.


Re: Programmatically searching the artifacts from multiple jobs

2019-08-20 Thread Tony Cappellini
Thanks Martin. That looks like the most programmatic solution of all.

On Mon, Aug 19, 2019 at 3:58 PM Martin d'Anjou 
wrote:

> You can get the artifacts from Jenkins using curl:
> curl -X GET "http://localhost:8080/job/p1/2/artifact/t2.txt; -o t2.txt
>
> You can also get all the artifacts:
> curl -X GET "http://localhost:8080/job/p1/2/artifact/*zip*/archive.zip;
> -o a.zip
>
> For more see:
>
> https://stackoverflow.com/questions/35920756/is-there-any-jenkins-api-to-get-artifacts-name-and-download-it
>
> Martin
>
> On Sunday, August 18, 2019 at 2:40:37 PM UTC-4, Tony Cappellini wrote:
>>
>> Perhaps. I'll have to give it a try to see what its limitations are.
>>
>> When you have 5-10 artifacts per job, it takes a lot of time saving
>> them, so they can be attached to a Jira ticket.
>> Jenkins doesn't provide a way to save those files. You need to view
>> each one, copy it's contents into an editor, then save those files,
>> manually.
>>
>> thanks
>>
>> On Sun, Aug 18, 2019 at 10:49 AM Martin d'Anjou
>>  wrote:
>> >
>> > Could the run selector plugin help?
>> > https://github.com/jenkinsci/run-selector-plugin
>> >
>> > Martin
>> >
>> > --
>> > You received this message because you are subscribed to a topic in the
>> Google Groups "Jenkins Users" group.
>> > To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/jenkinsci-users/nNwRWXHOs5E/unsubscribe.
>>
>> > To unsubscribe from this group and all its topics, send an email to
>> jenkins...@googlegroups.com.
>> > To view this discussion on the web visit
>> https://groups.google.com/d/msgid/jenkinsci-users/211067ec-a99a-4251-990f-a4e66e8b9d58%40googlegroups.com.
>>
>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Jenkins Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/jenkinsci-users/nNwRWXHOs5E/unsubscribe.
> To unsubscribe from this group and all its topics, 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/030c4641-e194-4562-aae0-ba7b2c6bc430%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/030c4641-e194-4562-aae0-ba7b2c6bc430%40googlegroups.com?utm_medium=email_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/CABRXM4m0013rZ26baQu0-dSicETZkJYDzOPoUBs8p9d1-77-RA%40mail.gmail.com.


Re: Programmatically searching the artifacts from multiple jobs

2019-08-18 Thread Tony Cappellini
Perhaps. I'll have to give it a try to see what its limitations are.

When you have 5-10 artifacts per job, it takes a lot of time saving
them, so they can be attached to a Jira ticket.
Jenkins doesn't provide a way to save those files. You need to view
each one, copy it's contents into an editor, then save those files,
manually.

thanks

On Sun, Aug 18, 2019 at 10:49 AM Martin d'Anjou
 wrote:
>
> Could the run selector plugin help?
> https://github.com/jenkinsci/run-selector-plugin
>
> Martin
>
> --
> You received this message because you are subscribed to a topic in the Google 
> Groups "Jenkins Users" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/jenkinsci-users/nNwRWXHOs5E/unsubscribe.
> To unsubscribe from this group and all its topics, 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/211067ec-a99a-4251-990f-a4e66e8b9d58%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/CABRXM4ncTCyAEnzE7KZjcqvFbv0e2AGRe_8aij2RRddxQtXqiA%40mail.gmail.com.


Re: Does Jenkins have a restriction (limit) with the number of concurrent connections to a Git repo (via Bitbucket) ?

2019-08-14 Thread Tony Cappellini
Oh, that is very helpful!

I had searched with so many terms, EXCEPT for scaling. Duh.

Thank you

On Wed, Aug 14, 2019 at 10:07 AM Gareth Bowles  wrote:
>
> BitBucket server and other Git servers do have a limit on the maximum number 
> of concurrent clones, which is a factor of the resources you have on the 
> BitBucket server machine. See 
> https://confluence.atlassian.com/bitbucketserver062/scaling-bitbucket-server-969537534.html
>
> --
> You received this message because you are subscribed to a topic in the Google 
> Groups "Jenkins Users" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/jenkinsci-users/JzXBUT8rGjw/unsubscribe.
> To unsubscribe from this group and all its topics, 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/6cd7e11d-1a31-4a8c-ac50-673c6684d472%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/CABRXM4%3DX9ve%3DvHVHC1e%3Dg69O1Krm2zdQyLwghFDFm5aQdiYs-w%40mail.gmail.com.


Re: Programmatically searching the artifacts from multiple jobs

2019-08-12 Thread Tony Cappellini
Thanks, I may have to resort to that.

I was hoping to find a way to get access to the artifact files,
outside of Jenkins though.
Then I could write my own script to run independently of Jenkins

On Mon, Aug 12, 2019 at 2:30 PM Ullrich Hafner  wrote:
>
> Or you can use the https://wiki.jenkins.io/display/JENKINS/Text-finder+Plugin
> It provides already a way to grep files for a pattern and set the build 
> status accordingly.
>
> Am 12.08.2019 um 06:49 schrieb 'Björn Pedersen' via Jenkins Users 
> :
>
> Hi,
>
> I think the best solution would be to use warnings-ng  and set up  suitable 
> custom parser (I assume that none of the many available parsers fit your 
> use-case). Possibly in combination with the Build Failure Analyzer plugin 
> your jobs will show the correct status and where the errors happed.
>
> Björn
>
> --
> 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/ccdab323-3894-4635-a06f-5f7a74c3b3ec%40googlegroups.com.
>
>
> --
> You received this message because you are subscribed to a topic in the Google 
> Groups "Jenkins Users" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/jenkinsci-users/nNwRWXHOs5E/unsubscribe.
> To unsubscribe from this group and all its topics, 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/3F83F7A5-5C3D-4786-8770-83B26B85DEC8%40gmail.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/CABRXM4meUJChsUmtsKDqgzw0Ovo2gfj6mqCObiVq9aOOo%3Dzd5g%40mail.gmail.com.