Merge pull request #1569 from shykes/docker-run-tweak

Simplify docker.#Run
This commit is contained in:
Solomon Hykes
2022-02-08 09:58:22 -08:00
committed by GitHub
18 changed files with 129 additions and 81 deletions

View File

@@ -38,7 +38,10 @@ dagger.#Plan & {
dev.assets,
// 2. Mix magical command
mix.#Run & {
script: "mix phx.digest"
command: {
name: "mix"
args: ["phx.digest"]
}
mix: {
env: "prod"
app: _appName
@@ -94,7 +97,12 @@ dagger.#Plan & {
}
// FIXME: run 'yarn install' and 'yarn run compile' separately, with different caching?
// FIXME: can we reuse universe.dagger.io/yarn ???? 0:-)
script: "yarn install --frozen-lockfile && yarn run compile"
command: {
name: "sh"
flags: "-c": """
yarn install --frozen-lockfile && yarn run compile"
"""
}
workdir: "/app/assets"
},
]
@@ -110,8 +118,11 @@ dagger.#Plan & {
// Run tests
run: docker.#Run & {
image: build.output
script: "mix test"
image: build.output
command: {
name: "mix"
args: ["test"]
}
// Don't cache running tests
// Just because we've tested a version before, doesn't mean we don't
// want to test it again.

View File

@@ -42,7 +42,10 @@ import (
depsCache: "locked"
}
workdir: "/app"
script: "mix deps.get"
command: {
name: "mix"
args: ["deps.get"]
}
},
// 4. Build!
// FIXME: step 5 is to add image data, see issue 1339
@@ -54,7 +57,10 @@ import (
buildCache: "locked"
}
workdir: "/app"
script: "mix do deps.compile, compile"
command: {
name: "mix"
args: ["do", "deps.compile,compile"]
}
},
]
}