+
+ Promise.resolve(null) as any}
+ schema={schema}
+ docExplorerOpen
+ defaultSecondaryEditorOpen={false}
+ />
+
+
+
+ );
+};
diff --git a/plugins/jenkins/src/state/index.ts b/plugins/api-docs/src/components/GraphQlDefinitionWidget/index.ts
similarity index 89%
rename from plugins/jenkins/src/state/index.ts
rename to plugins/api-docs/src/components/GraphQlDefinitionWidget/index.ts
index d21a380c2a..b60545de15 100644
--- a/plugins/jenkins/src/state/index.ts
+++ b/plugins/api-docs/src/components/GraphQlDefinitionWidget/index.ts
@@ -13,5 +13,5 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-export * from './useBuilds';
-export * from './useBuildWithSteps';
+
+export { GraphQlDefinitionWidget } from './GraphQlDefinitionWidget';
diff --git a/plugins/jenkins/README.md b/plugins/jenkins/README.md
index a911704dc4..8f0d43cba7 100644
--- a/plugins/jenkins/README.md
+++ b/plugins/jenkins/README.md
@@ -14,17 +14,7 @@ Website: [https://jenkins.io/](https://jenkins.io/)
yarn add @backstage/plugin-jenkins
```
-2. Add plugin API to your Backstage instance:
-
-```js
-// packages/app/src/api.ts
-import { JenkinsApi, jenkinsApiRef } from '@backstage/plugin-jenkins';
-
-const builder = ApiRegistry.builder();
-builder.add(jenkinsApiRef, new JenkinsApi(`${backendUrl}/proxy/jenkins/api`));
-```
-
-2. Add plugin itself:
+2. Add plugin:
```js
// packages/app/src/plugins.ts
@@ -63,7 +53,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
diff --git a/plugins/jenkins/package.json b/plugins/jenkins/package.json
index 0d532f8c45..c62df08db2 100644
--- a/plugins/jenkins/package.json
+++ b/plugins/jenkins/package.json
@@ -23,6 +23,7 @@
"dependencies": {
"@backstage/catalog-model": "^0.1.1-alpha.21",
"@backstage/core": "^0.1.1-alpha.21",
+ "@backstage/plugin-catalog": "^0.1.1-alpha.21",
"@backstage/theme": "^0.1.1-alpha.21",
"@material-ui/core": "^4.11.0",
"@material-ui/icons": "^4.9.1",
diff --git a/plugins/jenkins/src/api/index.ts b/plugins/jenkins/src/api/index.ts
index 545a1da9cc..2b95fe97d9 100644
--- a/plugins/jenkins/src/api/index.ts
+++ b/plugins/jenkins/src/api/index.ts
@@ -15,7 +15,7 @@
*/
import { createApiRef } from '@backstage/core';
-import { CITableBuildInfo } from '../pages/BuildsPage/lib/CITable';
+import { CITableBuildInfo } from '../components/BuildsPage/lib/CITable';
const jenkins = require('jenkins');
@@ -65,6 +65,21 @@ export class JenkinsApi {
})
.pop();
+ const author = jobDetails.actions
+ .filter(
+ (action: any) =>
+ action._class ===
+ 'jenkins.scm.api.metadata.ContributorMetadataAction',
+ )
+ .map((action: any) => {
+ return action.contributorDisplayName;
+ })
+ .pop();
+
+ if (author) {
+ scmInfo.author = author;
+ }
+
return scmInfo;
}
@@ -154,12 +169,15 @@ export class JenkinsApi {
if (jobScmInfo) {
source.url = jobScmInfo?.url;
source.displayName = jobScmInfo?.displayName;
+ source.author = jobScmInfo?.author;
}
const path = new URL(jenkinsResult.url).pathname;
return {
id: path,
+ buildNumber: jenkinsResult.number,
+ buildUrl: jenkinsResult.url,
buildName: jenkinsResult.fullDisplayName,
status: jenkinsResult.building ? 'running' : jenkinsResult.result,
onRestartClick: () => {
diff --git a/plugins/jenkins/src/assets/build-details.png b/plugins/jenkins/src/assets/build-details.png
index 396af428af..ee463fea43 100644
Binary files a/plugins/jenkins/src/assets/build-details.png and b/plugins/jenkins/src/assets/build-details.png differ
diff --git a/plugins/jenkins/src/assets/folder-results.png b/plugins/jenkins/src/assets/folder-results.png
index 2e14f3551f..c01e4cf437 100644
Binary files a/plugins/jenkins/src/assets/folder-results.png and b/plugins/jenkins/src/assets/folder-results.png differ
diff --git a/plugins/jenkins/src/components/BuildWithStepsPage/BuildWithStepsPage.tsx b/plugins/jenkins/src/components/BuildWithStepsPage/BuildWithStepsPage.tsx
new file mode 100644
index 0000000000..637cd40d6d
--- /dev/null
+++ b/plugins/jenkins/src/components/BuildWithStepsPage/BuildWithStepsPage.tsx
@@ -0,0 +1,134 @@
+/*
+ * Copyright 2020 Spotify AB
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import React from 'react';
+import { useParams } from 'react-router-dom';
+import { Content, Link } from '@backstage/core';
+import {
+ Typography,
+ Breadcrumbs,
+ Paper,
+ TableContainer,
+ Table,
+ TableRow,
+ TableCell,
+ TableBody,
+ Link as MaterialLink,
+} from '@material-ui/core';
+import { makeStyles } from '@material-ui/core/styles';
+import { useBuildWithSteps } from '../useBuildWithSteps';
+import { useProjectSlugFromEntity } from '../useProjectSlugFromEntity';
+import { JenkinsRunStatus } from '../BuildsPage/lib/Status';
+import ExternalLinkIcon from '@material-ui/icons/Launch';
+
+const useStyles = makeStyles(theme => ({
+ root: {
+ maxWidth: 720,
+ margin: theme.spacing(2),
+ },
+ table: {
+ padding: theme.spacing(1),
+ },
+ externalLinkIcon: {
+ fontSize: 'inherit',
+ verticalAlign: 'bottom',
+ },
+}));
+
+const Page = () => (
+