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 Update #3

Open
wants to merge 1 commit into
base: bundle-management
Choose a base branch
from
Open
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
23 changes: 13 additions & 10 deletions controller-casc-update
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
library 'pipeline-library'
pipeline {
agent {
kubernetes {
yaml libraryResource ('podtemplates/kubectl.yml')
}
}
agent none
options {
timeout(time: 10, unit: 'MINUTES')
skipDefaultCheckout()
}
stages {
stage('Update Config Bundle') {
agent { label 'default' }
when {
beforeAgent true
branch 'main'
}
environment { CASC_UPDATE_SECRET = credentials('casc-update-secret') }
steps {
checkout scm
gitHubParseOriginUrl()
container("kubectl") {
sh "mkdir -p ${GITHUB_ORG}-${GITHUB_REPO}"
sh "find -name '*.yaml' | xargs cp --parents -t ${GITHUB_ORG}-${GITHUB_REPO}"
sh "kubectl cp --namespace cbci ${GITHUB_ORG}-${GITHUB_REPO} cjoc-0:/var/jenkins_home/jcasc-bundles-store/ -c jenkins"
}
publishEvent event:jsonEvent("""
{
'controller':{'name':'${env.GITHUB_ORG}-${GITHUB_REPO}','action':'casc_bundle_update','bundle_id':'${env.BUNDLE_ID}'},
'github':{'organization':'${env.GITHUB_ORG}','repository':'${GITHUB_REPO}'},
'secret':'${CASC_UPDATE_SECRET}',
'casc':{'auto_reload':'false'}
}
"""), verbose: true
}
}
}
Expand Down