-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from fluent-ci-templates/feat/run-specific-jobs
feat: allow running specific jobs from a pipeline
- Loading branch information
Showing
2 changed files
with
17 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,11 @@ import { green } from "https://deno.land/[email protected]/fmt/colors.ts"; | |
|
||
const BASE_URL = "https://api.fluentci.io/v1"; | ||
|
||
async function run(pipeline: string, reload = false) { | ||
async function run( | ||
pipeline: string, | ||
jobs: [string, ...Array<string>], | ||
reload = false | ||
) { | ||
if (pipeline === ".") { | ||
try { | ||
// verify if .fluentci directory exists | ||
|
@@ -18,12 +22,16 @@ async function run(pipeline: string, reload = false) { | |
args: [ | ||
"run", | ||
"-A", | ||
`--import-map=.fluentci/import_map.json`, | ||
`.fluentci/src/dagger/runner.ts`, | ||
"--import-map=.fluentci/import_map.json", | ||
".fluentci/src/dagger/runner.ts", | ||
...jobs, | ||
], | ||
}); | ||
|
||
await command.output(); | ||
const { stderr, success } = await command.output(); | ||
if (!success) { | ||
console.log(new TextDecoder().decode(stderr)); | ||
} | ||
return; | ||
} | ||
|
||
|
@@ -41,6 +49,7 @@ async function run(pipeline: string, reload = false) { | |
let denoModule = [ | ||
`--import-map=https://deno.land/x/${pipeline}/import_map.json`, | ||
`https://deno.land/x/${pipeline}/src/dagger/runner.ts`, | ||
...jobs, | ||
]; | ||
|
||
if (reload) { | ||
|