Tidy documentation

Signed-off-by: Andrew Shirley <andrew.shirley@sainsburys.co.uk>
Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
Andrew Shirley
2021-06-02 14:25:28 +01:00
committed by blam
parent edc019d003
commit e5f69b082d
2 changed files with 36 additions and 13 deletions
+29 -6
View File
@@ -16,24 +16,47 @@ cd packages/app
yarn add @backstage/plugin-jenkins
```
2. Add and configure tha backend plugin according to it's instructions
2. Add and configure the backend plugin according to it's instructions
3. Add the `EntityJenkinsContent` extension to the cicd page and `EntityLatestJenkinsRunCard` to the entity page in the app:
3. Add the `EntityJenkinsContent` extension to the `CI/CD` page and `EntityLatestJenkinsRunCard` to the `overview` page in the app (or wherever you'd prefer):
Note that if you configured a custom JenkinsInfoProvider in step 2, you may need a custom isJenkinsAvailable.
```tsx
// In packages/app/src/components/catalog/EntityPage.tsx
import { EntityJenkinsContent } from '@backstage/plugin-jenkins';
import {
EntityJenkinsContent,
EntityLatestJenkinsRunCard,
isJenkinsAvailable,
} from '@backstage/plugin-jenkins';
// You can add the tab to any number of pages, the service page is shown as an
// example here
const serviceEntityPage = (
<EntityLayout>
{/* other tabs... */}
<EntityLayout.Route path="/jenkins" title="Jenkins">
<EntityJenkinsContent />
<EntityLayout.Route path="/" title="Overview">
{/* ... */}
<EntitySwitch>
<EntitySwitch.Case if={isJenkinsAvailable}>
<Grid item sm={6}>
<EntityLatestJenkinsRunCard branch="master" variant="gridItem" />
</Grid>
</EntitySwitch.Case>
{/* ... */}
</EntitySwitch>
</EntityLayout.Route>
{/* other tabs... */}
<EntityLayout.Route path="/ci-cd" title="CI/CD">
<EntitySwitch>
<EntitySwitch.Case if={isJenkinsAvailable}>
<EntityJenkinsContent />
</EntitySwitch.Case>
{/* ... */}
</EntitySwitch>
</EntityLayout.Route>
{/* ... */}
</EntityLayout>
);
```
4. Run app with `yarn start`