Merge pull request #1569 from shykes/docker-run-tweak
Simplify docker.#Run
This commit is contained in:
@@ -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.
|
||||
|
@@ -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"]
|
||||
}
|
||||
},
|
||||
]
|
||||
}
|
||||
|
Reference in New Issue
Block a user