-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5191f37
commit b0747f9
Showing
2 changed files
with
99 additions
and
16 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,19 @@ | ||
obs: | ||
- script: > | ||
multibranchPipelineJob('test-seed') { | ||
branchSources { | ||
git { | ||
id('92098798334') | ||
remote('https://github.com/username/example') | ||
includes('*') | ||
} | ||
} | ||
orphanedItemStrategy { | ||
discardOldItems { | ||
numToKeep(5) | ||
} | ||
} | ||
} | ||
jenkins: | ||
systemMessage: "Jenkins configured automatically by Jenkins Configuration as Code Plugin\n\n" | ||
|
||
jobs: | ||
- file: ./jenkins_setup.groovy | ||
|
||
credentials: | ||
system: | ||
domainCredentials: | ||
- credentials: | ||
- gitHubApp: | ||
appID: "1111" | ||
description: "GitHub app" | ||
id: "github-app" | ||
# apiUri: https://my-custom-github-enterprise.com/api/v3 # optional only required for GitHub enterprise | ||
privateKey: | | ||
"-----BEGIN PRIVATE KEY----- | ||
-----END PRIVATE KEY-----" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
organizationFolder("GitHub organization") { | ||
displayName("GitHub organization") | ||
description("GitHub organization") | ||
organizations { | ||
github { | ||
repoOwner("csye7125-fall2023-group05") | ||
scanCredentialsId("github-organization-credentials") | ||
apiUri("https://api.github.com") | ||
|
||
|
||
configure { node -> | ||
def traits = node / navigators / 'org.jenkinsci.plugins.github_branch_source.GitHubSCMNavigator' / traits | ||
|
||
// Discover branches | ||
// https://javadoc.jenkins.io/plugin/github-branch-source/org/jenkinsci/plugins/github_branch_source/BranchDiscoveryTrait.html | ||
traits << 'org.jenkinsci.plugins.github__branch__source.BranchDiscoveryTrait' { | ||
strategyId('1') | ||
// Values | ||
// 1: Exclude branches that are also filed as PRs | ||
// 2: Only branches that are also filed as PRs | ||
// 3: All branches | ||
// | ||
} | ||
|
||
// Discover pull requests from origin | ||
// https://javadoc.jenkins.io/plugin/github-branch-source/org/jenkinsci/plugins/github_branch_source/OriginPullRequestDiscoveryTrait.html | ||
traits << 'org.jenkinsci.plugins.github_branch_source.OriginPullRequestDiscoveryTrait' { | ||
strategyId('2') | ||
// Values | ||
// 1. Merging the pull request with the current target branch revision | ||
// 2. The current pull request revision | ||
// 3. Both the current pull request revision and the pull request merged with the current target branch revision | ||
} | ||
|
||
// Discover pull requests from forks | ||
// https://javadoc.jenkins.io/plugin/github-branch-source/org/jenkinsci/plugins/github_branch_source/ForkPullRequestDiscoveryTrait.html | ||
traits << 'org.jenkinsci.plugins.github_branch_source.ForkPullRequestDiscoveryTrait' { | ||
// Strategy | ||
strategyId('2') | ||
// Values | ||
// 1. Merging the pull request with the current target branch revision | ||
// 2. The current pull request revision | ||
// 3. Both the current pull request revision and the pull request merged with the current target branch revision | ||
|
||
// Trust | ||
trustId('4') | ||
// Values | ||
// 1. No trust | ||
// 2. Collaborators | ||
// 3. Everyone | ||
// 4. From users with Admin or Write permission | ||
} | ||
} | ||
} | ||
// Project Recognizers | ||
projectFactories { | ||
workflowMultiBranchProjectFactory { | ||
scriptPath 'Jenkinsfile' | ||
} | ||
} | ||
|
||
// TODO: Property Strategy | ||
|
||
// Orphaned Item Strategy | ||
orphanedItemStrategy { | ||
discardOldItems { | ||
daysToKeep(-1) | ||
numToKeep(-1) | ||
} | ||
} | ||
|
||
// Scan Organization Folder Triggers: 1 day | ||
configure { node -> | ||
node / triggers / 'com.cloudbees.hudson.plugins.folder.computed.PeriodicFolderTrigger' { | ||
spec('H H * * *') | ||
interval(86400000) | ||
} | ||
} | ||
} | ||
} |