Rename Jenkins annotation
This commit is contained in:
@@ -51,13 +51,13 @@ The value of this annotation is a location reference string (see above). If this
|
||||
annotation is specified, it is expected to point to a repository that the
|
||||
TechDocs system can read and generate docs from.
|
||||
|
||||
### backstage.io/jenkins-github-folder
|
||||
### jenkins.io/github-folder
|
||||
|
||||
```yaml
|
||||
# Example:
|
||||
metadata:
|
||||
annotations:
|
||||
backstage.io/jenkins-github-folder: folder-name/job-name
|
||||
jenkins.io/github-folder: folder-name/job-name
|
||||
```
|
||||
|
||||
The value of this annotation is the path to a job on Jenkins, that builds this
|
||||
|
||||
@@ -36,16 +36,12 @@ export const EntityPageOverview: FC<{ entity: Entity }> = ({ entity }) => {
|
||||
<Grid item sm={4}>
|
||||
<AboutCard entity={entity} />
|
||||
</Grid>
|
||||
{entity.metadata?.annotations?.[
|
||||
'backstage.io/jenkins-github-folder'
|
||||
] && (
|
||||
{entity.metadata?.annotations?.['jenkins.io/github-folder'] && (
|
||||
<Grid item sm={4}>
|
||||
<JenkinsLastBuildWidget entity={entity} branch="master" />
|
||||
</Grid>
|
||||
)}
|
||||
{entity.metadata?.annotations?.[
|
||||
'backstage.io/jenkins-github-folder'
|
||||
] && (
|
||||
{entity.metadata?.annotations?.['jenkins.io/github-folder'] && (
|
||||
<Grid item sm={8}>
|
||||
<JenkinsBuildsWidget entity={entity} />
|
||||
</Grid>
|
||||
|
||||
@@ -63,7 +63,7 @@ metadata:
|
||||
name: 'your-component'
|
||||
description: 'a description'
|
||||
annotations:
|
||||
backstage.io/jenkins-github-folder: 'folder-name/job-name'
|
||||
jenkins.io/github-folder: 'folder-name/job-name'
|
||||
spec:
|
||||
type: service
|
||||
lifecycle: experimental
|
||||
|
||||
@@ -20,7 +20,7 @@ import { Entity } from '@backstage/catalog-model';
|
||||
|
||||
export const JenkinsBuildsWidget = ({ entity }: { entity: Entity }) => {
|
||||
const [owner, repo] = (
|
||||
entity?.metadata.annotations?.['backstage.io/jenkins-github-folder'] ?? '/'
|
||||
entity?.metadata.annotations?.['jenkins.io/github-folder'] ?? '/'
|
||||
).split('/');
|
||||
|
||||
return <Builds owner={owner} repo={repo} />;
|
||||
|
||||
@@ -68,7 +68,7 @@ export const JenkinsLastBuildWidget = ({
|
||||
branch: string;
|
||||
}) => {
|
||||
const [owner, repo] = (
|
||||
entity?.metadata.annotations?.['backstage.io/jenkins-github-folder'] ?? '/'
|
||||
entity?.metadata.annotations?.['jenkins.io/github-folder'] ?? '/'
|
||||
).split('/');
|
||||
const [{ loading, value }] = useBuilds(owner, repo, branch);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user