Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bundle Provision #6

Open
wants to merge 1 commit into
base: bundle-inheritance
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bundle/bundle.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: "1"
version: "4"
version: "5"
id: "cloudbees-gam-casc-ops-controller"
description: "CloudBees CI configuration bundle for the cloudbees-gam-casc ops-controller Controller"
parent: "base"
Expand Down
36 changes: 36 additions & 0 deletions bundle/items.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,42 @@ items:
- org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject
filter: true
items:
- kind: organizationFolder
name: controller-provision
disabled: false
navigators:
- github:
apiUri: https://api.github.com
traits:
- gitHubBranchDiscovery:
strategyId: 1
- headWildcardFilter:
excludes: ''
includes: main
repoOwner: ${GITHUB_ORGANIZATION}
credentialsId: cloudbees-ci-casc-workshop-github-app
projectFactories:
- customMultiBranchProjectFactory:
factory:
customBranchProjectFactory:
marker: controller.yaml
definition:
cpsScmFlowDefinition:
scriptPath: controller-provision
scm:
gitSCM:
userRemoteConfigs:
- userRemoteConfig:
credentialsId: cloudbees-ci-casc-workshop-github-app
url: https://github.com/${GITHUB_ORGANIZATION}/ops-controller.git
branches:
- branchSpec:
name: '*/main'
lightweight: true
properties:
- suppressFolderAutomaticTriggering:
strategy: INDEXING
branches: .*
- kind: organizationFolder
name: controller-casc-update
disabled: false
Expand Down
9 changes: 9 additions & 0 deletions bundle/jcasc/credentials.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
credentials:
restrictedSystem:
domainCredentials:
- allowList: "controller-jobs/controller-provision/**/main"
credentials:
string:
description: "CasC Workshop Controller Provision Secret"
id: "casc-workshop-controller-provision-secret"
scope: GLOBAL
secret: "${cbciCascWorkshopControllerProvisionSecret}"
system:
domainCredentials:
- credentials:
Expand Down
4 changes: 2 additions & 2 deletions bundle/jcasc/jenkins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jenkins:
value: "${GITHUB_USER}"
- key: "BUNDLE_ID"
value: "${CASC_BUNDLE_ID}"
systemMessage: 'Jenkins configured using CloudBees CI CasC with controller overrides'
systemMessage: 'Jenkins configured using CloudBees CI CasC with controller overrides v2'
unclassified:
globallibraries:
libraries:
Expand All @@ -24,4 +24,4 @@ unclassified:
repoOwner: "${GITHUB_ORGANIZATION}"
repository: "pipeline-library"
headerLabel:
text: "${GITHUB_APP}-bundle-v4"
text: "${GITHUB_APP}-bundle-v5"
21 changes: 21 additions & 0 deletions controller-provision
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
library 'pipeline-library'
pipeline {
agent any
options {
timeout(time: 10, unit: 'MINUTES')
}
stages {
stage('Publish Provision Controller Event') {
when {
branch 'main'
}
environment { PROVISION_SECRET = credentials('casc-workshop-controller-provision-secret') }
steps {
gitHubParseOriginUrl()
publishEvent event:jsonEvent("""
{'controller':{'name':'${GITHUB_REPO}','action':'provision'},'github':{'organization':'${GITHUB_ORG}','repository':'${GITHUB_REPO}','user':'${GITHUB_USER}'},'secret':'${PROVISION_SECRET}'}
"""), verbose: true
}
}
}
}