Last active
June 10, 2024 20:56
-
-
Save cowlinator/852e2fc68dd0ad32b26e39323134f6e5 to your computer and use it in GitHub Desktop.
jenkins configuration as code seed job from github enterprise
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jobs: | |
- script: > | |
multibranchPipelineJob('jenkins-casc-seed') { | |
def repo = "https://my-github-server/..." | |
branchSources { | |
github { | |
// The id option in the Git and GitHub branch source contexts is now mandatory (JENKINS-43693). | |
id(UUID.nameUUIDFromBytes(repo.getBytes()).toString()) // IMPORTANT: use a constant and unique identifier | |
scanCredentialsId('github') | |
repoOwner('my-org') | |
repository('my-repository') | |
apiUri('https://my-github-server/api/v3') // Optional, needed for private github enterprise servers | |
} | |
} | |
orphanedItemStrategy { | |
discardOldItems { | |
numToKeep(1) | |
} | |
} | |
triggers { | |
periodic(5) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment