Compare commits
3 Commits
a896673035
...
2720e09b05
Author | SHA1 | Date | |
---|---|---|---|
|
2720e09b05 | ||
|
148dcfee06 | ||
|
df5a6963e1 |
2631
graphql.schema.json
2631
graphql.schema.json
File diff suppressed because it is too large
Load Diff
25228
package-lock.json
generated
25228
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
35
package.json
35
package.json
@ -4,7 +4,7 @@
|
||||
"version": "0.0.0",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"build": "preact build",
|
||||
"build": "preact build --no-prerender",
|
||||
"serve": "sirv build --port 7123 --cors --single",
|
||||
"dev": "preact watch --port 7123",
|
||||
"predev": "npm run graphql",
|
||||
@ -25,38 +25,39 @@
|
||||
"build/*"
|
||||
],
|
||||
"dependencies": {
|
||||
"@apollo/client": "^3.3.11",
|
||||
"@fortawesome/fontawesome-svg-core": "^1.2.34",
|
||||
"@fortawesome/free-solid-svg-icons": "^5.15.2",
|
||||
"@apollo/client": "^3.3.13",
|
||||
"@fortawesome/fontawesome-svg-core": "^1.2.35",
|
||||
"@fortawesome/free-solid-svg-icons": "^5.15.3",
|
||||
"@fortawesome/react-fontawesome": "^0.1.14",
|
||||
"@tailwindcss/postcss7-compat": "^2.0.3",
|
||||
"@types/classnames": "^2.2.11",
|
||||
"@types/ramda": "^0.27.39",
|
||||
"@tailwindcss/postcss7-compat": "^2.0.4",
|
||||
"autoprefixer": "^9.8.6",
|
||||
"classnames": "^2.2.6",
|
||||
"classnames": "^2.3.1",
|
||||
"formik": "^2.2.6",
|
||||
"graphql": "^15.5.0",
|
||||
"mobx": "^6.1.7",
|
||||
"mobx": "^6.1.8",
|
||||
"mobx-react": "^7.1.0",
|
||||
"postcss": "^7.0.35",
|
||||
"preact": "^10.3.1",
|
||||
"preact": "^10.5.13",
|
||||
"preact-jsx-chai": "^3.0.0",
|
||||
"preact-markup": "^2.1.1",
|
||||
"preact-render-to-string": "^5.1.4",
|
||||
"preact-render-to-string": "^5.1.18",
|
||||
"preact-router": "^3.2.1",
|
||||
"ramda": "^0.27.1",
|
||||
"subscriptions-transport-ws": "^0.9.18",
|
||||
"tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.0.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@graphql-codegen/cli": "^1.21.1",
|
||||
"@graphql-codegen/cli": "^1.21.3",
|
||||
"@graphql-codegen/introspection": "^1.18.1",
|
||||
"@graphql-codegen/typescript-operations": "^1.17.14",
|
||||
"@graphql-codegen/typescript-react-apollo": "^2.2.1",
|
||||
"@teamsupercell/typings-for-css-modules-loader": "^2.2.0",
|
||||
"@graphql-codegen/typescript-operations": "^1.17.15",
|
||||
"@graphql-codegen/typescript-react-apollo": "^2.2.3",
|
||||
"@teamsupercell/typings-for-css-modules-loader": "^2.5.1",
|
||||
"@types/classnames": "^2.2.11",
|
||||
"@types/enzyme": "^3.10.5",
|
||||
"@types/jest": "^26.0.8",
|
||||
"@types/jest": "^26.0.22",
|
||||
"@types/ramda": "0.27.35",
|
||||
"@types/webpack-env": "^1.15.1",
|
||||
"@types/ws": "^7.4.1",
|
||||
"@typescript-eslint/eslint-plugin": "^2.25.0",
|
||||
"@typescript-eslint/parser": "^2.25.0",
|
||||
"css-loader": "^3.5.3",
|
||||
@ -65,7 +66,7 @@
|
||||
"eslint": "^6.8.0",
|
||||
"eslint-config-prettier": "^6.10.1",
|
||||
"eslint-plugin-prettier": "^3.1.2",
|
||||
"eslint-plugin-react": "^7.19.0",
|
||||
"eslint-plugin-react": "^7.23.1",
|
||||
"eslint-plugin-react-hooks": "^3.0.0",
|
||||
"husky": "^4.2.1",
|
||||
"jest": "^26.2.2",
|
||||
|
1
size-plugin.json
Normal file
1
size-plugin.json
Normal file
@ -0,0 +1 @@
|
||||
[{"timestamp":1617509072250,"files":[{"filename":"bundle.*****.esm.js","previous":112647,"size":112647,"diff":0},{"filename":"polyfills.*****.esm.js","previous":2177,"size":2177,"diff":0},{"filename":"sw-esm.js","previous":8486,"size":8486,"diff":0},{"filename":"sw.js","previous":8482,"size":8482,"diff":0},{"filename":"polyfills.03bf6.js","previous":2175,"size":2175,"diff":0},{"filename":"index.html","previous":1017,"size":1102,"diff":85},{"filename":"200.html","previous":1023,"size":1108,"diff":85},{"filename":"bundle.cfced.css","previous":3513,"size":0,"diff":-3513},{"filename":"bundle.4663d.js","previous":113123,"size":0,"diff":-113123},{"filename":"bundle.7a645.css","previous":0,"size":4569,"diff":4569},{"filename":"bundle.49e2d.js","previous":0,"size":113122,"diff":113122}]},{"timestamp":1617508895910,"files":[{"filename":"bundle.*****.esm.js","previous":112647,"size":112647,"diff":0},{"filename":"polyfills.*****.esm.js","previous":2177,"size":2177,"diff":0},{"filename":"sw-esm.js","previous":8486,"size":8486,"diff":0},{"filename":"sw.js","previous":8482,"size":8482,"diff":0},{"filename":"polyfills.03bf6.js","previous":2175,"size":2175,"diff":0},{"filename":"index.html","previous":1018,"size":1017,"diff":-1},{"filename":"200.html","previous":1024,"size":1023,"diff":-1},{"filename":"bundle.49cd0.css","previous":3513,"size":0,"diff":-3513},{"filename":"bundle.9466b.js","previous":113123,"size":0,"diff":-113123},{"filename":"bundle.cfced.css","previous":0,"size":3513,"diff":3513},{"filename":"bundle.4663d.js","previous":0,"size":113123,"diff":113123}]},{"timestamp":1617508710764,"files":[{"filename":"bundle.*****.esm.js","previous":112647,"size":112647,"diff":0},{"filename":"polyfills.*****.esm.js","previous":2177,"size":2177,"diff":0},{"filename":"sw-esm.js","previous":8486,"size":8486,"diff":0},{"filename":"sw.js","previous":8482,"size":8482,"diff":0},{"filename":"polyfills.03bf6.js","previous":2175,"size":2175,"diff":0},{"filename":"index.html","previous":1102,"size":1018,"diff":-84},{"filename":"200.html","previous":1108,"size":1024,"diff":-84},{"filename":"bundle.7a645.css","previous":4569,"size":0,"diff":-4569},{"filename":"bundle.49e2d.js","previous":113122,"size":0,"diff":-113122},{"filename":"bundle.49cd0.css","previous":0,"size":3513,"diff":3513},{"filename":"bundle.9466b.js","previous":0,"size":113123,"diff":113123}]},{"timestamp":1617508442140,"files":[{"filename":"bundle.8730a.css","previous":440652,"size":0,"diff":-440652},{"filename":"bundle.*****.esm.js","previous":112647,"size":112647,"diff":0},{"filename":"polyfills.*****.esm.js","previous":2177,"size":2177,"diff":0},{"filename":"sw-esm.js","previous":8486,"size":8486,"diff":0},{"filename":"sw.js","previous":8482,"size":8482,"diff":0},{"filename":"bundle.7a35f.js","previous":113123,"size":0,"diff":-113123},{"filename":"polyfills.03bf6.js","previous":2175,"size":2175,"diff":0},{"filename":"index.html","previous":1101,"size":1102,"diff":1},{"filename":"200.html","previous":1107,"size":1108,"diff":1},{"filename":"bundle.7a645.css","previous":0,"size":4569,"diff":4569},{"filename":"bundle.49e2d.js","previous":0,"size":113122,"diff":113122}]},{"timestamp":1617506457357,"files":[{"filename":"bundle.8730a.css","previous":0,"size":440652,"diff":440652},{"filename":"bundle.*****.esm.js","previous":0,"size":112647,"diff":112647},{"filename":"polyfills.*****.esm.js","previous":0,"size":2177,"diff":2177},{"filename":"sw-esm.js","previous":0,"size":8486,"diff":8486},{"filename":"sw.js","previous":0,"size":8482,"diff":8482},{"filename":"bundle.7a35f.js","previous":0,"size":113123,"diff":113123},{"filename":"polyfills.03bf6.js","previous":0,"size":2175,"diff":2175},{"filename":"index.html","previous":0,"size":1101,"diff":1101},{"filename":"200.html","previous":0,"size":1107,"diff":1107}]}]
|
@ -1,23 +0,0 @@
|
||||
.component {
|
||||
@apply bg-red-200;
|
||||
}
|
||||
.item {
|
||||
@apply bg-gray-50 p-2 text-red-400 border-red-500 my-px
|
||||
transition-colors
|
||||
flex justify-between items-center w-32
|
||||
overflow-ellipsis select-none cursor-pointer;
|
||||
@apply hover:bg-red-50;
|
||||
|
||||
svg {
|
||||
@apply hidden;
|
||||
}
|
||||
}
|
||||
|
||||
.itemActive {
|
||||
@apply bg-red-400 text-white;
|
||||
@apply hover:bg-red-400;
|
||||
|
||||
svg {
|
||||
@apply inline-block;
|
||||
}
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
// This file is automatically generated from your CSS. Any edits will be overwritten.
|
||||
declare namespace BranchesListScssNamespace {
|
||||
export interface IBranchesListScss {
|
||||
component: string;
|
||||
item: string;
|
||||
itemActive: string;
|
||||
}
|
||||
}
|
||||
|
||||
declare const BranchesListScssModule: BranchesListScssNamespace.IBranchesListScss;
|
||||
|
||||
export = BranchesListScssModule;
|
@ -1,78 +0,0 @@
|
||||
import {
|
||||
LogList,
|
||||
Project,
|
||||
ListLogsArgs,
|
||||
ListBranchesArgs,
|
||||
BranchList
|
||||
} from '../../generated/graphql';
|
||||
import { h } from 'preact';
|
||||
import { gql, useQuery } from '@apollo/client';
|
||||
import styles from './branches-list.scss';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import { faChevronRight } from '@fortawesome/free-solid-svg-icons';
|
||||
import { action, makeObservable, observable } from 'mobx';
|
||||
import { PropTypes, useLocalObservable, useObserver } from 'mobx-react';
|
||||
|
||||
const LIST_BRANCHES = gql`
|
||||
query ListBranches($args: ListBranchesArgs!) {
|
||||
listBranches(listBranchesArgs: $args) {
|
||||
all
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
interface Props {
|
||||
project: Project;
|
||||
onSelect?: (branch: string) => void;
|
||||
}
|
||||
|
||||
class Store {
|
||||
constructor() {
|
||||
makeObservable(this);
|
||||
}
|
||||
|
||||
@observable
|
||||
currBranch?: string;
|
||||
|
||||
@action
|
||||
setCurrBranch(branch?: string) {
|
||||
this.currBranch = branch;
|
||||
}
|
||||
}
|
||||
|
||||
export const BranchesList = ({ project, onSelect }: Props) => {
|
||||
const store = useLocalObservable(() => new Store());
|
||||
const { data, loading } = useQuery<
|
||||
{ listBranches: BranchList },
|
||||
{ args: ListBranchesArgs }
|
||||
>(LIST_BRANCHES, {
|
||||
variables: { args: { projectId: project.id } }
|
||||
});
|
||||
|
||||
const list = useObserver(() =>
|
||||
data?.listBranches?.all?.map(text => {
|
||||
return (
|
||||
<li
|
||||
key={text}
|
||||
className={[
|
||||
styles.item,
|
||||
store.currBranch === text ? styles.itemActive : ''
|
||||
].join(' ')}
|
||||
onClick={() => {
|
||||
store.setCurrBranch(text);
|
||||
onSelect?.(text);
|
||||
}}
|
||||
>
|
||||
{text.replace(/^.*\/(.+?)$/, '$1')}
|
||||
<FontAwesomeIcon icon={faChevronRight} />
|
||||
</li>
|
||||
);
|
||||
})
|
||||
);
|
||||
|
||||
return (
|
||||
<section className={styles.component}>
|
||||
{loading ? <span>Loading...</span> : <ol>{list}</ol>}
|
||||
</section>
|
||||
);
|
||||
};
|
@ -5,16 +5,19 @@
|
||||
@apply bg-gray-100 overflow-auto max-h-full;
|
||||
}
|
||||
.item {
|
||||
@apply grid grid-cols-2 grid-rows-2;
|
||||
@apply bg-white text-gray-700;
|
||||
@apply py-2 px-4 my-px;
|
||||
@apply hover:bg-gray-50;
|
||||
header {
|
||||
@apply relative;
|
||||
@apply bg-white text-gray-700;
|
||||
@apply py-2 px-4 my-px;
|
||||
@apply hover:bg-gray-50;
|
||||
}
|
||||
|
||||
time {
|
||||
@apply col-start-1;
|
||||
@apply text-sm text-gray-400;
|
||||
}
|
||||
:global(.commit-actions) {
|
||||
@apply col-start-2 row-start-1 row-span-2 justify-self-end self-center;
|
||||
@apply absolute right-0 top-0 bottom-0;
|
||||
@apply justify-self-end self-center;
|
||||
}
|
||||
}
|
||||
|
@ -1,14 +1,11 @@
|
||||
import {
|
||||
LogList,
|
||||
Project,
|
||||
ListLogsArgs,
|
||||
Pipeline
|
||||
} from '../../generated/graphql';
|
||||
import { LogList, Pipeline, LogFields } from '../../generated/graphql';
|
||||
import { h } from 'preact';
|
||||
import { gql, useQuery, useSubscription } from '@apollo/client';
|
||||
import styles from './commit-log-list.scss';
|
||||
import { CommitActions } from '../commit-actions/commit-actions';
|
||||
import { FIND_PIPELINE } from '../pipelines/pipeline-list.constants';
|
||||
import { route } from 'preact-router';
|
||||
import { PipelineTaskStatus } from '../pipeline-tasks/pipeline-task-status';
|
||||
|
||||
const LIST_LOGS = gql`
|
||||
subscription listLogsForPipeline($id: String!) {
|
||||
@ -18,6 +15,13 @@ const LIST_LOGS = gql`
|
||||
author_email
|
||||
message
|
||||
hash
|
||||
tasks {
|
||||
id
|
||||
status
|
||||
startedAt
|
||||
endedAt
|
||||
units
|
||||
}
|
||||
}
|
||||
total
|
||||
}
|
||||
@ -41,17 +45,34 @@ export const CommitLogList = ({ pipelineId }: Props) => {
|
||||
variables: { id: pipelineId }
|
||||
});
|
||||
const pipeline = queryResult.data?.pipeline;
|
||||
const list = data?.listLogs?.all?.map(log => {
|
||||
return (
|
||||
<li className={styles.item} key={log.hash}>
|
||||
const Item = ({ log }: { log: LogFields }) => (
|
||||
<li className={styles.item}>
|
||||
<header>
|
||||
<h4>{log.message}</h4>
|
||||
<time dateTime={log.date}>{log.date}</time>
|
||||
{pipeline ? (
|
||||
<CommitActions pipeline={pipeline} commit={log.hash} />
|
||||
) : null}
|
||||
</li>
|
||||
);
|
||||
});
|
||||
</header>
|
||||
<ol>
|
||||
{log.tasks.map(task => (
|
||||
<li
|
||||
key={task.id}
|
||||
onClick={() =>
|
||||
route(
|
||||
`/projects/${pipeline?.projectId}/pipelines/${pipeline?.id}/tasks/${task.id}`
|
||||
)
|
||||
}
|
||||
>
|
||||
<PipelineTaskStatus status={task.status} /> {task.startedAt}
|
||||
</li>
|
||||
))}
|
||||
</ol>
|
||||
</li>
|
||||
);
|
||||
const list = data?.listLogs?.all?.map(log => (
|
||||
<Item log={log} key={log.hash} />
|
||||
));
|
||||
|
||||
return (
|
||||
<section className={styles.component}>
|
||||
|
@ -118,10 +118,14 @@ export const PipelineTaskDetails = ({ taskId }: Props) => {
|
||||
{ taskId: string }
|
||||
>(FIND_PIPELINE_TASK, { variables: { taskId } });
|
||||
|
||||
subscribeToMore({
|
||||
document: PIPELINE_TASK_CHANGED,
|
||||
variables: { taskId }
|
||||
});
|
||||
useMemo(
|
||||
() =>
|
||||
subscribeToMore({
|
||||
document: PIPELINE_TASK_CHANGED,
|
||||
variables: { taskId }
|
||||
}),
|
||||
[subscribeToMore, taskId]
|
||||
);
|
||||
|
||||
const store = useLocalObservable(() => new Store());
|
||||
|
||||
|
@ -1,14 +1,8 @@
|
||||
import { h } from 'preact';
|
||||
import styles from './pipeline-tasks.scss';
|
||||
import { gql, useQuery } from '@apollo/client';
|
||||
import { PipelineTask, TaskStatuses } from '../../generated/graphql';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import {
|
||||
faCheckCircle,
|
||||
faClock,
|
||||
faExclamationCircle,
|
||||
faRunning
|
||||
} from '@fortawesome/free-solid-svg-icons';
|
||||
import { PipelineTask } from '../../generated/graphql';
|
||||
import { PipelineTaskStatus } from './pipeline-task-status';
|
||||
|
||||
const LIST_TASKS = gql`
|
||||
query ListTasks($pipelineId: String!) {
|
||||
@ -55,7 +49,7 @@ export const PipelineTaskList = ({ pipelineId }: Props) => {
|
||||
const Item = ({ task }: { task: PipelineTask }) => {
|
||||
return (
|
||||
<li key={task.id} className={styles.item}>
|
||||
<Status status={task.status} />
|
||||
<PipelineTaskStatus status={task.status} />
|
||||
<span>{task.id}</span>
|
||||
<span>{task.commit}</span>
|
||||
<span>{task.startedAt}</span>
|
||||
@ -68,23 +62,3 @@ const Item = ({ task }: { task: PipelineTask }) => {
|
||||
</li>
|
||||
);
|
||||
};
|
||||
|
||||
const Status = ({ status }: { status: TaskStatuses }) => {
|
||||
let icon;
|
||||
switch (status) {
|
||||
case TaskStatuses.Failed:
|
||||
icon = faExclamationCircle;
|
||||
break;
|
||||
case TaskStatuses.Success:
|
||||
icon = faCheckCircle;
|
||||
break;
|
||||
case TaskStatuses.Pending:
|
||||
icon = faClock;
|
||||
break;
|
||||
case TaskStatuses.Working:
|
||||
icon = faRunning;
|
||||
break;
|
||||
}
|
||||
|
||||
return <FontAwesomeIcon icon={icon} />;
|
||||
};
|
||||
|
45
src/components/pipeline-tasks/pipeline-task-status.tsx
Normal file
45
src/components/pipeline-tasks/pipeline-task-status.tsx
Normal file
@ -0,0 +1,45 @@
|
||||
import { h } from 'preact';
|
||||
import { TaskStatuses } from '../../generated/graphql';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import {
|
||||
faCheckCircle,
|
||||
faExclamationCircle,
|
||||
faPauseCircle,
|
||||
faSpinner
|
||||
} from '@fortawesome/free-solid-svg-icons';
|
||||
import classNames from 'classnames';
|
||||
|
||||
export const PipelineTaskStatus = ({ status }: { status: TaskStatuses }) => {
|
||||
switch (status) {
|
||||
case TaskStatuses.Working:
|
||||
return (
|
||||
<FontAwesomeIcon
|
||||
icon={faSpinner}
|
||||
className={classNames(['animate-spin', 'text-blue-500'])}
|
||||
/>
|
||||
);
|
||||
case TaskStatuses.Failed:
|
||||
return (
|
||||
<FontAwesomeIcon
|
||||
icon={faExclamationCircle}
|
||||
className={classNames(['text-red-700'])}
|
||||
/>
|
||||
);
|
||||
case TaskStatuses.Success:
|
||||
return (
|
||||
<FontAwesomeIcon
|
||||
icon={faCheckCircle}
|
||||
className={classNames(['text-green-500'])}
|
||||
/>
|
||||
);
|
||||
case TaskStatuses.Pending:
|
||||
return (
|
||||
<FontAwesomeIcon
|
||||
icon={faPauseCircle}
|
||||
className={classNames(['text-yellow-500'])}
|
||||
/>
|
||||
);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
};
|
@ -14,14 +14,20 @@ export type Scalars = {
|
||||
DateTime: any;
|
||||
};
|
||||
|
||||
export type Hello = {
|
||||
__typename?: 'Hello';
|
||||
message: Scalars['String'];
|
||||
export type CreatePipelineInput = {
|
||||
projectId: Scalars['String'];
|
||||
branch: Scalars['String'];
|
||||
name: Scalars['String'];
|
||||
workUnitMetadata: WorkUnitMetadataInput;
|
||||
};
|
||||
|
||||
export type Project = {
|
||||
__typename?: 'Project';
|
||||
id: Scalars['ID'];
|
||||
export type CreatePipelineTaskInput = {
|
||||
pipelineId: Scalars['String'];
|
||||
commit: Scalars['String'];
|
||||
units: Array<PipelineUnits>;
|
||||
};
|
||||
|
||||
export type CreateProjectInput = {
|
||||
name: Scalars['String'];
|
||||
comment: Scalars['String'];
|
||||
sshUrl: Scalars['String'];
|
||||
@ -29,35 +35,10 @@ export type Project = {
|
||||
webHookSecret?: Maybe<Scalars['String']>;
|
||||
};
|
||||
|
||||
export type WorkUnit = {
|
||||
__typename?: 'WorkUnit';
|
||||
type: PipelineUnits;
|
||||
scripts: Array<Scalars['String']>;
|
||||
};
|
||||
|
||||
/** 流水线单元 */
|
||||
export enum PipelineUnits {
|
||||
Checkout = 'checkout',
|
||||
InstallDependencies = 'installDependencies',
|
||||
Test = 'test',
|
||||
Deploy = 'deploy',
|
||||
CleanUp = 'cleanUp'
|
||||
}
|
||||
|
||||
export type WorkUnitMetadata = {
|
||||
__typename?: 'WorkUnitMetadata';
|
||||
version: Scalars['Float'];
|
||||
units: Array<WorkUnit>;
|
||||
};
|
||||
|
||||
export type Pipeline = {
|
||||
__typename?: 'Pipeline';
|
||||
id: Scalars['ID'];
|
||||
project: Project;
|
||||
projectId: Scalars['String'];
|
||||
branch: Scalars['String'];
|
||||
name: Scalars['String'];
|
||||
workUnitMetadata: WorkUnitMetadata;
|
||||
export type Hello = {
|
||||
__typename?: 'Hello';
|
||||
message: Scalars['String'];
|
||||
};
|
||||
|
||||
export type LogFields = {
|
||||
@ -69,6 +50,7 @@ export type LogFields = {
|
||||
body: Scalars['String'];
|
||||
author_name: Scalars['String'];
|
||||
author_email: Scalars['String'];
|
||||
tasks: Array<PipelineTask>;
|
||||
};
|
||||
|
||||
export type LogList = {
|
||||
@ -78,90 +60,6 @@ export type LogList = {
|
||||
latest: LogFields;
|
||||
};
|
||||
|
||||
export type PipelineTaskLogs = {
|
||||
__typename?: 'PipelineTaskLogs';
|
||||
unit: PipelineUnits;
|
||||
status: TaskStatuses;
|
||||
startedAt?: Maybe<Scalars['DateTime']>;
|
||||
endedAt?: Maybe<Scalars['DateTime']>;
|
||||
logs: Scalars['String'];
|
||||
};
|
||||
|
||||
/** 任务状态 */
|
||||
export enum TaskStatuses {
|
||||
Success = 'success',
|
||||
Failed = 'failed',
|
||||
Working = 'working',
|
||||
Pending = 'pending'
|
||||
}
|
||||
|
||||
|
||||
export type PipelineTask = {
|
||||
__typename?: 'PipelineTask';
|
||||
id: Scalars['ID'];
|
||||
pipeline: Pipeline;
|
||||
pipelineId: Scalars['String'];
|
||||
commit: Scalars['String'];
|
||||
units: Array<PipelineUnits>;
|
||||
logs: Array<PipelineTaskLogs>;
|
||||
status: TaskStatuses;
|
||||
startedAt?: Maybe<Scalars['DateTime']>;
|
||||
endedAt?: Maybe<Scalars['DateTime']>;
|
||||
};
|
||||
|
||||
export type PipelineTaskLogMessage = {
|
||||
__typename?: 'PipelineTaskLogMessage';
|
||||
unit?: Maybe<PipelineUnits>;
|
||||
time: Scalars['DateTime'];
|
||||
message: Scalars['String'];
|
||||
};
|
||||
|
||||
export type WorkUnitInput = {
|
||||
type: PipelineUnits;
|
||||
scripts: Array<Scalars['String']>;
|
||||
};
|
||||
|
||||
export type WorkUnitMetadataInput = {
|
||||
version?: Maybe<Scalars['Float']>;
|
||||
units: Array<WorkUnitInput>;
|
||||
};
|
||||
|
||||
export type Query = {
|
||||
__typename?: 'Query';
|
||||
hello: Hello;
|
||||
findProjects: Array<Project>;
|
||||
findProject: Project;
|
||||
listPipelines: Array<Pipeline>;
|
||||
findPipeline: Pipeline;
|
||||
listPipelineTaskByPipelineId: Array<PipelineTask>;
|
||||
findPipelineTask: PipelineTask;
|
||||
};
|
||||
|
||||
|
||||
export type QueryFindProjectArgs = {
|
||||
id: Scalars['String'];
|
||||
};
|
||||
|
||||
|
||||
export type QueryListPipelinesArgs = {
|
||||
projectId?: Maybe<Scalars['String']>;
|
||||
};
|
||||
|
||||
|
||||
export type QueryFindPipelineArgs = {
|
||||
id: Scalars['String'];
|
||||
};
|
||||
|
||||
|
||||
export type QueryListPipelineTaskByPipelineIdArgs = {
|
||||
pipelineId: Scalars['String'];
|
||||
};
|
||||
|
||||
|
||||
export type QueryFindPipelineTaskArgs = {
|
||||
id: Scalars['String'];
|
||||
};
|
||||
|
||||
export type Mutation = {
|
||||
__typename?: 'Mutation';
|
||||
createProject: Project;
|
||||
@ -210,46 +108,106 @@ export type MutationCreatePipelineTaskArgs = {
|
||||
task: CreatePipelineTaskInput;
|
||||
};
|
||||
|
||||
export type CreateProjectInput = {
|
||||
name: Scalars['String'];
|
||||
comment: Scalars['String'];
|
||||
sshUrl: Scalars['String'];
|
||||
webUrl?: Maybe<Scalars['String']>;
|
||||
webHookSecret?: Maybe<Scalars['String']>;
|
||||
};
|
||||
|
||||
export type UpdateProjectInput = {
|
||||
name: Scalars['String'];
|
||||
comment: Scalars['String'];
|
||||
sshUrl: Scalars['String'];
|
||||
webUrl?: Maybe<Scalars['String']>;
|
||||
webHookSecret?: Maybe<Scalars['String']>;
|
||||
};
|
||||
|
||||
export type CreatePipelineInput = {
|
||||
export type Pipeline = {
|
||||
__typename?: 'Pipeline';
|
||||
id: Scalars['ID'];
|
||||
project: Project;
|
||||
projectId: Scalars['String'];
|
||||
branch: Scalars['String'];
|
||||
name: Scalars['String'];
|
||||
workUnitMetadata: WorkUnitMetadataInput;
|
||||
workUnitMetadata: WorkUnitMetadata;
|
||||
};
|
||||
|
||||
export type UpdatePipelineInput = {
|
||||
projectId: Scalars['String'];
|
||||
branch: Scalars['String'];
|
||||
name: Scalars['String'];
|
||||
workUnitMetadata: WorkUnitMetadataInput;
|
||||
};
|
||||
|
||||
export type CreatePipelineTaskInput = {
|
||||
export type PipelineTask = {
|
||||
__typename?: 'PipelineTask';
|
||||
id: Scalars['ID'];
|
||||
pipeline: Pipeline;
|
||||
pipelineId: Scalars['String'];
|
||||
commit: Scalars['String'];
|
||||
units: Array<PipelineUnits>;
|
||||
logs: Array<PipelineTaskLogs>;
|
||||
status: TaskStatuses;
|
||||
startedAt?: Maybe<Scalars['DateTime']>;
|
||||
endedAt?: Maybe<Scalars['DateTime']>;
|
||||
};
|
||||
|
||||
export type PipelineTaskLogMessage = {
|
||||
__typename?: 'PipelineTaskLogMessage';
|
||||
unit?: Maybe<PipelineUnits>;
|
||||
time: Scalars['DateTime'];
|
||||
message: Scalars['String'];
|
||||
isError: Scalars['Boolean'];
|
||||
};
|
||||
|
||||
export type PipelineTaskLogs = {
|
||||
__typename?: 'PipelineTaskLogs';
|
||||
unit: PipelineUnits;
|
||||
status: TaskStatuses;
|
||||
startedAt?: Maybe<Scalars['DateTime']>;
|
||||
endedAt?: Maybe<Scalars['DateTime']>;
|
||||
logs: Scalars['String'];
|
||||
};
|
||||
|
||||
/** 流水线单元 */
|
||||
export enum PipelineUnits {
|
||||
Checkout = 'checkout',
|
||||
InstallDependencies = 'installDependencies',
|
||||
Test = 'test',
|
||||
Deploy = 'deploy',
|
||||
CleanUp = 'cleanUp'
|
||||
}
|
||||
|
||||
export type Project = {
|
||||
__typename?: 'Project';
|
||||
id: Scalars['ID'];
|
||||
name: Scalars['String'];
|
||||
comment: Scalars['String'];
|
||||
sshUrl: Scalars['String'];
|
||||
webUrl?: Maybe<Scalars['String']>;
|
||||
webHookSecret?: Maybe<Scalars['String']>;
|
||||
};
|
||||
|
||||
export type Query = {
|
||||
__typename?: 'Query';
|
||||
hello: Hello;
|
||||
findProjects: Array<Project>;
|
||||
findProject: Project;
|
||||
listPipelines: Array<Pipeline>;
|
||||
findPipeline: Pipeline;
|
||||
listPipelineTaskByPipelineId: Array<PipelineTask>;
|
||||
findPipelineTask: PipelineTask;
|
||||
};
|
||||
|
||||
|
||||
export type QueryFindProjectArgs = {
|
||||
id: Scalars['String'];
|
||||
};
|
||||
|
||||
|
||||
export type QueryListPipelinesArgs = {
|
||||
projectId?: Maybe<Scalars['String']>;
|
||||
};
|
||||
|
||||
|
||||
export type QueryFindPipelineArgs = {
|
||||
id: Scalars['String'];
|
||||
};
|
||||
|
||||
|
||||
export type QueryListPipelineTaskByPipelineIdArgs = {
|
||||
pipelineId: Scalars['String'];
|
||||
};
|
||||
|
||||
|
||||
export type QueryFindPipelineTaskArgs = {
|
||||
id: Scalars['String'];
|
||||
};
|
||||
|
||||
export type Subscription = {
|
||||
__typename?: 'Subscription';
|
||||
listLogsForPipeline: LogList;
|
||||
pipelineTaskLog: PipelineTaskLogMessage;
|
||||
pipelineTaskChanged: PipelineTask;
|
||||
};
|
||||
|
||||
|
||||
@ -261,3 +219,53 @@ export type SubscriptionListLogsForPipelineArgs = {
|
||||
export type SubscriptionPipelineTaskLogArgs = {
|
||||
taskId: Scalars['String'];
|
||||
};
|
||||
|
||||
|
||||
export type SubscriptionPipelineTaskChangedArgs = {
|
||||
id: Scalars['String'];
|
||||
};
|
||||
|
||||
/** 任务状态 */
|
||||
export enum TaskStatuses {
|
||||
Success = 'success',
|
||||
Failed = 'failed',
|
||||
Working = 'working',
|
||||
Pending = 'pending'
|
||||
}
|
||||
|
||||
export type UpdatePipelineInput = {
|
||||
projectId: Scalars['String'];
|
||||
branch: Scalars['String'];
|
||||
name: Scalars['String'];
|
||||
workUnitMetadata: WorkUnitMetadataInput;
|
||||
};
|
||||
|
||||
export type UpdateProjectInput = {
|
||||
name: Scalars['String'];
|
||||
comment: Scalars['String'];
|
||||
sshUrl: Scalars['String'];
|
||||
webUrl?: Maybe<Scalars['String']>;
|
||||
webHookSecret?: Maybe<Scalars['String']>;
|
||||
};
|
||||
|
||||
export type WorkUnit = {
|
||||
__typename?: 'WorkUnit';
|
||||
type: PipelineUnits;
|
||||
scripts: Array<Scalars['String']>;
|
||||
};
|
||||
|
||||
export type WorkUnitInput = {
|
||||
type: PipelineUnits;
|
||||
scripts: Array<Scalars['String']>;
|
||||
};
|
||||
|
||||
export type WorkUnitMetadata = {
|
||||
__typename?: 'WorkUnitMetadata';
|
||||
version: Scalars['Float'];
|
||||
units: Array<WorkUnit>;
|
||||
};
|
||||
|
||||
export type WorkUnitMetadataInput = {
|
||||
version?: Maybe<Scalars['Float']>;
|
||||
units: Array<WorkUnitInput>;
|
||||
};
|
||||
|
@ -1,5 +1,8 @@
|
||||
module.exports = {
|
||||
purge: [],
|
||||
purge: {
|
||||
enabled: true,
|
||||
content: ['./src/**/*']
|
||||
},
|
||||
darkMode: 'class', // or 'media' or 'class'
|
||||
theme: {
|
||||
extend: {}
|
||||
|
Loading…
Reference in New Issue
Block a user