This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
dagger/tests/plan/do/error_message_for_0.1_projects.cue
Joel Longtine 43b9df74a8 Add test
Signed-off-by: Joel Longtine <joel@dagger.io>
2022-03-10 15:15:50 -07:00

61 lines
873 B
CUE

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
}
}
}