Skip to content

Instantly share code, notes, and snippets.

@saquibtmf
saquibtmf / jenkinsParsingForGithubPayload
Created March 8, 2023 09:47 — forked from jimCresswell/jenkinsParsingForGithubPayload
Jenkins script in Groovy to parse a Github web hook payload for the commit that triggered the pull request that triggered the service hook ... and then set that as a build variable that can be used in further Jenkins scripts or parameterised jobs. See http://chloky.com/github-pull-req-webhook/ and https://gist.github.com/bjhess/2726012 for setti…
import hudson.model.*
def payloadString = build.buildVariableResolver.resolve("payload")
payloadObject = new groovy.json.JsonSlurper().parseText(payloadString)
targetCommit = payloadObject.pull_request.head.sha
build.addAction(new ParametersAction(new StringParameterValue('targetCommit', targetCommit)))
@iamalbert
iamalbert / README.md
Last active November 30, 2023 22:39
Git skip LFS on local repo

Because GitKraken and SourceTree are FUCKING SLOW for repo with large LFS objects.

Need to completely skip LFS operation when pull/fetch/checkout/...

Skip downloading when clone

GIT_LFS_SKIP_SMUDGE=1 git clone SERVER-REPOSITORY

Skip downloading when fetch/checkout/pull

@noqcks
noqcks / jenkins-plugins.md
Last active January 2, 2024 15:46
How to get a complete plugin list from jenkins (with version)

I need a way to get a list of plugins so that I can use them with docker jenkins in the format <plugin>: <version>

1. get the jenkins cli.

The jenkins CLI will allow us to interact with our jenkins server from the command line. We can get it with a simple curl call.

curl 'localhost:8080/jnlpJars/jenkins-cli.jar' > jenkins-cli.jar