This repository contains a Backstage software template designed for creating new services that integrate with Jenkins for CI/CD. It’s specifically tailored for use with Red Hat Developer Hub.
Before using this template, ensure you have the following:
https://github.com/maximilianoPizarro/software-template-jenkins-rhdh
Jenkinsfile
that you can customize to define your CI/CD pipeline. This file will typically include stages for:
You can customize this template to fit your specific needs:
template.yaml
: Adjust the input parameters and steps in the template.yaml
file to control what information is collected from the user and how the new service is generated.Jenkinsfile
: Enhance the default Jenkinsfile
to include more complex CI/CD stages, integrate with other tools, or enforce specific build processes.To integrate this template with Red Hat Developer Hub, you’ll need to configure the dynamic-plugins.yaml
and app-config-rhdh.yaml
files.
dynamic-plugins.yaml
This configuration enables the Jenkins backend and frontend plugins, allowing Developer Hub to interact with Jenkins and display Jenkins-related information.
includes:
- dynamic-plugins.default.yaml
plugins:
- package: oci://quay.io/maximilianopizarro/scaffolder-backend-module-jenkins:v0.1!backstage-community-plugin-scaffolder-backend-module-jenkins
disabled: false
- disabled: false
package: ./dynamic-plugins/dist/backstage-community-plugin-jenkins-backend-dynamic
- disabled: false
package: ./dynamic-plugins/dist/backstage-community-plugin-jenkins
pluginConfig:
dynamicPlugins:
frontend:
backstage-community.plugin-jenkins:
mountPoints:
- config:
if:
allOf:
- isJenkinsAvailable
layout:
gridColumn: 1 / -1
importName: EntityJenkinsContent
mountPoint: entity.page.ci/cards
app-config-rhdh.yaml
This file configures the Jenkins connection details for Developer Hub. Replace the placeholder values with your actual Jenkins server URL, username, and API key.
jenkins:
baseUrl: ${JENKINS_SERVER_URL}/createItem?mode=org.jenkinsci.plugins.workflow.job.WorkflowJob
username: ${JENKINS_USERNAME}
apiKey: ${JENKINS_API_KEY}
crumbIssuerEnabled: false
instances:
- baseUrl: 'https://jenkins-jenkins.apps.rosa.m5cq8-ma8k4-7s6.ak3p.p3.openshiftapps.com' # Replace with your Jenkins instance URL
name: 'default-jenkins'
username: '${JENKINS_USERNAME}' # Replace with your Jenkins username
apiKey: '${JENKINS_API_KEY}' # Replace with your Jenkins API key