Skip to content

Commit b7685ec

Browse files
Itai GendlerItai Gendler
authored andcommitted
Update pipeline v2 spec
1 parent 0f978dd commit b7685ec

File tree

5 files changed

+13
-21
lines changed

5 files changed

+13
-21
lines changed

docs/content/pipelines v2/spec.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ A Pipeline also needs a `.spec` section.
1212
#### Pipeline which is stored entirely in Codefresh
1313
```yaml
1414
apiVersion: "v1"
15-
kind: "context"
16-
name: "new-pipeline"
15+
kind: "pipeline"
1716
metadata:
17+
name: "new-pipeline"
1818
labels:
1919
repo: "github:ArikMaor/ping-server"
2020
spec:
@@ -44,6 +44,7 @@ spec:
4444
#### Pipeline which is stored on a remote git
4545
```yaml
4646
apiVersion: "v1"
47+
kind: "pipeline"
4748
metadata:
4849
name: "ew-pipeline-git"
4950
labels:
@@ -71,6 +72,7 @@ spec:
7172
#### Pipeline which is stored on a specific url
7273
```yaml
7374
apiVersion: "v1"
75+
kind: "pipeline"
7476
metadata:
7577
name: "new-pipeline-url"
7678
labels:

docs/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const TEMP_DIR = path.resolve(__dirname, '../temp');
1010
const TEMPLATE_DIR = path.resolve(__dirname);
1111
const FILES_TO_IGNORE = ['index.js', 'content/pipelines v2/_index.md', 'content/pipelines v2/spec.md'];
1212
const baseDir = path.resolve(TEMP_DIR, './content');
13+
const ALLOW_BETA_COMMANDS = process.env.ALLOW_BETA_COMMANDS;
1314

1415

1516
const deleteTempFolder = async () => {
@@ -190,7 +191,7 @@ const createAutomatedDocs = async () => {
190191
const command = require(file);
191192

192193
// dont document beta commands currently
193-
if (command.isBetaCommand()) {
194+
if (command.isBetaCommand() && !ALLOW_BETA_COMMANDS) {
194195
continue;
195196
}
196197

lib/interface/cli/commands/pipeline2/create.cmd.js

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,7 @@ const command = new Command({
2323
});
2424
},
2525
handler: async (argv) => {
26-
const {filename, name} = argv;
27-
28-
if (!filename) {
29-
throw new CFError('Pipeline definitions file must be provided');
30-
}
31-
32-
if (!_.get(filename, 'metadata.name') && !name) {
33-
throw new CFError('Name must be provided');
34-
}
35-
36-
const data = argv.filename;
37-
if (name) {
38-
_.set(data, 'metadata.name', name);
39-
}
40-
41-
await pipeline2.createPipeline(data);
42-
console.log(`Pipeline '${data.metadata.name}' created`);
26+
throw new CFError('Not implemented');
4327
},
4428
});
4529

lib/interface/cli/commands/root/create.cmd.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const CFError = require('cf-errors');
22
const Command = require('../../Command');
33
const { crudFilenameOption } = require('../../helpers/general');
4-
const { context } = require('../../../../logic').api;
4+
const { context, pipeline2 } = require('../../../../logic').api;
55
const yargs = require('yargs');
66

77
const get = new Command({
@@ -31,6 +31,10 @@ const get = new Command({
3131
await context.createContext(data);
3232
console.log(`Context: ${data.metadata.name} created`);
3333
break;
34+
case 'pipeline':
35+
await pipeline2.createPipeline(data);
36+
console.log(`Pipeline '${data.metadata.name}' created`);
37+
break;
3438
default:
3539
throw new CFError(`Entity: ${entity} not supported`);
3640
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"ci-publish": "ci-publish",
1111
"pkg": "pkg . -t node9-macos-x64,node9-linux-x64,node9-win-x64 --out-path ./dist",
1212
"serve-docs": "yarn build-local-docs && cd temp && hugo server -D",
13+
"serve-docs-beta": "ALLOW_BETA_COMMANDS=true yarn build-local-docs && cd temp && hugo server -D",
1314
"build-local-docs": "node ./docs/index.js",
1415
"build-public-docs": "node ./docs/index.js && cd temp && hugo"
1516
},

0 commit comments

Comments
 (0)