-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
88 additions
and
4 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
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,83 @@ | ||
// Generated by ReScript, PLEASE EDIT WITH CARE | ||
|
||
import * as Sdk from "jsr:@fluentci/sdk"; | ||
|
||
var secret = Sdk.dag.setSecret("GITHUB", "my-github-token"); | ||
|
||
console.log(await secret.plaintext()); | ||
|
||
var secretDemo = await Sdk.dag.pipeline("secret-demo").withSecretVariable("GITHUB", secret).withExec(["echo $GITHUB"]).stdout(); | ||
|
||
console.log("Secret demo: " + secretDemo); | ||
|
||
var cache = Sdk.dag.cache("pixi"); | ||
|
||
console.log("cacheId: " + await cache.id()); | ||
|
||
var ping = Sdk.dag.pipeline("demo").nix({ | ||
impure: true | ||
}).withWorkdir("nix-demo").withExec([ | ||
"ping", | ||
"fluentci.io" | ||
]).asService("ping_service"); | ||
|
||
console.log("Ping service: " + await ping.id()); | ||
|
||
var pingGithub = Sdk.dag.pipeline("ping-github").pkgx().withPackages(["ping"]).withExec([ | ||
"ping", | ||
"github.com" | ||
]).asService("ping_github"); | ||
|
||
var stdout = await Sdk.dag.pipeline("demo").pkgx().withPackages(["ping"]).withService(ping).withService(pingGithub).withExec([ | ||
"sleep", | ||
"15" | ||
]).withExec([ | ||
"ls", | ||
"-ltr", | ||
".fluentci" | ||
]).withExec([ | ||
"cat", | ||
".fluentci/process-compose.yaml" | ||
]).stdout(); | ||
|
||
console.log("Stdout: " + stdout); | ||
|
||
var mise = await Sdk.dag.pipeline("mise-demo").mise().withWorkdir("./mise-demo").withExec([ | ||
"mise", | ||
"--version" | ||
]).withExec([ | ||
"which", | ||
"bun" | ||
]).stdout(); | ||
|
||
console.log("Mise: " + mise); | ||
|
||
var git = await Sdk.dag.git("https://github.com/tsirysndr/me").branch("main").tree().withExec(["pwd"]).stdout(); | ||
|
||
console.log("Git: " + git); | ||
|
||
var gitEntries = await Sdk.dag.git("https://github.com/tsirysndr/me").branch("main").tree().entries(); | ||
|
||
console.log("Git entries: "); | ||
|
||
console.log(gitEntries); | ||
|
||
var dir = await Sdk.dag.directory(".").entries(); | ||
|
||
console.log("Directory entries at '.': "); | ||
|
||
console.log(dir); | ||
|
||
export { | ||
secret , | ||
secretDemo , | ||
cache , | ||
ping , | ||
pingGithub , | ||
stdout , | ||
mise , | ||
git , | ||
gitEntries , | ||
dir , | ||
} | ||
/* secret Not a pure module */ |
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