Merge pull request #1763 from jlongtine/migrate-message

Create a nice error message for 0.1 plans loaded in 0.2
This commit is contained in:
Andrea Luzzardi
2022-03-10 15:34:36 -08:00
committed by GitHub
4 changed files with 98 additions and 36 deletions

View File

@@ -38,6 +38,14 @@ setup() {
refute_output --partial 'client.filesystem."./dependent_do".write'
}
@test "plan/do: nice error message for 0.1.0 projects" {
run "$DAGGER" "do" -p ./plan/do/error_message_for_0.1_projects.cue
assert_output --partial "attempting to load a dagger 0.1.0 project."
run "$DAGGER" "do" -p ./plan/do/error_message_for_0.1_projects.cue test
assert_output --partial "attempting to load a dagger 0.1.0 project."
}
@test "plan/hello" {
# Europa loader handles the cwd differently, therefore we need to CD into the tree at or below the parent of cue.mod
cd "$TESTDIR"

View File

@@ -0,0 +1,60 @@
package main
import (
"alpha.dagger.io/dagger"
"alpha.dagger.io/aws/s3"
"alpha.dagger.io/netlify"
"alpha.dagger.io/os"
)
repo: dagger.#Artifact & dagger.#Input
hello: {
dir: dagger.#Artifact & dagger.#Input
ctr: os.#Container & {
command: """
ls -l /src > /tmp/out
"""
mount: "/src": from: dir
}
f: os.#File & {
from: ctr
path: "/tmp/out"
}
message: f.contents & dagger.#Output
}
// Website
web: {
source: os.#Dir & {
from: repo
path: "web"
}
url: string & dagger.#Output
// Where to host the website?
provider: *"s3" | "netlify" & dagger.#Input
// Deploy to AWS S3
if provider == "s3" {
url: "\(bucket.url)index.html"
bucket: s3.#Put & {
contentType: "text/html"
"source": source
}
}
// Deploy to Netlify
if provider == "netlify" {
url: site.url
site: netlify.#Site & {
contents: source
}
}
}