Skip to content

Commit

Permalink
use devbox run instead of devbox global run
Browse files Browse the repository at this point in the history
  • Loading branch information
tsirysndr committed Jun 15, 2024
1 parent e66ba52 commit 70a14d5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
13 changes: 8 additions & 5 deletions example/.fluentci/src/dagger/jobs.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Directory, Container, dag } from "../../deps.ts";
import { type Directory, type Container, dag } from "../../deps.ts";
import { withEnv, withSrc, getDirectory } from "./lib.ts";

export enum Job {
Expand All @@ -22,20 +22,23 @@ export async function execLane(
const baseCtr = dag
.pipeline(Job.execLane)
.container()
.from("ghcr.io/fluent-ci-templates/fastlane:latest");
.from("ghcr.io/fluent-ci-templates/fastlane:latest")
.withExec(["sh", "-c", "devbox update"]);

const ctr = withEnv(withSrc(baseCtr, context))
.withEnvVariable("NODE_OPTIONS", "--max-old-space-size=4096")
.withExec(["sh", "-c", 'eval "$(devbox global shellenv)" && bun install'])
.withExec(["sh", "-c", "[ -f devbox.json ] || devbox init"])
.withExec([
"sh",
"-c",
'eval "$(devbox global shellenv)" && bundle install',
"grep -q 'ruby' devbox.json || devbox add ruby@3.2.2 jdk@17.0.7+7",
])
.withExec(["sh", "-c", "devbox run -- bun install"])
.withExec(["sh", "-c", "devbox run -- bundle install"])
.withExec([
"sh",
"-c",
`eval "$(devbox global shellenv)" && bundle exec fastlane android ${lane}`,
`devbox run -- bundle exec fastlane android ${lane}`,
]);

await ctr.stdout();
Expand Down
13 changes: 8 additions & 5 deletions src/dagger/jobs.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Directory, Container, dag } from "../../deps.ts";
import { type Directory, type Container, dag } from "../../deps.ts";
import { withEnv, withSrc, getDirectory } from "./lib.ts";

export enum Job {
Expand All @@ -22,20 +22,23 @@ export async function execLane(
const baseCtr = dag
.pipeline(Job.execLane)
.container()
.from("ghcr.io/fluent-ci-templates/fastlane:latest");
.from("ghcr.io/fluent-ci-templates/fastlane:latest")
.withExec(["sh", "-c", "devbox update"]);

const ctr = withEnv(withSrc(baseCtr, context))
.withEnvVariable("NODE_OPTIONS", "--max-old-space-size=4096")
.withExec(["sh", "-c", 'eval "$(devbox global shellenv)" && bun install'])
.withExec(["sh", "-c", "[ -f devbox.json ] || devbox init"])
.withExec([
"sh",
"-c",
'eval "$(devbox global shellenv)" && bundle install',
"grep -q 'ruby' devbox.json || devbox add ruby@3.2.2 jdk@17.0.7+7",
])
.withExec(["sh", "-c", "devbox run -- bun install"])
.withExec(["sh", "-c", "devbox run -- bundle install"])
.withExec([
"sh",
"-c",
`eval "$(devbox global shellenv)" && bundle exec fastlane android ${lane}`,
`devbox run -- bundle exec fastlane android ${lane}`,
]);

await ctr.stdout();
Expand Down

0 comments on commit 70a14d5

Please sign in to comment.