├── doc.go ├── website ├── static │ ├── .nojekyll │ └── img │ │ ├── favicon.png │ │ ├── dagger-logo.png │ │ ├── dagger-logo-dark.png │ │ ├── what-is-dagger.png │ │ ├── dagger-astronaute.png │ │ ├── dagger-cloud │ │ ├── runs.png │ │ └── share-url.png │ │ ├── use-cases │ │ ├── client-api.png │ │ ├── build-action.png │ │ ├── particubes.com.png │ │ └── particubes-actions.png │ │ ├── Dagger_Website_Space_Uranus.png │ │ ├── getting-started │ │ ├── todoapp.linux.png │ │ └── todoapp.macos.png │ │ ├── Dagger_Icons_Arrow-top.svg │ │ ├── Dagger_Icons_Arrow-bottom.svg │ │ ├── Dagger_Icons_Arrow-left.svg │ │ ├── Dagger_Icons_Arrow-right.svg │ │ └── Dagger_Icons_Caution.svg ├── cypress │ ├── e2e │ │ └── docs.cy.js │ ├── videos │ │ └── .gitignore │ ├── screenshots │ │ └── .gitignore │ ├── fixtures │ │ ├── bad_credential.json │ │ └── bad_verification.code.json │ └── support │ │ └── e2e.js ├── babel.config.js ├── src │ └── theme │ │ ├── DocCard │ │ └── index.d.ts │ │ └── DocCardList │ │ └── index.d.ts ├── .prettierrc ├── env.example ├── .gitignore ├── cypress.config.js └── netlify.toml ├── docs ├── reference │ └── README.md ├── learn │ └── tests │ │ ├── cue.mod │ │ ├── module.cue │ │ └── pkg │ │ │ └── .gitignore │ │ ├── .dagger │ │ └── env │ │ │ ├── gcpcloudrun │ │ │ └── .gitignore │ │ │ ├── multibucket │ │ │ └── .gitignore │ │ │ ├── cloudformation │ │ │ └── .gitignore │ │ │ ├── kube-aws-basic │ │ │ └── .gitignore │ │ │ ├── kube-gcp-basic │ │ │ └── .gitignore │ │ │ ├── kube-kind-basic │ │ │ └── .gitignore │ │ │ ├── kube-aws-cue-manifest │ │ │ └── .gitignore │ │ │ ├── kube-aws-deployment │ │ │ └── .gitignore │ │ │ ├── kube-gcp-cue-manifest │ │ │ └── .gitignore │ │ │ ├── kube-gcp-deployment │ │ │ └── .gitignore │ │ │ ├── kube-kind-deployment │ │ │ └── .gitignore │ │ │ └── kube-kind-cue-manifest │ │ │ └── .gitignore │ │ ├── cloudformation │ │ ├── template │ │ │ ├── convert.cue │ │ │ └── template-end.cue │ │ ├── source-begin.cue │ │ ├── deletion.cue │ │ └── source-end.cue │ │ ├── multibucket │ │ ├── source.cue │ │ ├── yarn.cue │ │ └── netlify.cue │ │ ├── kube-kind │ │ ├── config.cue │ │ ├── basic │ │ │ ├── input.cue │ │ │ └── todoapp.cue │ │ ├── cue-manifest │ │ │ ├── input.cue │ │ │ └── manifest.cue │ │ └── deployment │ │ │ └── input.cue │ │ ├── kube-aws │ │ ├── basic │ │ │ ├── input.cue │ │ │ ├── todoapp.cue │ │ │ └── config.cue │ │ ├── cue-manifest │ │ │ ├── input.cue │ │ │ ├── config.cue │ │ │ └── manifest.cue │ │ └── deployment │ │ │ ├── input.cue │ │ │ └── config.cue │ │ ├── kube-gcp │ │ ├── basic │ │ │ ├── input.cue │ │ │ ├── todoapp.cue │ │ │ └── config.cue │ │ ├── deployment │ │ │ ├── input.cue │ │ │ └── config.cue │ │ └── cue-manifest │ │ │ ├── input.cue │ │ │ ├── config.cue │ │ │ └── manifest.cue │ │ ├── dev-cue-package │ │ └── script.sh │ │ ├── package.json │ │ └── yarn.lock ├── tests │ ├── guides │ │ ├── container-images │ │ │ ├── simple │ │ │ │ ├── src │ │ │ │ │ ├── requirements.txt │ │ │ │ │ └── app.py │ │ │ │ └── with-dockerfile.cue │ │ │ └── multi-stage │ │ │ │ └── src │ │ │ │ ├── go.mod │ │ │ │ └── app.go │ │ ├── persistent-cache │ │ │ ├── go.mod │ │ │ ├── main.go │ │ │ └── build.cue │ │ ├── handling-outputs │ │ │ ├── control.cue │ │ │ ├── default.cue │ │ │ └── wrapper.cue │ │ └── docker │ │ │ ├── dockerfile.cue │ │ │ ├── dockerfile_auth.cue │ │ │ ├── Dockerfile │ │ │ ├── pull.cue │ │ │ ├── dockerfile_target.cue │ │ │ └── build.cue │ ├── use-cases │ │ ├── ci-cd-for-go-project │ │ │ ├── build.cue.fragment │ │ │ ├── test.cue.fragment │ │ │ ├── base.cue.fragment │ │ │ ├── push.cue.fragment │ │ │ ├── retrieve-go-project │ │ │ │ └── dagger.cue │ │ │ └── image.cue.fragment │ │ ├── node-ci │ │ │ ├── build.cue.fragment │ │ │ ├── client.cue.fragment │ │ │ ├── sca.cue.fragment │ │ │ ├── test.cue.fragment │ │ │ └── static-analysis.cue.fragment │ │ └── go-docker-swarm │ │ │ ├── build-action.cue.fragment │ │ │ └── client-api.cue.fragment │ └── core-concepts │ │ ├── client │ │ └── plans │ │ │ ├── file.cue │ │ │ ├── platform.cue │ │ │ ├── fs.cue │ │ │ ├── env.cue │ │ │ ├── cmd_stdin.cue │ │ │ ├── cmd_stderr.cue │ │ │ ├── unix.cue │ │ │ ├── windows.cue │ │ │ ├── env_optional.cue │ │ │ ├── file_export.cue │ │ │ └── cmd_secret.cue │ │ ├── secrets │ │ └── plans │ │ │ ├── file.cue │ │ │ └── sops.cue │ │ └── plan │ │ └── structure.cue.fragment ├── plans │ ├── go-ci │ │ ├── hello │ │ │ ├── go.mod │ │ │ ├── greeting │ │ │ │ ├── greeting.go │ │ │ │ └── greeting_test.go │ │ │ └── main.go │ │ └── plan.cue │ ├── docker-cli-run │ │ ├── local.cue │ │ ├── ssh.cue │ │ └── tcp.cue │ └── docker-cli-load │ │ ├── local.cue │ │ ├── local_windows.cue │ │ └── ssh.cue ├── core-concepts │ ├── 1207-caching.md │ └── 1206-packages.md ├── use-cases │ ├── 1212-svelte-vercel.md │ ├── 1209-docusaurus-netlify.md │ ├── 1208-phoenix-kubernetes.md │ └── 1210-go-goreleaser.md ├── _caution-banner.md ├── index.md ├── getting-started │ └── index.md ├── update-version.sh ├── guides │ ├── buildkit │ │ └── 1229-empty-buildkit-cache.md │ ├── docker │ │ └── 1217-docker-cli-run.md │ └── actions │ │ └── 1231-always-execute.md ├── new.sh ├── includes │ └── dagger-cloud-cta.md └── 0.1.md ├── tests ├── tasks │ ├── exec │ │ ├── secret.txt │ │ ├── workdir.cue │ │ ├── env.cue │ │ ├── http_proxy.cue │ │ ├── hosts.cue │ │ ├── args.cue │ │ ├── env_secret.cue │ │ └── mount_tmp.cue │ ├── source │ │ ├── hello.txt │ │ ├── world.txt │ │ ├── testdata │ │ │ └── world.txt │ │ ├── test.sh │ │ ├── source_not_exist.cue │ │ ├── source_invalid_path.cue │ │ └── source_relative.cue │ ├── dockerfile │ │ ├── testdata │ │ │ ├── foo │ │ │ ├── Dockerfile │ │ │ └── dockerfilepath │ │ │ │ └── Dockerfile.custom │ │ ├── dockerfile.cue │ │ ├── dockerfile_path.cue │ │ ├── build_args.cue │ │ ├── labels.cue │ │ ├── platform.cue │ │ ├── inlined_dockerfile.cue │ │ ├── inlined_dockerfile_heredoc.cue │ │ └── image_config.cue │ ├── gitpull │ │ ├── invalid.cue │ │ ├── bad_remote.cue │ │ ├── exists.cue │ │ └── bad_ref.cue │ ├── httpfetch │ │ ├── exist.cue │ │ └── not_exist.cue │ ├── scratch │ │ ├── scratch_build_scratch.cue │ │ ├── scratch_writefile.cue │ │ └── scratch.cue │ ├── readfile │ │ └── readfile.cue │ ├── pull │ │ └── pull.cue │ ├── export │ │ └── export.cue │ ├── writefile │ │ ├── writefile.cue │ │ └── writefile_failure_diff_contents.cue │ ├── mkdir │ │ ├── mkdir.cue │ │ └── mkdir_parents.cue │ └── hidden │ │ └── hidden.cue ├── cue.mod │ ├── module.cue │ └── pkg │ │ ├── dagger.io │ │ └── universe.dagger.io ├── plan │ ├── client │ │ ├── commands │ │ │ └── test.txt │ │ ├── filesystem │ │ │ ├── read │ │ │ │ ├── file │ │ │ │ │ ├── secret.txt │ │ │ │ │ ├── test.txt │ │ │ │ │ └── cmd.sh │ │ │ │ └── fs │ │ │ │ │ ├── multiple │ │ │ │ │ ├── 1.md │ │ │ │ │ ├── 11.rst │ │ │ │ │ ├── 2.md │ │ │ │ │ ├── 3.md │ │ │ │ │ └── 33.rst │ │ │ │ │ ├── rootfs │ │ │ │ │ ├── test.log │ │ │ │ │ └── test.txt │ │ │ │ │ ├── not_exists │ │ │ │ │ └── test.cue │ │ │ │ │ ├── dynamic │ │ │ │ │ ├── fail_load.cue │ │ │ │ │ └── fail_path_exists.cue │ │ │ │ │ ├── invalid_fs_type │ │ │ │ │ └── test.cue │ │ │ │ │ ├── invalid_fs_input │ │ │ │ │ └── test.cue │ │ │ │ │ ├── relative │ │ │ │ │ └── test.cue │ │ │ │ │ └── usage │ │ │ │ │ └── test.cue │ │ │ └── write │ │ │ │ └── multiple │ │ │ │ └── test.cue │ │ └── env │ │ │ └── concrete.cue │ ├── do │ │ └── missing_dependencies.cue │ ├── platform │ │ └── platform.cue │ ├── validate │ │ ├── concrete │ │ │ ├── multitype.cue │ │ │ ├── clientenv.cue │ │ │ ├── clientenv_missing.cue │ │ │ ├── clientenv_default.cue │ │ │ ├── struct_or_other.cue │ │ │ ├── yarn.cue │ │ │ ├── docker_image.cue │ │ │ ├── definition.cue │ │ │ ├── reference.cue │ │ │ ├── fs.cue │ │ │ └── task.cue │ │ └── undefined │ │ │ └── undefined.cue │ ├── hello-europa │ │ └── main.cue │ └── with │ │ └── with.cue ├── age_key.txt ├── package.json ├── yarn.lock └── README.md ├── cue.mod ├── pkg │ ├── dagger.io │ ├── universe.dagger.io │ └── .gitattributes └── module.cue ├── pkg ├── dagger.io │ ├── README.md │ ├── cue.mod │ │ └── module.cue │ └── dagger │ │ ├── compat.cue │ │ ├── values.cue │ │ └── core │ │ └── nop.cue └── universe.dagger.io │ ├── alpha │ ├── ansible │ │ ├── test │ │ │ ├── .gitignore │ │ │ ├── inventory │ │ │ │ └── hosts │ │ │ ├── ssh │ │ │ │ ├── id_rsa │ │ │ │ └── id_rsa.pub │ │ │ └── project │ │ │ │ ├── variables │ │ │ │ └── hello.yml │ │ │ │ ├── tasks │ │ │ │ └── init.yml │ │ │ │ └── main.yml │ │ └── args.cue │ ├── go │ │ └── golangci │ │ │ └── test │ │ │ ├── data │ │ │ └── hello │ │ │ │ ├── go.mod │ │ │ │ └── main.go │ │ │ └── lint.cue │ ├── rust │ │ ├── test │ │ │ ├── data │ │ │ │ └── hello │ │ │ │ │ ├── src │ │ │ │ │ └── main.rs │ │ │ │ │ └── Cargo.toml │ │ │ ├── test.bats │ │ │ └── publish.cue │ │ ├── test.cue │ │ ├── container.cue │ │ ├── publish.cue │ │ └── image.cue │ ├── aws │ │ └── cdk │ │ │ └── python │ │ │ ├── diff.cue │ │ │ ├── deploy.cue │ │ │ ├── test │ │ │ └── test.bats │ │ │ ├── cdk.sh │ │ │ └── install.sh │ ├── terraform │ │ ├── fmt.cue │ │ ├── init.cue │ │ ├── test │ │ │ ├── data │ │ │ │ └── resource.tf │ │ │ └── test.bats │ │ ├── validate.cue │ │ ├── workspace.cue │ │ ├── plan.cue │ │ ├── destroy.cue │ │ ├── image.cue │ │ └── apply.cue │ ├── codecov │ │ └── test │ │ │ └── image.cue │ ├── debian │ │ ├── apt │ │ │ └── test │ │ │ │ └── test.bats │ │ └── test │ │ │ └── test.bats │ ├── spectral │ │ ├── test │ │ │ └── test.bats │ │ └── README.md │ ├── lua │ │ └── test │ │ │ ├── test.bats │ │ │ ├── data │ │ │ └── hello │ │ │ │ └── example.lua │ │ │ └── fmtCheck.cue │ ├── dotnet │ │ ├── test │ │ │ ├── data │ │ │ │ ├── Greeting │ │ │ │ │ ├── Greeting.cs │ │ │ │ │ └── Greeting.csproj │ │ │ │ ├── hello │ │ │ │ │ ├── Program.cs │ │ │ │ │ └── hello.csproj │ │ │ │ └── Greeting.Tests │ │ │ │ │ └── Greeting_Should.cs │ │ │ ├── test.bats │ │ │ └── test.cue │ │ ├── test.cue │ │ ├── image.cue │ │ ├── container.cue │ │ └── publish.cue │ ├── kubernetes │ │ ├── kustomize │ │ │ ├── test │ │ │ │ └── testdata │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ ├── pod.yaml │ │ │ │ │ └── deployment.yaml │ │ │ └── image.cue │ │ ├── kapp │ │ │ └── test │ │ │ │ └── kubesrc.yaml │ │ └── helm │ │ │ └── image.cue │ ├── scaleway │ │ └── image.cue │ ├── onepassword │ │ ├── read.sh │ │ └── onepassword.cue │ └── pulumi │ │ └── example.cue │ ├── cue.mod │ ├── pkg │ │ ├── dagger.io │ │ └── .gitignore │ └── module.cue │ ├── .gitignore │ ├── x │ ├── paul@fgtech.fr │ │ └── ansible │ │ │ └── test │ │ │ ├── .gitignore │ │ │ ├── inventory │ │ │ └── hosts │ │ │ ├── ssh │ │ │ ├── id_rsa │ │ │ └── id_rsa.pub │ │ │ └── project │ │ │ ├── variables │ │ │ └── hello.yml │ │ │ ├── tasks │ │ │ └── init.yml │ │ │ └── main.yml │ ├── contact@kjuulh.io │ │ └── rust │ │ │ ├── test │ │ │ ├── data │ │ │ │ └── hello │ │ │ │ │ ├── src │ │ │ │ │ └── main.rs │ │ │ │ │ └── Cargo.toml │ │ │ ├── test.bats │ │ │ └── publish.cue │ │ │ ├── test.cue │ │ │ └── container.cue │ ├── baptiste.barbotin@epitech.eu │ │ └── azure │ │ │ ├── test │ │ │ └── azureServerless │ │ │ │ ├── example.envrc │ │ │ │ └── deploy_function │ │ │ │ ├── package.json │ │ │ │ ├── host.json │ │ │ │ ├── HttpExample │ │ │ │ ├── function.json │ │ │ │ └── index.js │ │ │ │ └── .gitignore │ │ │ ├── azureFuncCoreTool │ │ │ └── README.md │ │ │ └── azure │ │ │ └── resourceGroup │ │ │ └── create.cue │ ├── ezequiel@foncubierta.com │ │ └── terraform │ │ │ ├── test │ │ │ ├── data │ │ │ │ └── resource.tf │ │ │ └── test.bats │ │ │ ├── fmt.cue │ │ │ ├── init.cue │ │ │ ├── validate.cue │ │ │ ├── workspace.cue │ │ │ ├── plan.cue │ │ │ ├── destroy.cue │ │ │ ├── image.cue │ │ │ └── apply.cue │ ├── cpuguy83@gmail.com │ │ └── apt │ │ │ └── test │ │ │ └── test.bats │ ├── solomon@dagger.io │ │ ├── spectral │ │ │ ├── test │ │ │ │ └── test.bats │ │ │ └── README.md │ │ └── yarn │ │ │ └── test │ │ │ └── data │ │ │ ├── bar │ │ │ └── package.json │ │ │ └── foo │ │ │ └── package.json │ ├── latoz@protonmail.com │ │ └── debian │ │ │ └── test │ │ │ └── test.bats │ ├── olli.janatuinen@gmail.com │ │ └── dotnet │ │ │ ├── test │ │ │ ├── data │ │ │ │ ├── Greeting │ │ │ │ │ ├── Greeting.cs │ │ │ │ │ └── Greeting.csproj │ │ │ │ ├── hello │ │ │ │ │ ├── Program.cs │ │ │ │ │ └── hello.csproj │ │ │ │ └── Greeting.Tests │ │ │ │ │ └── Greeting_Should.cs │ │ │ ├── test.bats │ │ │ └── test.cue │ │ │ ├── test.cue │ │ │ ├── image.cue │ │ │ ├── container.cue │ │ │ └── publish.cue │ ├── teddylear@protonmail.com │ │ └── lua │ │ │ └── test │ │ │ ├── data │ │ │ └── hello │ │ │ │ └── example.lua │ │ │ ├── test.bats │ │ │ └── fmtCheck.cue │ ├── carvel.dev │ │ └── kapp │ │ │ └── test │ │ │ └── kubesrc.yaml │ ├── wangwei27494731@gmail.com │ │ └── kustomize │ │ │ └── test │ │ │ └── testdata │ │ │ ├── kustomization.yaml │ │ │ ├── pod.yaml │ │ │ └── deployment.yaml │ ├── tom.chauveau.pro@icloud.com │ │ └── kubernetes │ │ │ ├── test │ │ │ └── data │ │ │ │ ├── hello-pod │ │ │ │ └── hello.yaml │ │ │ │ └── hello-kustomize │ │ │ │ ├── kustomization.yaml │ │ │ │ ├── service.yaml │ │ │ │ └── deployment.yaml │ │ │ ├── apply.cue │ │ │ ├── delete.cue │ │ │ └── kubectl.cue │ ├── vgjm456@qq.com │ │ └── helm │ │ │ └── image.cue │ └── berryphillips@gmail.com │ │ └── onepassword │ │ └── read.sh │ ├── examples │ └── .gitattributes │ ├── docker │ ├── test │ │ ├── testdata │ │ │ ├── go.mod │ │ │ ├── main.go │ │ │ └── Dockerfile │ │ └── test.bats │ ├── cli │ │ └── test │ │ │ └── test.bats │ ├── set.cue │ └── push.cue │ ├── bash │ └── test │ │ ├── data │ │ └── hello.sh │ │ └── test.bats │ ├── go │ ├── test │ │ ├── data │ │ │ └── hello │ │ │ │ ├── go.mod │ │ │ │ ├── greeting │ │ │ │ ├── greeting.go │ │ │ │ └── greeting_test.go │ │ │ │ └── main.go │ │ ├── test.cue │ │ ├── test.bats │ │ └── container.cue │ └── test.cue │ ├── powershell │ └── test │ │ ├── data │ │ └── hello.ps1 │ │ └── test.bats │ ├── python │ ├── test │ │ ├── data │ │ │ └── helloworld.py │ │ └── test.bats │ └── image.cue │ ├── git │ └── git.cue │ ├── aws │ ├── test │ │ ├── config │ │ ├── test.bats │ │ └── default_version.cue │ ├── cli │ │ └── test │ │ │ └── test.bats │ └── _scripts │ │ └── install.sh │ ├── yarn │ └── test │ │ ├── test.bats │ │ └── data │ │ ├── bar │ │ └── package.json │ │ └── foo │ │ └── package.json │ ├── alpine │ └── test │ │ └── test.bats │ ├── netlify │ └── test │ │ ├── test.bats │ │ └── testutils │ │ └── testutils.cue │ ├── age_key.txt │ └── package.json ├── infra └── .do.dagger-ci-pr1499-2022-01-26.age ├── mod ├── test-ssh-keys │ ├── id_ed25519_test.pub │ └── id_ed25519_test ├── version.go └── checksum.go ├── .devcontainer └── post-install.sh ├── cmd └── dagger │ ├── main.go │ └── cmd │ └── project │ ├── templates │ └── hello.cue │ └── projectroot.go ├── .vscode └── settings.json ├── telemetry ├── event │ ├── event_test.go │ └── log.go ├── context.go └── telemetry_test.go ├── plancontext ├── context_test.go ├── platform.go └── localdir.go ├── version └── version_test.go ├── solver ├── socketprovider_unix.go └── socketprovider_windows.go ├── .github ├── workflows │ ├── add-issues-to-backlog.yml │ └── deploy-docs.yml └── dependabot.yml ├── Dockerfile ├── .markdownlint.yaml ├── tracing.compose.yaml ├── plan └── task │ ├── nop.go │ └── clientplatform.go ├── NOTICE ├── .gitpod.Dockerfile ├── ci ├── markdownlint │ └── markdownlint.cue ├── golangci │ └── lint.cue └── shellcheck │ └── shellcheck.cue ├── analytics └── git_test.go └── .golangci.yml /doc.go: -------------------------------------------------------------------------------- 1 | package dagger 2 | -------------------------------------------------------------------------------- /website/static/.nojekyll: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/reference/README.md: -------------------------------------------------------------------------------- 1 | # Index 2 | -------------------------------------------------------------------------------- /tests/tasks/exec/secret.txt: -------------------------------------------------------------------------------- 1 | hello world -------------------------------------------------------------------------------- /tests/tasks/source/hello.txt: -------------------------------------------------------------------------------- 1 | hello 2 | -------------------------------------------------------------------------------- /tests/tasks/source/world.txt: -------------------------------------------------------------------------------- 1 | world 2 | -------------------------------------------------------------------------------- /cue.mod/pkg/dagger.io: -------------------------------------------------------------------------------- 1 | ../../pkg/dagger.io -------------------------------------------------------------------------------- /tests/cue.mod/module.cue: -------------------------------------------------------------------------------- 1 | module: "" 2 | -------------------------------------------------------------------------------- /tests/plan/client/commands/test.txt: -------------------------------------------------------------------------------- 1 | test -------------------------------------------------------------------------------- /tests/tasks/dockerfile/testdata/foo: -------------------------------------------------------------------------------- 1 | foobar 2 | -------------------------------------------------------------------------------- /tests/tasks/source/testdata/world.txt: -------------------------------------------------------------------------------- 1 | world 2 | -------------------------------------------------------------------------------- /docs/learn/tests/cue.mod/module.cue: -------------------------------------------------------------------------------- 1 | module: "" 2 | -------------------------------------------------------------------------------- /pkg/dagger.io/README.md: -------------------------------------------------------------------------------- 1 | ../../docs/learn/1213-api.md -------------------------------------------------------------------------------- /tests/cue.mod/pkg/dagger.io: -------------------------------------------------------------------------------- 1 | ../../../pkg/dagger.io -------------------------------------------------------------------------------- /tests/plan/client/filesystem/read/file/secret.txt: -------------------------------------------------------------------------------- 1 | bar -------------------------------------------------------------------------------- /tests/plan/client/filesystem/read/file/test.txt: -------------------------------------------------------------------------------- 1 | foo -------------------------------------------------------------------------------- /tests/plan/client/filesystem/read/fs/multiple/1.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/plan/client/filesystem/read/fs/multiple/11.rst: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/plan/client/filesystem/read/fs/multiple/2.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/plan/client/filesystem/read/fs/multiple/3.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/plan/client/filesystem/read/fs/multiple/33.rst: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cue.mod/module.cue: -------------------------------------------------------------------------------- 1 | module: "github.com/dagger/dagger" 2 | -------------------------------------------------------------------------------- /cue.mod/pkg/universe.dagger.io: -------------------------------------------------------------------------------- 1 | ../../pkg/universe.dagger.io -------------------------------------------------------------------------------- /pkg/dagger.io/cue.mod/module.cue: -------------------------------------------------------------------------------- 1 | module: "dagger.io" 2 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/ansible/test/.gitignore: -------------------------------------------------------------------------------- 1 | output -------------------------------------------------------------------------------- /docs/learn/tests/cue.mod/pkg/.gitignore: -------------------------------------------------------------------------------- 1 | # dagger universe 2 | -------------------------------------------------------------------------------- /docs/tests/guides/container-images/simple/src/requirements.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/cue.mod/pkg/dagger.io: -------------------------------------------------------------------------------- 1 | ../../../dagger.io -------------------------------------------------------------------------------- /pkg/universe.dagger.io/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | report.xml 3 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/ansible/test/inventory/hosts: -------------------------------------------------------------------------------- 1 | 127.0.0.1 -------------------------------------------------------------------------------- /tests/cue.mod/pkg/universe.dagger.io: -------------------------------------------------------------------------------- 1 | ../../../pkg/universe.dagger.io -------------------------------------------------------------------------------- /tests/plan/client/filesystem/read/fs/rootfs/test.log: -------------------------------------------------------------------------------- 1 | excluded 2 | -------------------------------------------------------------------------------- /tests/plan/client/filesystem/read/fs/rootfs/test.txt: -------------------------------------------------------------------------------- 1 | local directory -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/ansible/test/ssh/id_rsa: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/ansible/test/ssh/id_rsa.pub: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/paul@fgtech.fr/ansible/test/.gitignore: -------------------------------------------------------------------------------- 1 | output -------------------------------------------------------------------------------- /tests/plan/client/filesystem/read/file/cmd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | env 4 | -------------------------------------------------------------------------------- /docs/tests/guides/container-images/simple/src/app.py: -------------------------------------------------------------------------------- 1 | print("Hello world!") 2 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/cue.mod/module.cue: -------------------------------------------------------------------------------- 1 | module: "universe.dagger.io" 2 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/examples/.gitattributes: -------------------------------------------------------------------------------- 1 | ** linguist-vendored=true 2 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/paul@fgtech.fr/ansible/test/inventory/hosts: -------------------------------------------------------------------------------- 1 | 127.0.0.1 -------------------------------------------------------------------------------- /tests/tasks/source/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | printf "hello world" > /test.txt -------------------------------------------------------------------------------- /cue.mod/pkg/.gitattributes: -------------------------------------------------------------------------------- 1 | # generated by dagger 2 | ** linguist-generated=true 3 | -------------------------------------------------------------------------------- /docs/learn/tests/.dagger/env/gcpcloudrun/.gitignore: -------------------------------------------------------------------------------- 1 | # dagger state 2 | state/** 3 | -------------------------------------------------------------------------------- /docs/learn/tests/.dagger/env/multibucket/.gitignore: -------------------------------------------------------------------------------- 1 | # dagger state 2 | state/** 3 | -------------------------------------------------------------------------------- /docs/plans/go-ci/hello/go.mod: -------------------------------------------------------------------------------- 1 | module dagger.io/testgreetci 2 | 3 | go 1.17 4 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/paul@fgtech.fr/ansible/test/ssh/id_rsa: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/cypress/e2e/docs.cy.js: -------------------------------------------------------------------------------- 1 | describe("Visit Docs website", function () {}); 2 | -------------------------------------------------------------------------------- /docs/learn/tests/.dagger/env/cloudformation/.gitignore: -------------------------------------------------------------------------------- 1 | # dagger state 2 | state/** 3 | -------------------------------------------------------------------------------- /docs/learn/tests/.dagger/env/kube-aws-basic/.gitignore: -------------------------------------------------------------------------------- 1 | # dagger state 2 | state/** 3 | -------------------------------------------------------------------------------- /docs/learn/tests/.dagger/env/kube-gcp-basic/.gitignore: -------------------------------------------------------------------------------- 1 | # dagger state 2 | state/** 3 | -------------------------------------------------------------------------------- /docs/learn/tests/.dagger/env/kube-kind-basic/.gitignore: -------------------------------------------------------------------------------- 1 | # dagger state 2 | state/** 3 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/docker/test/testdata/go.mod: -------------------------------------------------------------------------------- 1 | module test.com 2 | 3 | go 1.17 4 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/paul@fgtech.fr/ansible/test/ssh/id_rsa.pub: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/learn/tests/.dagger/env/kube-aws-cue-manifest/.gitignore: -------------------------------------------------------------------------------- 1 | # dagger state 2 | state/** 3 | -------------------------------------------------------------------------------- /docs/learn/tests/.dagger/env/kube-aws-deployment/.gitignore: -------------------------------------------------------------------------------- 1 | # dagger state 2 | state/** 3 | -------------------------------------------------------------------------------- /docs/learn/tests/.dagger/env/kube-gcp-cue-manifest/.gitignore: -------------------------------------------------------------------------------- 1 | # dagger state 2 | state/** 3 | -------------------------------------------------------------------------------- /docs/learn/tests/.dagger/env/kube-gcp-deployment/.gitignore: -------------------------------------------------------------------------------- 1 | # dagger state 2 | state/** 3 | -------------------------------------------------------------------------------- /docs/learn/tests/.dagger/env/kube-kind-deployment/.gitignore: -------------------------------------------------------------------------------- 1 | # dagger state 2 | state/** 3 | -------------------------------------------------------------------------------- /docs/learn/tests/.dagger/env/kube-kind-cue-manifest/.gitignore: -------------------------------------------------------------------------------- 1 | # dagger state 2 | state/** 3 | -------------------------------------------------------------------------------- /docs/tests/guides/persistent-cache/go.mod: -------------------------------------------------------------------------------- 1 | module dagger.io/persistentcache 2 | 3 | go 1.17 4 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/ansible/test/project/variables/hello.yml: -------------------------------------------------------------------------------- 1 | 2 | person1: Ansible 3 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/go/golangci/test/data/hello/go.mod: -------------------------------------------------------------------------------- 1 | module test 2 | 3 | go 1.18 4 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/bash/test/data/hello.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo Hello, world > /out.txt 4 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/go/test/data/hello/go.mod: -------------------------------------------------------------------------------- 1 | module dagger.io/testgreet 2 | 3 | go 1.17 4 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/powershell/test/data/hello.ps1: -------------------------------------------------------------------------------- 1 | Set-Content -Value "Hello world!" -Path "/out.txt" -------------------------------------------------------------------------------- /docs/tests/guides/container-images/multi-stage/src/go.mod: -------------------------------------------------------------------------------- 1 | module dagger.io/testmulti 2 | 3 | go 1.17 4 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/paul@fgtech.fr/ansible/test/project/variables/hello.yml: -------------------------------------------------------------------------------- 1 | 2 | person1: Ansible 3 | -------------------------------------------------------------------------------- /website/static/img/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraces/dagger/main/website/static/img/favicon.png -------------------------------------------------------------------------------- /pkg/dagger.io/dagger/compat.cue: -------------------------------------------------------------------------------- 1 | package dagger 2 | 3 | // DEPRECATED: Use #Socket instead 4 | #Service: #Socket 5 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/rust/test/data/hello/src/main.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | println!("Hello, world!"); 3 | } 4 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/python/test/data/helloworld.py: -------------------------------------------------------------------------------- 1 | with open('out.txt', 'w') as f: 2 | f.write("Hello, world\n") -------------------------------------------------------------------------------- /website/cypress/videos/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything in this directory 2 | * 3 | # Except this file 4 | !.gitignore -------------------------------------------------------------------------------- /website/static/img/dagger-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraces/dagger/main/website/static/img/dagger-logo.png -------------------------------------------------------------------------------- /website/cypress/screenshots/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything in this directory 2 | * 3 | # Except this file 4 | !.gitignore -------------------------------------------------------------------------------- /website/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [require.resolve('@docusaurus/core/lib/babel/preset')], 3 | }; 4 | -------------------------------------------------------------------------------- /website/static/img/dagger-logo-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraces/dagger/main/website/static/img/dagger-logo-dark.png -------------------------------------------------------------------------------- /website/static/img/what-is-dagger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraces/dagger/main/website/static/img/what-is-dagger.png -------------------------------------------------------------------------------- /infra/.do.dagger-ci-pr1499-2022-01-26.age: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraces/dagger/main/infra/.do.dagger-ci-pr1499-2022-01-26.age -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/contact@kjuulh.io/rust/test/data/hello/src/main.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | println!("Hello, world!"); 3 | } 4 | -------------------------------------------------------------------------------- /website/static/img/dagger-astronaute.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraces/dagger/main/website/static/img/dagger-astronaute.png -------------------------------------------------------------------------------- /website/static/img/dagger-cloud/runs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraces/dagger/main/website/static/img/dagger-cloud/runs.png -------------------------------------------------------------------------------- /docs/core-concepts/1207-caching.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: /1207/caching 3 | displayed_sidebar: '0.2' 4 | --- 5 | 6 | # Make your builds fast 7 | -------------------------------------------------------------------------------- /docs/tests/use-cases/ci-cd-for-go-project/build.cue.fragment: -------------------------------------------------------------------------------- 1 | // Build go project 2 | build: go.#Build & { 3 | source: _code 4 | } 5 | -------------------------------------------------------------------------------- /website/static/img/use-cases/client-api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraces/dagger/main/website/static/img/use-cases/client-api.png -------------------------------------------------------------------------------- /docs/core-concepts/1206-packages.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: /1206/packages 3 | displayed_sidebar: '0.2' 4 | --- 5 | 6 | # Create your own package 7 | -------------------------------------------------------------------------------- /pkg/dagger.io/dagger/values.cue: -------------------------------------------------------------------------------- 1 | package dagger 2 | 3 | // An empty filesystem tree 4 | #Scratch: #FS & { 5 | $dagger: fs: _id: null 6 | } 7 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/cue.mod/pkg/.gitignore: -------------------------------------------------------------------------------- 1 | # generated by dagger 2 | dagger.lock 3 | alpha.dagger.io 4 | dagger.io 5 | universe.dagger.io -------------------------------------------------------------------------------- /website/static/img/dagger-cloud/share-url.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraces/dagger/main/website/static/img/dagger-cloud/share-url.png -------------------------------------------------------------------------------- /website/static/img/use-cases/build-action.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraces/dagger/main/website/static/img/use-cases/build-action.png -------------------------------------------------------------------------------- /docs/learn/tests/cloudformation/template/convert.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "encoding/json" 4 | 5 | s3Template: json.Unmarshal(template) 6 | -------------------------------------------------------------------------------- /docs/tests/guides/persistent-cache/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func main() { 6 | fmt.Println("Hello Dagger!") 7 | } 8 | -------------------------------------------------------------------------------- /website/static/img/use-cases/particubes.com.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraces/dagger/main/website/static/img/use-cases/particubes.com.png -------------------------------------------------------------------------------- /mod/test-ssh-keys/id_ed25519_test.pub: -------------------------------------------------------------------------------- 1 | ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKkayTxYvHuBcJdfWa4aEqOWSpqrKQXVfX3xZAyQE7an tihomir.jovicic@toptal.com 2 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/docker/test/testdata/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func main() { 6 | fmt.Printf("hello world") 7 | } 8 | -------------------------------------------------------------------------------- /website/cypress/fixtures/bad_credential.json: -------------------------------------------------------------------------------- 1 | { 2 | "message": "Bad credentials", 3 | "documentation_url": "https://docs.github.com/rest" 4 | } 5 | -------------------------------------------------------------------------------- /website/static/img/Dagger_Website_Space_Uranus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraces/dagger/main/website/static/img/Dagger_Website_Space_Uranus.png -------------------------------------------------------------------------------- /website/static/img/use-cases/particubes-actions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraces/dagger/main/website/static/img/use-cases/particubes-actions.png -------------------------------------------------------------------------------- /.devcontainer/post-install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -exo pipefail 4 | 5 | make install 6 | go install -mod=readonly cuelang.org/go/cmd/cue 7 | -------------------------------------------------------------------------------- /docs/tests/guides/container-images/multi-stage/src/app.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func main() { 6 | fmt.Println("Hello, 世界") 7 | } 8 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/git/git.cue: -------------------------------------------------------------------------------- 1 | package git 2 | 3 | import ( 4 | "dagger.io/dagger/core" 5 | ) 6 | 7 | #Pull: core.#GitPull 8 | #Push: core.#GitPush 9 | -------------------------------------------------------------------------------- /website/static/img/getting-started/todoapp.linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraces/dagger/main/website/static/img/getting-started/todoapp.linux.png -------------------------------------------------------------------------------- /website/static/img/getting-started/todoapp.macos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraces/dagger/main/website/static/img/getting-started/todoapp.macos.png -------------------------------------------------------------------------------- /cmd/dagger/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "go.dagger.io/dagger/cmd/dagger/cmd" 5 | ) 6 | 7 | func main() { 8 | cmd.Execute() 9 | } 10 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/baptiste.barbotin@epitech.eu/azure/test/azureServerless/example.envrc: -------------------------------------------------------------------------------- 1 | # Enter your azure subscription id 2 | export AZ_SUB_ID_TOKEN="" -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/go/golangci/test/data/hello/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func main() { 6 | fmt.Println("Hello World!") 7 | } 8 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/aws/test/config: -------------------------------------------------------------------------------- 1 | [profile ci] 2 | credential_source = Environment 3 | region = us-east-2 4 | role_arn = arn:aws:iam::125635003186:role/dagger-ci -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/aws/cdk/python/diff.cue: -------------------------------------------------------------------------------- 1 | package python 2 | 3 | // Get infra diff with cdk ('cdk diff') 4 | #Diff: #Command & { 5 | args: ["diff"] 6 | } 7 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/rust/test.cue: -------------------------------------------------------------------------------- 1 | package rust 2 | 3 | // Test a rust package 4 | #Test: { 5 | #Container & { 6 | command: flags: test: true 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/terraform/fmt.cue: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | // Run `terraform fmt` 4 | #Fmt: #Run & { 5 | // Terraform `fmt` command 6 | cmd: "fmt" 7 | } 8 | -------------------------------------------------------------------------------- /docs/plans/go-ci/hello/greeting/greeting.go: -------------------------------------------------------------------------------- 1 | package greeting 2 | 3 | import "fmt" 4 | 5 | func Greeting(name string) string { 6 | return fmt.Sprintf("Hi %s!", name) 7 | } 8 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/aws/cdk/python/deploy.cue: -------------------------------------------------------------------------------- 1 | package python 2 | 3 | // Deploy infra with cdk ('cdk deploy') 4 | #Deploy: #Command & { 5 | args: ["deploy"] 6 | } 7 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/terraform/init.cue: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | // Run `terraform init` 4 | #Init: #Run & { 5 | // Terraform `init` command 6 | cmd: "init" 7 | } 8 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/terraform/test/data/resource.tf: -------------------------------------------------------------------------------- 1 | resource "local_file" "test" { 2 | content = "Hello, world!" 3 | filename = "${path.module}/out.txt" 4 | } -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.formatOnSave": true, 3 | "extensions.ignoreRecommendations": true, 4 | "[cue]": { 5 | "editor.useTabStops": true 6 | } 7 | } -------------------------------------------------------------------------------- /docs/use-cases/1212-svelte-vercel.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: /1212/svelte-vercel 3 | displayed_sidebar: '0.2' 4 | --- 5 | 6 | # Svelte on Vercel 7 | 8 | [rawkode.dev](https://rawkode.dev) 9 | -------------------------------------------------------------------------------- /tests/plan/do/missing_dependencies.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/daggggger" // intentionally misspelled to force error message 5 | ) 6 | 7 | dagger.#Plan 8 | -------------------------------------------------------------------------------- /docs/tests/use-cases/ci-cd-for-go-project/test.cue.fragment: -------------------------------------------------------------------------------- 1 | // Run go unit tests 2 | unitTest: go.#Test & { 3 | source: _code 4 | package: "./..." 5 | input: _base.output 6 | } 7 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/yarn/test/test.bats: -------------------------------------------------------------------------------- 1 | setup() { 2 | load '../../bats_helpers' 3 | 4 | common_setup 5 | } 6 | 7 | @test "yarn" { 8 | dagger "do" test 9 | } 10 | -------------------------------------------------------------------------------- /website/src/theme/DocCard/index.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import type { Props } from '@theme/DocCard'; 3 | export default function DocCard({ item }: Props): JSX.Element; 4 | -------------------------------------------------------------------------------- /docs/learn/tests/cloudformation/source-begin.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "alpha.dagger.io/aws" 5 | ) 6 | 7 | // AWS account: credentials and region 8 | awsConfig: aws.#Config 9 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/codecov/test/image.cue: -------------------------------------------------------------------------------- 1 | package codecov 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | ) 6 | 7 | dagger.#Plan & { 8 | actions: test: #Image & {} 9 | } 10 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpine/test/test.bats: -------------------------------------------------------------------------------- 1 | setup() { 2 | load '../../bats_helpers' 3 | 4 | common_setup 5 | } 6 | @test "alpine" { 7 | dagger "do" -p ./test.cue test 8 | } 9 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/netlify/test/test.bats: -------------------------------------------------------------------------------- 1 | setup() { 2 | load '../../bats_helpers' 3 | 4 | common_setup 5 | } 6 | 7 | @test "netlify" { 8 | dagger "do" test 9 | } 10 | -------------------------------------------------------------------------------- /tests/tasks/dockerfile/testdata/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d 2 | COPY . /dir 3 | RUN test $(cat /dir/foo) = foobar 4 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/terraform/validate.cue: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | // Run `terraform validate` 4 | #Validate: #Run & { 5 | // Terraform `validate` command 6 | cmd: "validate" 7 | } 8 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/go/test/data/hello/greeting/greeting.go: -------------------------------------------------------------------------------- 1 | package greeting 2 | 3 | import "fmt" 4 | 5 | func Greeting(name string) string { 6 | return fmt.Sprintf("Hi %s!", name) 7 | } 8 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/ezequiel@foncubierta.com/terraform/test/data/resource.tf: -------------------------------------------------------------------------------- 1 | resource "local_file" "test" { 2 | content = "Hello, world!" 3 | filename = "${path.module}/out.txt" 4 | } -------------------------------------------------------------------------------- /tests/tasks/dockerfile/testdata/dockerfilepath/Dockerfile.custom: -------------------------------------------------------------------------------- 1 | FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d 2 | RUN echo dockerfilePath > /test 3 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/debian/apt/test/test.bats: -------------------------------------------------------------------------------- 1 | setup() { 2 | load '../../../../bats_helpers' 3 | 4 | common_setup 5 | } 6 | @test "apt" { 7 | dagger "do" -p ./test.cue test 8 | } 9 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/spectral/test/test.bats: -------------------------------------------------------------------------------- 1 | setup() { 2 | load '../../../bats_helpers' 3 | 4 | common_setup 5 | } 6 | 7 | @test "yarn" { 8 | dagger "do" test 9 | } 10 | -------------------------------------------------------------------------------- /docs/use-cases/1209-docusaurus-netlify.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: /1209/docusaurus-netlify 3 | displayed_sidebar: '0.2' 4 | --- 5 | 6 | # Docusaurus on Netlify 7 | 8 | [docs.dagger.io](https://docs.dagger.io) 9 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/ansible/test/project/tasks/init.yml: -------------------------------------------------------------------------------- 1 | 2 | - name: Install dependencies 3 | apk: 4 | update_cache: yes 5 | state: latest 6 | name: 7 | - git 8 | - gcc -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/terraform/test/test.bats: -------------------------------------------------------------------------------- 1 | setup() { 2 | load '../../../bats_helpers' 3 | 4 | common_setup 5 | } 6 | 7 | @test "terraform" { 8 | dagger "do" test 9 | } 10 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/bash/test/test.bats: -------------------------------------------------------------------------------- 1 | setup() { 2 | load '../../bats_helpers' 3 | 4 | common_setup 5 | } 6 | 7 | @test "bash" { 8 | dagger "do" -p ./test.cue test 9 | } 10 | 11 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/python/test/test.bats: -------------------------------------------------------------------------------- 1 | setup() { 2 | load '../../bats_helpers' 3 | 4 | common_setup 5 | } 6 | 7 | @test "python" { 8 | dagger "do" -p ./test.cue test 9 | } 10 | -------------------------------------------------------------------------------- /docs/learn/tests/multibucket/source.cue: -------------------------------------------------------------------------------- 1 | package multibucket 2 | 3 | import ( 4 | "alpha.dagger.io/dagger" 5 | ) 6 | 7 | // Source code of the sample application 8 | src: dagger.#Artifact & dagger.#Input 9 | -------------------------------------------------------------------------------- /docs/use-cases/1208-phoenix-kubernetes.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: /1208/phoenix-kubernetes 3 | displayed_sidebar: '0.2' 4 | --- 5 | 6 | # Elixir/Phoenix on Kubernetes 7 | 8 | [changelog.com](https://changelog.com) 9 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/lua/test/test.bats: -------------------------------------------------------------------------------- 1 | setup() { 2 | load '../../../bats_helpers' 3 | 4 | common_setup 5 | } 6 | 7 | @test "lua" { 8 | dagger "do" -p ./fmtCheck.cue test 9 | } 10 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/cpuguy83@gmail.com/apt/test/test.bats: -------------------------------------------------------------------------------- 1 | setup() { 2 | load '../../../../bats_helpers' 3 | 4 | common_setup 5 | } 6 | @test "apt" { 7 | dagger "do" -p ./test.cue test 8 | } 9 | -------------------------------------------------------------------------------- /tests/tasks/gitpull/invalid.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | dagger.#Plan & { 9 | actions: invalid: core.#GitPull & {} 10 | } 11 | -------------------------------------------------------------------------------- /website/src/theme/DocCardList/index.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import type { Props } from '@theme/DocCardList'; 3 | export default function DocCardList({ items, className }: Props): JSX.Element; 4 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/debian/test/test.bats: -------------------------------------------------------------------------------- 1 | setup() { 2 | load '../../../bats_helpers' 3 | 4 | common_setup 5 | } 6 | 7 | @test "debian" { 8 | dagger "do" -p ./test.cue test 9 | } 10 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/dotnet/test/data/Greeting/Greeting.cs: -------------------------------------------------------------------------------- 1 | public class Greeting 2 | { 3 | public static string GetMessage(string name) { 4 | return String.Format("Hi {0}!", name); 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/lua/test/data/hello/example.lua: -------------------------------------------------------------------------------- 1 | local function hello(offset) 2 | local foo = {} 3 | for i = 1, 10 do 4 | table.insert(foo, i + offset) 5 | end 6 | return another_thing 7 | end 8 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/paul@fgtech.fr/ansible/test/project/tasks/init.yml: -------------------------------------------------------------------------------- 1 | 2 | - name: Install dependencies 3 | apk: 4 | update_cache: yes 5 | state: latest 6 | name: 7 | - git 8 | - gcc -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/solomon@dagger.io/spectral/test/test.bats: -------------------------------------------------------------------------------- 1 | setup() { 2 | load '../../../../bats_helpers' 3 | 4 | common_setup 5 | } 6 | 7 | @test "yarn" { 8 | dagger "do" test 9 | } 10 | -------------------------------------------------------------------------------- /docs/learn/tests/multibucket/yarn.cue: -------------------------------------------------------------------------------- 1 | package multibucket 2 | 3 | import ( 4 | "alpha.dagger.io/js/yarn" 5 | ) 6 | 7 | // Build the source code using Yarn 8 | app: yarn.#Package & { 9 | source: src 10 | } 11 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/powershell/test/test.bats: -------------------------------------------------------------------------------- 1 | setup() { 2 | load '../../bats_helpers' 3 | 4 | common_setup 5 | } 6 | 7 | @test "powershell" { 8 | dagger "do" -p ./test.cue test 9 | } 10 | 11 | -------------------------------------------------------------------------------- /docs/learn/tests/multibucket/netlify.cue: -------------------------------------------------------------------------------- 1 | package multibucket 2 | 3 | import ( 4 | "alpha.dagger.io/netlify" 5 | ) 6 | 7 | // Netlify site 8 | site: "netlify": netlify.#Site & { 9 | contents: app.build 10 | } 11 | -------------------------------------------------------------------------------- /docs/learn/tests/kube-kind/config.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "alpha.dagger.io/dagger" 5 | ) 6 | 7 | // set with `dagger input text kubeconfig -f "$HOME"/.kube/config -e kube` 8 | kubeconfig: string & dagger.#Input 9 | -------------------------------------------------------------------------------- /docs/use-cases/1210-go-goreleaser.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: /1210/go-goreleaser 3 | displayed_sidebar: '0.2' 4 | --- 5 | 6 | # Go with GoReleaser 7 | 8 | [github.com/dagger/dagger/releases](https://github.com/dagger/dagger/releases) 9 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/ezequiel@foncubierta.com/terraform/test/test.bats: -------------------------------------------------------------------------------- 1 | setup() { 2 | load '../../../../bats_helpers' 3 | 4 | common_setup 5 | } 6 | 7 | @test "terraform" { 8 | dagger "do" test 9 | } 10 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/latoz@protonmail.com/debian/test/test.bats: -------------------------------------------------------------------------------- 1 | setup() { 2 | load '../../../../bats_helpers' 3 | 4 | common_setup 5 | } 6 | 7 | @test "debian" { 8 | dagger "do" -p ./test.cue test 9 | } 10 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/olli.janatuinen@gmail.com/dotnet/test/data/Greeting/Greeting.cs: -------------------------------------------------------------------------------- 1 | public class Greeting 2 | { 3 | public static string GetMessage(string name) { 4 | return String.Format("Hi {0}!", name); 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/teddylear@protonmail.com/lua/test/data/hello/example.lua: -------------------------------------------------------------------------------- 1 | local function hello(offset) 2 | local foo = {} 3 | for i = 1, 10 do 4 | table.insert(foo, i + offset) 5 | end 6 | return another_thing 7 | end 8 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/teddylear@protonmail.com/lua/test/test.bats: -------------------------------------------------------------------------------- 1 | setup() { 2 | load '../../../../bats_helpers' 3 | 4 | common_setup 5 | } 6 | 7 | @test "lua" { 8 | dagger "do" -p ./fmtCheck.cue test 9 | } 10 | -------------------------------------------------------------------------------- /docs/tests/use-cases/node-ci/build.cue.fragment: -------------------------------------------------------------------------------- 1 | build: { 2 | bash.#Run & { 3 | workdir: "./src" 4 | input: deps.node.output 5 | script: contents: #""" 6 | npm ci 7 | """# 8 | } 9 | } -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/aws/cdk/python/test/test.bats: -------------------------------------------------------------------------------- 1 | setup() { 2 | load '../../../../../bats_helpers' 3 | 4 | common_setup 5 | } 6 | 7 | @test "cdk python image" { 8 | dagger "do" -p ./image.cue test 9 | } 10 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/aws/cli/test/test.bats: -------------------------------------------------------------------------------- 1 | setup() { 2 | load '../../../bats_helpers' 3 | 4 | common_setup 5 | } 6 | 7 | @test "aws/cli" { 8 | dagger "do" -p ./sts_get_caller_identity.cue getCallerIdentity 9 | } 10 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/aws/cdk/python/cdk.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euxo pipefail 3 | 4 | # shellcheck disable=SC1091 5 | source venv/bin/activate 6 | ./node_modules/.bin/cdk "$@" --require-approval never --no-color 2>&1 |tee /logs 7 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/kubernetes/kustomize/test/testdata/kustomization.yaml: -------------------------------------------------------------------------------- 1 | resources: 2 | - deployment.yaml 3 | - pod.yaml 4 | images: 5 | - name: "nginx" 6 | newTag: "v1" 7 | replicas: 8 | - name: "nginx-deployment" 9 | count: 2 -------------------------------------------------------------------------------- /website/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "arrowParens": "always", 3 | "bracketSpacing": false, 4 | "jsxBracketSameLine": true, 5 | "printWidth": 80, 6 | "proseWrap": "never", 7 | "singleQuote": false, 8 | "trailingComma": "all" 9 | } 10 | -------------------------------------------------------------------------------- /tests/plan/platform/platform.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | dagger.#Plan & { 9 | actions: test: image: core.#Pull & { 10 | source: "alpine:3.15.0" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/docker/cli/test/test.bats: -------------------------------------------------------------------------------- 1 | setup() { 2 | load '../../../bats_helpers' 3 | 4 | common_setup 5 | } 6 | 7 | @test "docker/cli" { 8 | dagger "do" -p ./run.cue test 9 | dagger "do" -p ./load.cue test 10 | } 11 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/carvel.dev/kapp/test/kubesrc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: "v1" 2 | kind: "Pod" 3 | metadata: 4 | name: "kapp-test" 5 | spec: 6 | restartPolicy: "Never" 7 | containers: 8 | - name: "test" 9 | image: "hello-world" -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/contact@kjuulh.io/rust/test.cue: -------------------------------------------------------------------------------- 1 | //Deprecated: in favor of universe.dagger.io/alpha package 2 | package rust 3 | 4 | // Test a rust package 5 | #Test: { 6 | #Container & { 7 | command: flags: test: true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/ezequiel@foncubierta.com/terraform/fmt.cue: -------------------------------------------------------------------------------- 1 | //Deprecated: in favor of universe.dagger.io/alpha package 2 | package terraform 3 | 4 | // Run `terraform fmt` 5 | #Fmt: #Run & { 6 | // Terraform `fmt` command 7 | cmd: "fmt" 8 | } 9 | -------------------------------------------------------------------------------- /tests/plan/client/filesystem/read/fs/not_exists/test.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | ) 6 | 7 | dagger.#Plan & { 8 | client: filesystem: "/foobar": read: contents: dagger.#FS 9 | actions: test: { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/kubernetes/kapp/test/kubesrc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: "v1" 2 | kind: "Pod" 3 | metadata: 4 | name: "kapp-test" 5 | spec: 6 | restartPolicy: "Never" 7 | containers: 8 | - name: "test" 9 | image: "hello-world" -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/ezequiel@foncubierta.com/terraform/init.cue: -------------------------------------------------------------------------------- 1 | //Deprecated: in favor of universe.dagger.io/alpha package 2 | package terraform 3 | 4 | // Run `terraform init` 5 | #Init: #Run & { 6 | // Terraform `init` command 7 | cmd: "init" 8 | } 9 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/wangwei27494731@gmail.com/kustomize/test/testdata/kustomization.yaml: -------------------------------------------------------------------------------- 1 | resources: 2 | - deployment.yaml 3 | - pod.yaml 4 | images: 5 | - name: "nginx" 6 | newTag: "v1" 7 | replicas: 8 | - name: "nginx-deployment" 9 | count: 2 -------------------------------------------------------------------------------- /docs/_caution-banner.md: -------------------------------------------------------------------------------- 1 | :::caution 2 | 3 |

This is documentation for Dagger {props.old}, which is no longer actively maintained.

4 | 5 |

For up-to-date documentation, see the latest version ({props.new}).

6 | 7 | ::: 8 | -------------------------------------------------------------------------------- /docs/learn/tests/kube-aws/basic/input.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "alpha.dagger.io/git" 5 | ) 6 | 7 | manifest: git.#Repository & { 8 | remote: "https://github.com/dagger/examples.git" 9 | ref: "main" 10 | subdir: "todoapp/k8s" 11 | } 12 | -------------------------------------------------------------------------------- /docs/learn/tests/kube-gcp/basic/input.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "alpha.dagger.io/git" 5 | ) 6 | 7 | manifest: git.#Repository & { 8 | remote: "https://github.com/dagger/examples.git" 9 | ref: "main" 10 | subdir: "todoapp/k8s" 11 | } 12 | -------------------------------------------------------------------------------- /docs/learn/tests/kube-kind/basic/input.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "alpha.dagger.io/git" 5 | ) 6 | 7 | manifest: git.#Repository & { 8 | remote: "https://github.com/dagger/examples.git" 9 | ref: "main" 10 | subdir: "todoapp/k8s" 11 | } 12 | -------------------------------------------------------------------------------- /docs/learn/tests/kube-kind/cue-manifest/input.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "alpha.dagger.io/git" 5 | ) 6 | 7 | repository: git.#Repository & { 8 | remote: "https://github.com/dagger/examples.git" 9 | ref: "main" 10 | subdir: "todoapp" 11 | } 12 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/rust/test/data/hello/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "hello_world" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/baptiste.barbotin@epitech.eu/azure/test/azureServerless/deploy_function/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "", 3 | "version": "", 4 | "description": "", 5 | "scripts" : { 6 | "test": "echo \"No tests yet...\"" 7 | }, 8 | "author": "" 9 | } -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/ezequiel@foncubierta.com/terraform/validate.cue: -------------------------------------------------------------------------------- 1 | //Deprecated: in favor of universe.dagger.io/alpha package 2 | package terraform 3 | 4 | // Run `terraform validate` 5 | #Validate: #Run & { 6 | // Terraform `validate` command 7 | cmd: "validate" 8 | } 9 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/dotnet/test.cue: -------------------------------------------------------------------------------- 1 | package dotnet 2 | 3 | // Test a dotnet package 4 | #Test: { 5 | // Package to test 6 | package: *"." | string 7 | 8 | #Container & { 9 | command: { 10 | args: [package] 11 | flags: test: true 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/contact@kjuulh.io/rust/test/data/hello/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "hello_world" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/tom.chauveau.pro@icloud.com/kubernetes/test/data/hello-pod/hello.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: hello-dagger 5 | spec: 6 | containers: 7 | - name: hello 8 | image: "alpine:3" 9 | command: ["/bin/echo", "hello Dagger"] -------------------------------------------------------------------------------- /docs/learn/tests/dev-cue-package/script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | mkdir -p test 4 | 5 | cat > test/source.cue << EOF 6 | package test 7 | 8 | import ( 9 | "github.com/username/gcpcloudrun" 10 | ) 11 | 12 | run: gcpcloudrun.#Run 13 | EOF 14 | 15 | dagger new staging -p ./test 16 | -------------------------------------------------------------------------------- /docs/tests/use-cases/node-ci/client.cue.fragment: -------------------------------------------------------------------------------- 1 | client: { 2 | filesystem: { 3 | "./": read: { 4 | contents: dagger.#FS 5 | exclude: [ 6 | "README.md", 7 | "eden.cue", 8 | ] 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/kubernetes/helm/image.cue: -------------------------------------------------------------------------------- 1 | package helm 2 | 3 | import ( 4 | "universe.dagger.io/docker" 5 | ) 6 | 7 | #Image: { 8 | version: string | *"latest" 9 | 10 | docker.#Pull & { 11 | source: "index.docker.io/alpine/helm:\(version)" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: / 3 | displayed_sidebar: '0.2' 4 | --- 5 | 6 | # Build & run locally...then in CI 7 | 8 | ```mdx-code-block 9 | import {Redirect} from '@docusaurus/router'; 10 | 11 | const Home = () => { 12 | return ; 13 | }; 14 | ``` 15 | -------------------------------------------------------------------------------- /docs/learn/tests/cloudformation/template/template-end.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "encoding/json" 4 | 5 | s3: #Deployment & { 6 | description: "Name S3 Bucket" 7 | } 8 | 9 | // Template contains the marshalled value of the s3 template 10 | template: json.Marshal(s3.template) 11 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/aws/cdk/python/install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euxo pipefail 3 | 4 | npm i "$CDK_CLI_NAME"@"$CDK_CLI_VERSION" 5 | 6 | python -m venv venv 7 | # shellcheck disable=SC1091 8 | source venv/bin/activate 9 | pip install -r requirements.txt | tee -a /logs 10 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/rust/test/test.bats: -------------------------------------------------------------------------------- 1 | setup() { 2 | load '../../../bats_helpers' 3 | 4 | common_setup 5 | } 6 | 7 | @test "rust publish" { 8 | dagger "do" -p ./publish.cue test 9 | } 10 | 11 | @test "rust image" { 12 | dagger "do" -p ./image.cue test 13 | } 14 | -------------------------------------------------------------------------------- /website/env.example: -------------------------------------------------------------------------------- 1 | # API Key value from: 2 | # https://analytics.amplitude.com/blocklayer/settings/projects/329895/general 3 | REACT_APP_AMPLITUDE_ID= 4 | 5 | # In case you are NOT running Docker Engine locally, 6 | # uncomment & adjust the following line: 7 | # DOCKER_HOST=ssh://192.168.1.22 8 | -------------------------------------------------------------------------------- /docs/plans/go-ci/hello/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | 7 | "dagger.io/testgreetci/greeting" 8 | ) 9 | 10 | func main() { 11 | name := os.Getenv("NAME") 12 | if name == "" { 13 | name = "John Doe" 14 | } 15 | fmt.Printf(greeting.Greeting(name)) 16 | } 17 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/spectral/README.md: -------------------------------------------------------------------------------- 1 | ## Spectral yaml linter 2 | 3 | This package is based on original work by Kambui Nurse aka siafu. 4 | It defines a Dagger Action for running spectral, a yaml and json linter. 5 | 6 | To test: 7 | 8 | ``` 9 | dagger -p ./test do test 10 | ``` 11 | -------------------------------------------------------------------------------- /tests/tasks/gitpull/bad_remote.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | dagger.#Plan & { 9 | actions: badremote: core.#GitPull & { 10 | remote: "https://github.com/blocklayerhq/lalalala.git" 11 | ref: "master" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/tasks/gitpull/exists.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | dagger.#Plan & { 9 | actions: gitPull: core.#GitPull & { 10 | remote: "https://github.com/blocklayerhq/acme-clothing.git" 11 | ref: "master" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /docs/tests/core-concepts/client/plans/file.cue: -------------------------------------------------------------------------------- 1 | import ( 2 | "encoding/yaml" 3 | // ... 4 | ) 5 | 6 | dagger.#Plan & { 7 | client: filesystem: "config.yaml": write: { 8 | // Convert a CUE value into a YAML formatted string 9 | contents: yaml.Marshal(actions.pull.output.config) 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /tests/tasks/gitpull/bad_ref.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | dagger.#Plan & { 9 | actions: badref: core.#GitPull & { 10 | remote: "https://github.com/blocklayerhq/acme-clothing.git" 11 | ref: "lalalalal" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/tasks/httpfetch/exist.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | dagger.#Plan & { 9 | actions: fetch: core.#HTTPFetch & { 10 | source: "https://releases.dagger.io/dagger/latest_version" 11 | dest: "/latest.html" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/tasks/httpfetch/not_exist.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | dagger.#Plan & { 9 | actions: fetch: core.#HTTPFetch & { 10 | source: "https://releases.dagger.io/dagger/asfgdsfg" 11 | dest: "/latest.html" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /website/cypress/fixtures/bad_verification.code.json: -------------------------------------------------------------------------------- 1 | { 2 | "error":"bad_verification_code", 3 | "error_description":"The code passed is incorrect or expired.", 4 | "error_uri":"https://docs.github.com/apps/managing-oauth-apps/troubleshooting-oauth-app-access-token-request-errors/#bad-verification-code" 5 | } -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/contact@kjuulh.io/rust/test/test.bats: -------------------------------------------------------------------------------- 1 | setup() { 2 | load '../../../../bats_helpers' 3 | 4 | common_setup 5 | } 6 | 7 | @test "rust publish" { 8 | dagger "do" -p ./publish.cue test 9 | } 10 | 11 | @test "rust image" { 12 | dagger "do" -p ./image.cue test 13 | } 14 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/tom.chauveau.pro@icloud.com/kubernetes/test/data/hello-kustomize/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | resources: 4 | - deployment.yaml 5 | - service.yaml 6 | replicas: 7 | - name: dagger-nginx 8 | count: 3 9 | namePrefix: kustom- -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/dotnet/test/data/Greeting/Greeting.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/go/test/data/hello/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | 7 | "dagger.io/testgreet/greeting" 8 | ) 9 | 10 | func main() { 11 | name := os.Getenv("NAME") 12 | if name == "" { 13 | name = "John Doe" 14 | } 15 | fmt.Printf(greeting.Greeting(name)) 16 | } 17 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/solomon@dagger.io/spectral/README.md: -------------------------------------------------------------------------------- 1 | ## Spectral yaml linter 2 | 3 | This package is based on original work by Kambui Nurse aka siafu. 4 | It defines a Dagger Action for running spectral, a yaml and json linter. 5 | 6 | To test: 7 | 8 | ``` 9 | dagger -p ./test do test 10 | ``` 11 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/yarn/test/data/bar/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test", 3 | "main": "index.js", 4 | "license": { 5 | "type": "Apache-2.0", 6 | "url": "https://opensource.org/licenses/apache2.0.php" 7 | }, 8 | "scripts": { 9 | "build": "mkdir -p ./build && cp /.env ./build/env" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /docs/getting-started/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: /getting-started 3 | displayed_sidebar: '0.2' 4 | --- 5 | 6 | # Build & run locally...then in CI 7 | 8 | ```mdx-code-block 9 | import {Redirect} from '@docusaurus/router'; 10 | 11 | const Home = () => { 12 | return ; 13 | }; 14 | ``` 15 | -------------------------------------------------------------------------------- /pkg/dagger.io/dagger/core/nop.cue: -------------------------------------------------------------------------------- 1 | package core 2 | 3 | // A core action that does nothing 4 | // Useful to work around bugs in the DAG resolver. 5 | // See for example https://github.com/dagger/dagger/issues/1789 6 | #Nop: { 7 | $dagger: task: _name: "Nop" 8 | input: _ 9 | output: _ @dagger(generated) 10 | } 11 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/kubernetes/kustomize/test/testdata/pod.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: test-pod 5 | labels: 6 | app: test-pod 7 | spec: 8 | containers: 9 | - name: test-pod 10 | image: nginx 11 | imagePullPolicy: IfNotPresent 12 | restartPolicy: Always 13 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/go/test.cue: -------------------------------------------------------------------------------- 1 | package go 2 | 3 | // Test a go package 4 | #Test: { 5 | // Package to test 6 | package: *"." | string 7 | 8 | #Container & { 9 | command: { 10 | name: "go" 11 | args: [package] 12 | flags: { 13 | test: true 14 | "-v": true 15 | } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/plan/validate/concrete/multitype.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | #Test: { 9 | required: string | int 10 | _op: core.#Pull & { 11 | source: required 12 | } 13 | } 14 | 15 | dagger.#Plan & { 16 | actions: test: #Test & {} 17 | } 18 | -------------------------------------------------------------------------------- /docs/tests/use-cases/node-ci/sca.cue.fragment: -------------------------------------------------------------------------------- 1 | SCA: { 2 | dependencyScanning: { 3 | docker.#Run & { 4 | workdir: "./src" 5 | input: build.output 6 | command: { 7 | name: "/bin/bash" 8 | args: ["-c", "npx audit-ci --high"] 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/tom.chauveau.pro@icloud.com/kubernetes/apply.cue: -------------------------------------------------------------------------------- 1 | //Deprecated: in favor of universe.dagger.io/alpha package 2 | package kubernetes 3 | 4 | // Execute `kubectl apply` in a container 5 | // See `_#base` in `./base.cue` for spec details 6 | #Apply: { 7 | _#base & { 8 | action: "apply" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/tom.chauveau.pro@icloud.com/kubernetes/delete.cue: -------------------------------------------------------------------------------- 1 | //Deprecated: in favor of universe.dagger.io/alpha package 2 | package kubernetes 3 | 4 | // Execute `kubectl delete` in a container 5 | // See `_#base` in `./base.cue` for spec details 6 | #Delete: { 7 | _#base & { 8 | action: "delete" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /tests/plan/validate/concrete/clientenv.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | dagger.#Plan & { 9 | client: env: TEST: string 10 | actions: test: { 11 | site: client.env.TEST 12 | command: core.#Nop & { 13 | input: dagger.#Scratch 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/olli.janatuinen@gmail.com/dotnet/test/data/Greeting/Greeting.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/solomon@dagger.io/yarn/test/data/bar/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test", 3 | "main": "index.js", 4 | "license": { 5 | "type": "Apache-2.0", 6 | "url": "https://opensource.org/licenses/apache2.0.php" 7 | }, 8 | "scripts": { 9 | "build": "mkdir -p ./build && cp /.env ./build/env" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/wangwei27494731@gmail.com/kustomize/test/testdata/pod.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: test-pod 5 | labels: 6 | app: test-pod 7 | spec: 8 | containers: 9 | - name: test-pod 10 | image: nginx 11 | imagePullPolicy: IfNotPresent 12 | restartPolicy: Always 13 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/vgjm456@qq.com/helm/image.cue: -------------------------------------------------------------------------------- 1 | //Deprecated: in favor of universe.dagger.io/alpha package 2 | package helm 3 | 4 | import ( 5 | "universe.dagger.io/docker" 6 | ) 7 | 8 | #Image: { 9 | version: string | *"latest" 10 | 11 | docker.#Pull & { 12 | source: "index.docker.io/alpine/helm:\(version)" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /tests/plan/client/filesystem/read/fs/dynamic/fail_load.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | ) 6 | 7 | dagger.#Plan & { 8 | client: { 9 | env: TMP_DIR_PATH: string 10 | filesystem: ref: read: { 11 | path: env.TMP_DIR_PATH 12 | contents: dagger.#FS 13 | } 14 | } 15 | actions: test: {} 16 | } 17 | -------------------------------------------------------------------------------- /docs/plans/go-ci/hello/greeting/greeting_test.go: -------------------------------------------------------------------------------- 1 | package greeting 2 | 3 | import "testing" 4 | 5 | func TestGreeting(t *testing.T) { 6 | name := "Dagger Test" 7 | expect := "Hi Dagger Test!" 8 | value := Greeting(name) 9 | 10 | if expect != value { 11 | t.Fatalf("Hello(%s) = '%s', expected '%s'", name, value, expect) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /docs/update-version.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -ex 4 | 5 | if ! sed --version | grep "GNU" 6 | then 7 | echo "Please install GNU sed, a.k.a. gnused" 8 | exit 1 9 | fi 10 | 11 | sed --in-place --regexp-extended --expression \ 12 | 's/'"${DAGGER_VERSION_FROM:-0\.2\.9}"'/'"${DAGGER_VERSION_TO:-0\.2\.11}"'/g' \ 13 | ./*/*.md 14 | -------------------------------------------------------------------------------- /tests/plan/validate/concrete/clientenv_missing.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | dagger.#Plan & { 9 | client: env: TEST: string 10 | actions: test: { 11 | site: client.env.NONEXISTENT 12 | command: core.#Nop & { 13 | input: dagger.#Scratch 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /docs/learn/tests/kube-aws/cue-manifest/input.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "alpha.dagger.io/git" 5 | ) 6 | 7 | repository: git.#Repository & { 8 | remote: "https://github.com/dagger/examples.git" 9 | ref: "main" 10 | subdir: "todoapp" 11 | } 12 | 13 | registry: "125635003186.dkr.ecr.\(awsConfig.region).amazonaws.com/dagger-ci" 14 | -------------------------------------------------------------------------------- /tests/plan/validate/concrete/clientenv_default.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | dagger.#Plan & { 9 | client: env: USER: string 10 | actions: test: { 11 | site: string | *client.env.USER 12 | command: core.#Nop & { 13 | input: dagger.#Scratch 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /tests/plan/validate/concrete/struct_or_other.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | #Test: { 9 | required: { 10 | field: string 11 | } | *null 12 | _op: core.#Nop & { 13 | input: required 14 | } 15 | } 16 | 17 | dagger.#Plan & { 18 | actions: test: #Test & { 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /website/.gitignore: -------------------------------------------------------------------------------- 1 | # Dependencies 2 | /node_modules 3 | 4 | # Production 5 | /build 6 | 7 | # Generated files 8 | .docusaurus 9 | .cache-loader 10 | 11 | # Misc 12 | .DS_Store 13 | .env 14 | .env.local 15 | .env.development.local 16 | .env.test.local 17 | .env.production.local 18 | 19 | npm-debug.log* 20 | yarn-debug.log* 21 | yarn-error.log* 22 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/dotnet/test/data/hello/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | public class Program 4 | { 5 | public static void Main() 6 | { 7 | var name = Environment.GetEnvironmentVariable("NAME"); 8 | if (String.IsNullOrEmpty(name)) { 9 | name = "John Doe"; 10 | } 11 | Console.Write(Greeting.GetMessage(name)); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /telemetry/event/event_test.go: -------------------------------------------------------------------------------- 1 | package event 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/stretchr/testify/require" 7 | ) 8 | 9 | func TestEvent(t *testing.T) { 10 | action := ActionTransitioned{ 11 | Name: "test", 12 | State: ActionStateRunning, 13 | } 14 | event := New(action) 15 | 16 | require.NoError(t, event.Validate()) 17 | } 18 | -------------------------------------------------------------------------------- /docs/tests/core-concepts/client/plans/platform.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "universe.dagger.io/python" 6 | ) 7 | 8 | dagger.#Plan & { 9 | client: _ 10 | 11 | actions: test: python.#Run & { 12 | script: contents: "print('Platform: \(client.platform.os) / \(client.platform.arch)')" 13 | always: true 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/yarn/test/data/foo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test", 3 | "main": "index.js", 4 | "license": { 5 | "type": "Apache-2.0", 6 | "url": "https://opensource.org/licenses/apache2.0.php" 7 | }, 8 | "scripts": { 9 | "build": "mkdir -p ./build && echo output > ./build/test && touch .env && cp .env ./build/" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /tests/age_key.txt: -------------------------------------------------------------------------------- 1 | # To manually use this AGE key with sops, run 2 | # export SOPS_AGE_KEY_FILE="$(git rev-parse --show-toplevel)/tests/age_key.txt" 3 | # Dagger CI 4 | # created: 2021-05-26T17:10:52-07:00 5 | # public key: age1gxwmtwahzwdmrskhf90ppwlnze30lgpm056kuesrxzeuyclrwvpsupwtpk 6 | AGE-SECRET-KEY-1R8RRCL7NXA5SHW6HEZCJ5FJG2JJECSNVDHCF533W3CNDJGQL0AVQEA0JK7 7 | -------------------------------------------------------------------------------- /docs/tests/guides/handling-outputs/control.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "encoding/yaml" 5 | "dagger.io/dagger" 6 | "universe.dagger.io/docker" 7 | ) 8 | 9 | dagger.#Plan & { 10 | client: filesystem: "config.yaml": write: contents: yaml.Marshal(actions.pull.image.config) 11 | actions: pull: docker.#Pull & { 12 | source: "alpine" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/go/test/data/hello/greeting/greeting_test.go: -------------------------------------------------------------------------------- 1 | package greeting 2 | 3 | import "testing" 4 | 5 | func TestGreeting(t *testing.T) { 6 | name := "Dagger Test" 7 | expect := "Hi Dagger Test!" 8 | value := Greeting(name) 9 | 10 | if expect != value { 11 | t.Fatalf("Hello(%s) = '%s', expected '%s'", name, value, expect) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/olli.janatuinen@gmail.com/dotnet/test.cue: -------------------------------------------------------------------------------- 1 | //Deprecated: in favor of universe.dagger.io/alpha package 2 | package dotnet 3 | 4 | // Test a dotnet package 5 | #Test: { 6 | // Package to test 7 | package: *"." | string 8 | 9 | #Container & { 10 | command: { 11 | args: [package] 12 | flags: test: true 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /docs/tests/guides/handling-outputs/default.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "universe.dagger.io/docker" 6 | ) 7 | 8 | dagger.#Plan & { 9 | actions: { 10 | pull: docker.#Pull & { 11 | source: "alpine" 12 | } 13 | push: docker.#Push & { 14 | image: pull.output 15 | dest: "localhost:5042/alpine" 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/go/test/test.cue: -------------------------------------------------------------------------------- 1 | package go 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "universe.dagger.io/go" 6 | ) 7 | 8 | dagger.#Plan & { 9 | client: filesystem: "./data/hello": read: contents: dagger.#FS 10 | 11 | actions: test: go.#Test & { 12 | source: client.filesystem."./data/hello".read.contents 13 | package: "./greeting" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /docs/tests/guides/docker/dockerfile.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "universe.dagger.io/docker" 6 | ) 7 | 8 | dagger.#Plan & { 9 | client: filesystem: ".": read: contents: dagger.#FS 10 | 11 | actions: build: docker.#Dockerfile & { 12 | // This is the Dockerfile context 13 | source: client.filesystem.".".read.contents 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/age_key.txt: -------------------------------------------------------------------------------- 1 | # To manually use this AGE key with sops, run 2 | # export SOPS_AGE_KEY_FILE="$(git rev-parse --show-toplevel)/tests/age_key.txt" 3 | # Dagger CI 4 | # created: 2021-05-26T17:10:52-07:00 5 | # public key: age1gxwmtwahzwdmrskhf90ppwlnze30lgpm056kuesrxzeuyclrwvpsupwtpk 6 | AGE-SECRET-KEY-1R8RRCL7NXA5SHW6HEZCJ5FJG2JJECSNVDHCF533W3CNDJGQL0AVQEA0JK7 7 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/dotnet/test/test.bats: -------------------------------------------------------------------------------- 1 | setup() { 2 | load '../../../bats_helpers' 3 | 4 | common_setup 5 | } 6 | 7 | @test "dotnet publish" { 8 | dagger "do" -p ./publish.cue test 9 | } 10 | 11 | @test "dotnet image" { 12 | dagger "do" -p ./image.cue test 13 | } 14 | 15 | @test "dotnet test" { 16 | dagger "do" -p ./test.cue test 17 | } 18 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/olli.janatuinen@gmail.com/dotnet/test/data/hello/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | public class Program 4 | { 5 | public static void Main() 6 | { 7 | var name = Environment.GetEnvironmentVariable("NAME"); 8 | if (String.IsNullOrEmpty(name)) { 9 | name = "John Doe"; 10 | } 11 | Console.Write(Greeting.GetMessage(name)); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/tasks/scratch/scratch_build_scratch.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | dagger.#Plan & { 9 | actions: build: core.#Dockerfile & { 10 | source: dagger.#Scratch 11 | dockerfile: contents: "FROM scratch" 12 | // Assert that output is dagger.#Scratch 13 | output: dagger.#Scratch 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/solomon@dagger.io/yarn/test/data/foo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test", 3 | "main": "index.js", 4 | "license": { 5 | "type": "Apache-2.0", 6 | "url": "https://opensource.org/licenses/apache2.0.php" 7 | }, 8 | "scripts": { 9 | "build": "mkdir -p ./build && echo output > ./build/test && touch .env && cp .env ./build/" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /docs/tests/guides/docker/dockerfile_auth.cue: -------------------------------------------------------------------------------- 1 | build: docker.#Dockerfile & { 2 | source: client.filesystem.".".read.contents 3 | auth: { 4 | "index.docker.io": { 5 | username: "example" 6 | secret: client.env.REGISTRY_DOCKERIO_PASS 7 | } 8 | "registry.gitlab.com": { 9 | username: "example" 10 | secret: client.env.REGISTRY_GITLAB_PASS 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /docs/tests/use-cases/ci-cd-for-go-project/base.cue.fragment: -------------------------------------------------------------------------------- 1 | import ( 2 | "dagger.io/dagger" 3 | "universe.dagger.io/go" 4 | ) 5 | 6 | dagger.#Plan & { 7 | actions: { 8 | // Improve go base image with useful tool 9 | // Enable cgo by installing build-base 10 | _base: go.#Image & { 11 | packages: "build-base": version: _ 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /docs/plans/docker-cli-run/local.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "universe.dagger.io/docker/cli" 6 | ) 7 | 8 | dagger.#Plan & { 9 | client: network: "unix:///var/run/docker.sock": connect: dagger.#Socket 10 | 11 | actions: run: cli.#Run & { 12 | host: client.network."unix:///var/run/docker.sock".connect 13 | command: name: "info" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/go/golangci/test/lint.cue: -------------------------------------------------------------------------------- 1 | package golangci 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | 6 | "universe.dagger.io/alpha/go/golangci" 7 | ) 8 | 9 | dagger.#Plan & { 10 | client: filesystem: "./data/hello": read: contents: dagger.#FS 11 | 12 | actions: test: golangci.#Lint & { 13 | source: client.filesystem."./data/hello".read.contents 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/rust/test/publish.cue: -------------------------------------------------------------------------------- 1 | package rust 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "universe.dagger.io/x/contact@kjuulh.io/rust" 6 | ) 7 | 8 | dagger.#Plan & { 9 | client: filesystem: "./data/hello": read: contents: dagger.#FS 10 | 11 | actions: test: publish: rust.#Publish & { 12 | source: client.filesystem."./data/hello".read.contents 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /plancontext/context_test.go: -------------------------------------------------------------------------------- 1 | package plancontext 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/stretchr/testify/require" 7 | ) 8 | 9 | func TestContext(t *testing.T) { 10 | ctx := New() 11 | 12 | secret := ctx.Secrets.New("test") 13 | get, err := ctx.Secrets.FromValue(secret.MarshalCUE()) 14 | require.NoError(t, err) 15 | require.Equal(t, "test", get.PlainText()) 16 | } 17 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/scaleway/image.cue: -------------------------------------------------------------------------------- 1 | // Maintainers: tom.chauveau.pro@icloud.com 2 | package scaleway 3 | 4 | import ( 5 | "universe.dagger.io/docker" 6 | ) 7 | 8 | _#defaultVersion: "v2.4.0" 9 | 10 | // Scaleway CLI image 11 | #Image: { 12 | version: *_#defaultVersion | string 13 | 14 | docker.#Pull & { 15 | source: "index.docker.io/scaleway/cli:\(version)" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/olli.janatuinen@gmail.com/dotnet/test/test.bats: -------------------------------------------------------------------------------- 1 | setup() { 2 | load '../../../../bats_helpers' 3 | 4 | common_setup 5 | } 6 | 7 | @test "dotnet publish" { 8 | dagger "do" -p ./publish.cue test 9 | } 10 | 11 | @test "dotnet image" { 12 | dagger "do" -p ./image.cue test 13 | } 14 | 15 | @test "dotnet test" { 16 | dagger "do" -p ./test.cue test 17 | } 18 | -------------------------------------------------------------------------------- /tests/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "license": "Apache-2.0", 3 | "scripts": { 4 | "test": "bats --jobs 4 --print-output-on-failure --verbose-run ." 5 | }, 6 | "devDependencies": { 7 | "bats": "https://github.com/bats-core/bats-core#v1.6.0", 8 | "bats-assert": "https://github.com/bats-core/bats-assert", 9 | "bats-support": "https://github.com/bats-core/bats-support" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /version/version_test.go: -------------------------------------------------------------------------------- 1 | package version 2 | 3 | import ( 4 | "fmt" 5 | "runtime" 6 | "testing" 7 | 8 | "github.com/stretchr/testify/require" 9 | ) 10 | 11 | func TestShort(t *testing.T) { 12 | require.Equal(t, Short(), "dagger devel ()") 13 | } 14 | 15 | func TestLong(t *testing.T) { 16 | require.Equal(t, Long(), fmt.Sprintf("dagger devel () %s/%s", runtime.GOOS, runtime.GOARCH)) 17 | } 18 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/lua/test/fmtCheck.cue: -------------------------------------------------------------------------------- 1 | package lua 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "universe.dagger.io/x/teddylear@protonmail.com/lua" 6 | ) 7 | 8 | dagger.#Plan & { 9 | client: filesystem: "./data/hello": read: contents: dagger.#FS 10 | 11 | actions: test: simple: fmtCheck: lua.#StyluaCheck & { 12 | source: client.filesystem."./data/hello".read.contents 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /tests/plan/client/filesystem/read/fs/invalid_fs_type/test.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | dagger.#Plan & { 9 | // Reading a directory into a non-fs should fail 10 | client: filesystem: "../rootfs": read: contents: string 11 | actions: test: core.#Nop & { 12 | input: client.filesystem."../rootfs".read.contents 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /tests/tasks/source/source_not_exist.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | dagger.#Plan & { 9 | actions: { 10 | image: core.#Pull & { 11 | source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" 12 | } 13 | 14 | source: core.#Source & { 15 | path: "not/exist" 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /docs/learn/tests/kube-kind/deployment/input.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "alpha.dagger.io/git" 5 | ) 6 | 7 | manifest: git.#Repository & { 8 | remote: "https://github.com/dagger/examples.git" 9 | ref: "main" 10 | subdir: "todoapp/k8s" 11 | } 12 | 13 | repository: git.#Repository & { 14 | remote: "https://github.com/dagger/examples.git" 15 | ref: "main" 16 | subdir: "todoapp" 17 | } 18 | -------------------------------------------------------------------------------- /docs/tests/use-cases/ci-cd-for-go-project/push.cue.fragment: -------------------------------------------------------------------------------- 1 | // Push image to remote registry (depends on image) 2 | push: { 3 | // Docker username 4 | _dockerUsername: "" 5 | 6 | docker.#Push & { 7 | "image": image.output 8 | dest: "\(_dockerUsername)/" 9 | auth: { 10 | username: _dockerUsername 11 | secret: client.env.DOCKER_PASSWORD 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/tom.chauveau.pro@icloud.com/kubernetes/test/data/hello-kustomize/service.yaml: -------------------------------------------------------------------------------- 1 | kind: Service 2 | apiVersion: v1 3 | metadata: 4 | name: dagger-nginx-service 5 | labels: 6 | dagger-test: dagger-test 7 | spec: 8 | selector: 9 | app: dagger-nginx 10 | ports: 11 | - name: http 12 | protocol: TCP 13 | port: 80 14 | targetPort: 80 15 | type: ClusterIP -------------------------------------------------------------------------------- /tests/tasks/source/source_invalid_path.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | dagger.#Plan & { 9 | actions: { 10 | image: core.#Pull & { 11 | source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" 12 | } 13 | 14 | source: core.#Source & { 15 | path: "testdata/../.." 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/dotnet/test/test.cue: -------------------------------------------------------------------------------- 1 | package dotnet 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "universe.dagger.io/x/olli.janatuinen@gmail.com/dotnet" 6 | ) 7 | 8 | dagger.#Plan & { 9 | client: filesystem: "./data": read: contents: dagger.#FS 10 | 11 | actions: test: dotnet.#Test & { 12 | source: client.filesystem."./data".read.contents 13 | package: "./Greeting.Tests" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/aws/_scripts/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ARCH=$(uname -m) 3 | curl -s "https://awscli.amazonaws.com/awscli-exe-linux-${ARCH}-$1.zip" -o awscliv2.zip 4 | unzip awscliv2.zip -x "aws/dist/awscli/examples/*" "aws/dist/docutils/*" 5 | ./aws/install 6 | rm -rf awscliv2.zip aws /usr/local/aws-cli/v2/*/dist/aws_completer /usr/local/aws-cli/v2/*/dist/awscli/data/ac.index /usr/local/aws-cli/v2/*/dist/awscli/examples 7 | -------------------------------------------------------------------------------- /tests/plan/client/filesystem/read/fs/dynamic/fail_path_exists.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | ) 6 | 7 | dagger.#Plan & { 8 | client: { 9 | env: TMP_DIR_PATH: string 10 | filesystem: { 11 | // should fail even if default path exists 12 | "./": read: { 13 | path: env.TMP_DIR_PATH 14 | contents: dagger.#FS 15 | } 16 | } 17 | } 18 | actions: test: {} 19 | } 20 | -------------------------------------------------------------------------------- /docs/tests/core-concepts/client/plans/fs.cue: -------------------------------------------------------------------------------- 1 | dagger.#Plan & { 2 | // Path may be absolute, or relative to current working directory 3 | client: filesystem: ".": read: { 4 | // CUE type defines expected content 5 | contents: dagger.#FS 6 | exclude: ["node_modules"] 7 | } 8 | 9 | actions: { 10 | copy: docker.#Copy & { 11 | contents: client.filesystem.".".read.contents 12 | } 13 | // ... 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/dotnet/test/data/Greeting.Tests/Greeting_Should.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Xunit; 3 | 4 | public class Greeting_Should 5 | { 6 | [Fact] 7 | public void Greeting_PrintName() 8 | { 9 | var name = "Dagger Test"; 10 | var expect = "Hi Dagger Test!"; 11 | var value = Greeting.GetMessage(name); 12 | Assert.Equal(expect, value); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/terraform/workspace.cue: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | // Subcommands of `terraform workspace` command 4 | #WorkspaceSubcmd: "new" | "select" | "delete" 5 | 6 | // Run `terraform workspace` 7 | #Workspace: #Run & { 8 | // Terraform `workspace` command 9 | cmd: "workspace \(subCmd)" 10 | 11 | // Terraform `workspace` subcommand (i.e. new, select, delete) 12 | subCmd: #WorkspaceSubcmd 13 | } 14 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/aws/test/test.bats: -------------------------------------------------------------------------------- 1 | setup() { 2 | load '../../bats_helpers' 3 | 4 | common_setup 5 | } 6 | 7 | @test "aws default_version" { 8 | dagger "do" -p ./default_version.cue getVersion 9 | } 10 | 11 | @test "aws credentials" { 12 | dagger "do" -p ./credentials.cue getCallerIdentity 13 | } 14 | 15 | @test "aws config_file" { 16 | dagger "do" -p ./config_file.cue getCallerIdentity 17 | } 18 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/go/test/test.bats: -------------------------------------------------------------------------------- 1 | setup() { 2 | load '../../bats_helpers' 3 | 4 | common_setup 5 | } 6 | 7 | @test "go build" { 8 | dagger "do" -p ./build.cue test 9 | } 10 | 11 | @test "go container" { 12 | dagger "do" -p ./container.cue test 13 | } 14 | 15 | @test "go image" { 16 | dagger "do" -p ./image.cue test 17 | } 18 | 19 | @test "go test" { 20 | dagger "do" -p ./test.cue test 21 | } 22 | -------------------------------------------------------------------------------- /tests/plan/client/filesystem/read/fs/invalid_fs_input/test.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | dagger.#Plan & { 9 | // Reading a file into a dagger.#FS should not be possbile 10 | client: filesystem: "../rootfs/test.txt": read: contents: dagger.#FS 11 | actions: test: core.#Nop & { 12 | input: client.filesystem."../rootfs/test.txt".read.contents 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /website/static/img/Dagger_Icons_Arrow-top.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/tests/use-cases/ci-cd-for-go-project/retrieve-go-project/dagger.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | ) 6 | 7 | dagger.#Plan & { 8 | // Retrieve go source code 9 | client: filesystem: ".": read: { 10 | contents: dagger.#FS 11 | include: ["go.mod", "go.sum", "**/*.go"] 12 | } 13 | 14 | actions: { 15 | // Alias to code directory 16 | _code: client.filesystem.".".read.contents 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/baptiste.barbotin@epitech.eu/azure/azureFuncCoreTool/README.md: -------------------------------------------------------------------------------- 1 | # Azure Func Core Tool 2 | 3 | This package provides declarations to interact with the Azure Func Core Tool. 4 | 5 | The following are available: 6 | - [Publish](#publish) 7 | 8 | ## Publish 9 | 10 | This part of the package allows us to publish serverless functions in Azure. 11 | 12 | It is available in the [publish.cue](./publish.cue) file. 13 | -------------------------------------------------------------------------------- /website/cypress.config.js: -------------------------------------------------------------------------------- 1 | const { defineConfig } = require('cypress') 2 | 3 | module.exports = defineConfig({ 4 | chromeWebSecurity: false, 5 | video: false, 6 | e2e: { 7 | // We've imported your old cypress plugins here. 8 | // You may want to clean this up later by importing these. 9 | setupNodeEvents(on, config) { 10 | return require('./cypress/plugins/index.js')(on, config) 11 | }, 12 | }, 13 | }) 14 | -------------------------------------------------------------------------------- /website/static/img/Dagger_Icons_Arrow-bottom.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/static/img/Dagger_Icons_Arrow-left.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/static/img/Dagger_Icons_Arrow-right.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/olli.janatuinen@gmail.com/dotnet/test/data/Greeting.Tests/Greeting_Should.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Xunit; 3 | 4 | public class Greeting_Should 5 | { 6 | [Fact] 7 | public void Greeting_PrintName() 8 | { 9 | var name = "Dagger Test"; 10 | var expect = "Hi Dagger Test!"; 11 | var value = Greeting.GetMessage(name); 12 | Assert.Equal(expect, value); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/tom.chauveau.pro@icloud.com/kubernetes/kubectl.cue: -------------------------------------------------------------------------------- 1 | //Deprecated: in favor of universe.dagger.io/alpha package 2 | package kubernetes 3 | 4 | import ( 5 | "universe.dagger.io/docker" 6 | ) 7 | 8 | _#DefaultVersion: "1.23.5" 9 | 10 | // Kubectl client 11 | #Kubectl: { 12 | version: *_#DefaultVersion | string 13 | 14 | docker.#Pull & { 15 | source: "index.docker.io/bitnami/kubectl:\(version)" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/dotnet/image.cue: -------------------------------------------------------------------------------- 1 | package dotnet 2 | 3 | import ( 4 | "universe.dagger.io/docker" 5 | ) 6 | 7 | // .NET image default version 8 | _#DefaultVersion: "6.0" 9 | 10 | // Pull a dotnet base image 11 | #Image: { 12 | version: *_#DefaultVersion | string 13 | docker.#Build & { 14 | steps: [ 15 | docker.#Pull & { 16 | source: "mcr.microsoft.com/dotnet/sdk:\(version)-alpine" 17 | }, 18 | ] 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /docs/learn/tests/kube-gcp/deployment/input.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "alpha.dagger.io/git" 5 | ) 6 | 7 | manifest: git.#Repository & { 8 | remote: "https://github.com/dagger/examples.git" 9 | ref: "main" 10 | subdir: "todoapp/k8s" 11 | } 12 | 13 | repository: git.#Repository & { 14 | remote: "https://github.com/dagger/examples.git" 15 | ref: "main" 16 | subdir: "todoapp" 17 | } 18 | 19 | registry: "gcr.io/dagger-ci/test" 20 | -------------------------------------------------------------------------------- /docs/learn/tests/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "license": "Apache-2.0", 3 | "scripts": { 4 | "test": "bats --jobs 4 --show-output-of-passing-tests --print-output-on-failure --no-parallelize-within-files ." 5 | }, 6 | "devDependencies": { 7 | "bats": "https://github.com/bats-core/bats-core#master", 8 | "bats-assert": "https://github.com/bats-core/bats-assert", 9 | "bats-support": "https://github.com/bats-core/bats-support" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/terraform/plan.cue: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | // File to write the output plan 4 | _#DefaultPlanFile: "./out.tfplan" 5 | 6 | // Run `terraform plan` 7 | #Plan: #Run & { 8 | // Terraform `plan` command 9 | cmd: "plan" 10 | 11 | // Internal pre-defined arguments for `terraform plan` 12 | withinCmdArgs: ["-out=\(planFile)"] 13 | 14 | // Path to a Terraform plan file 15 | planFile: string | *_#DefaultPlanFile 16 | } 17 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/docker/test/test.bats: -------------------------------------------------------------------------------- 1 | setup() { 2 | load '../../bats_helpers' 3 | 4 | common_setup 5 | } 6 | 7 | @test "docker build" { 8 | dagger "do" -p ./build.cue test 9 | } 10 | 11 | @test "docker dockerfile" { 12 | dagger "do" -p ./dockerfile.cue test 13 | } 14 | 15 | @test "docker run" { 16 | dagger "do" -p ./run.cue test 17 | } 18 | 19 | @test "docker image" { 20 | dagger "do" -p ./image.cue test 21 | } 22 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/baptiste.barbotin@epitech.eu/azure/test/azureServerless/deploy_function/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "logging": { 4 | "applicationInsights": { 5 | "samplingSettings": { 6 | "isEnabled": true, 7 | "excludedTypes": "Request" 8 | } 9 | } 10 | }, 11 | "extensionBundle": { 12 | "id": "Microsoft.Azure.Functions.ExtensionBundle", 13 | "version": "[2.*, 3.0.0)" 14 | } 15 | } -------------------------------------------------------------------------------- /solver/socketprovider_unix.go: -------------------------------------------------------------------------------- 1 | //go:build !windows 2 | // +build !windows 3 | 4 | package solver 5 | 6 | import ( 7 | "errors" 8 | "net" 9 | "time" 10 | 11 | "go.dagger.io/dagger/plancontext" 12 | ) 13 | 14 | func dialSocket(socket *plancontext.Socket) (net.Conn, error) { 15 | if socket.Unix() == "" { 16 | return nil, errors.New("unsupported socket type") 17 | } 18 | 19 | return net.DialTimeout("unix", socket.Unix(), time.Second) 20 | } 21 | -------------------------------------------------------------------------------- /docs/learn/tests/kube-gcp/cue-manifest/input.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "alpha.dagger.io/git" 5 | ) 6 | 7 | manifest: git.#Repository & { 8 | remote: "https://github.com/dagger/examples.git" 9 | ref: "main" 10 | subdir: "todoapp/k8s" 11 | } 12 | 13 | repository: git.#Repository & { 14 | remote: "https://github.com/dagger/examples.git" 15 | ref: "main" 16 | subdir: "todoapp" 17 | } 18 | 19 | registry: "gcr.io/dagger-ci/test" 20 | -------------------------------------------------------------------------------- /.github/workflows/add-issues-to-backlog.yml: -------------------------------------------------------------------------------- 1 | name: Add issues to backlog project 2 | 3 | on: 4 | issues: 5 | types: 6 | - opened 7 | 8 | jobs: 9 | add-to-project: 10 | name: Add issue to project 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/add-to-project@v0.0.3 14 | with: 15 | project-url: https://github.com/orgs/dagger/projects/2 16 | github-token: ${{ secrets.ADD_TO_PROJECT_PAT }} 17 | -------------------------------------------------------------------------------- /docs/tests/guides/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.9 as base 2 | ENV VIRTUAL_ENV=/opt/env 3 | ENV PATH="$VIRTUAL_ENV/bin:$PATH" 4 | 5 | ### "build" base image ### 6 | FROM base as build 7 | # install build dependencies 8 | RUN pip install --no-cache-dir --user pipx 9 | RUN pipx install poetry 10 | 11 | ### "run" base image ### 12 | FROM base as run 13 | # install run dependencies 14 | COPY ./gunicorn.py /etc/ 15 | EXPOSE 5000 16 | WORKDIR /app 17 | CMD ["/start"] 18 | -------------------------------------------------------------------------------- /mod/test-ssh-keys/id_ed25519_test: -------------------------------------------------------------------------------- 1 | -----BEGIN OPENSSH PRIVATE KEY----- 2 | b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW 3 | QyNTUxOQAAACCpGsk8WLx7gXCXX1muGhKjlkqaqykF1X198WQMkBO2pwAAAKC5Ec8WuRHP 4 | FgAAAAtzc2gtZWQyNTUxOQAAACCpGsk8WLx7gXCXX1muGhKjlkqaqykF1X198WQMkBO2pw 5 | AAAEBXE9Uht+QHuyK7+yYcZFVWOJ3qkhUh/wn289nDKDPHKakayTxYvHuBcJdfWa4aEqOW 6 | SpqrKQXVfX3xZAyQE7anAAAAGnRpaG9taXIuam92aWNpY0B0b3B0YWwuY29tAQID 7 | -----END OPENSSH PRIVATE KEY----- 8 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/terraform/destroy.cue: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | // Run `terraform destroy` 4 | #Destroy: #Run & { 5 | // Terraform `destroy` command 6 | cmd: "destroy" 7 | 8 | // Internal pre-defined arguments for `terraform destroy` 9 | withinCmdArgs: [ 10 | if autoApprove { 11 | "-auto-approve" 12 | }, 13 | ] 14 | 15 | // Flag to indicate whether or not to auto-approve (i.e. -auto-approve flag) 16 | autoApprove: bool | *true 17 | } 18 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/docker/test/testdata/Dockerfile: -------------------------------------------------------------------------------- 1 | ### 2 | # STAGE: builder 3 | # Build a simple go program 4 | # GO TO STAGE: app 5 | ### 6 | FROM golang:1.17-alpine as builder 7 | 8 | WORKDIR /app 9 | 10 | COPY go.mod . 11 | COPY main.go . 12 | 13 | RUN go build -o hello main.go 14 | 15 | FROM alpine:3.15@sha256:21a3deaa0d32a8057914f36584b5288d2e5ecc984380bc0118285c70fa8c9300 16 | 17 | COPY --from=builder /app/hello /bin/hello 18 | 19 | CMD ["hello"] 20 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/contact@kjuulh.io/rust/test/publish.cue: -------------------------------------------------------------------------------- 1 | //Deprecated: in favor of universe.dagger.io/alpha package 2 | package rust 3 | 4 | import ( 5 | "dagger.io/dagger" 6 | "universe.dagger.io/x/contact@kjuulh.io/rust" 7 | ) 8 | 9 | dagger.#Plan & { 10 | client: filesystem: "./data/hello": read: contents: dagger.#FS 11 | 12 | actions: test: publish: rust.#Publish & { 13 | source: client.filesystem."./data/hello".read.contents 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /tests/plan/client/env/concrete.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | dagger.#Plan & { 9 | client: env: TEST_FAIL: "env" 10 | 11 | actions: { 12 | image: core.#Pull & { 13 | source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" 14 | } 15 | test: core.#Exec & { 16 | input: image.output 17 | args: [client.env.TEST_FAIL] 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /docs/plans/go-ci/plan.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | 6 | "universe.dagger.io/go" 7 | ) 8 | 9 | dagger.#Plan & { 10 | client: filesystem: "./hello": read: contents: dagger.#FS 11 | 12 | actions: { 13 | test: go.#Test & { 14 | source: client.filesystem."./hello".read.contents 15 | package: "./..." 16 | } 17 | 18 | build: go.#Build & { 19 | source: client.filesystem."./hello".read.contents 20 | } 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/terraform/image.cue: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | import ( 4 | "universe.dagger.io/docker" 5 | ) 6 | 7 | // Terraform image default version 8 | _#DefaultVersion: "1.1.8" 9 | 10 | // Terraform base image 11 | #Image: { 12 | // Terraform version 13 | version: *_#DefaultVersion | string 14 | 15 | docker.#Build & { 16 | steps: [ 17 | docker.#Pull & { 18 | source: "hashicorp/terraform:\(version)" 19 | }, 20 | ] 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/plan/validate/concrete/yarn.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "universe.dagger.io/yarn" 6 | ) 7 | 8 | // BEFORE: failed to execute plan: task failed: actions.test._exec: invalid FS at path "actions.test._exec.input": FS is not set 9 | // AFTER: failed to load plan: "actions.test.input" is not set: 10 | // ../../cue.mod/pkg/universe.dagger.io/docker/run.cue:13:2 11 | 12 | dagger.#Plan & { 13 | actions: test: yarn.#Command 14 | } 15 | -------------------------------------------------------------------------------- /docs/learn/tests/kube-aws/basic/todoapp.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "alpha.dagger.io/dagger" 5 | "alpha.dagger.io/kubernetes" 6 | ) 7 | 8 | // input: kubernetes objects directory to deploy to 9 | // set with `dagger input dir manifest ./k8s -e kube` 10 | manifest: dagger.#Artifact & dagger.#Input 11 | 12 | // Deploy the manifest to a kubernetes cluster 13 | todoApp: kubernetes.#Resources & { 14 | "kubeconfig": kubeconfig 15 | source: manifest 16 | } 17 | -------------------------------------------------------------------------------- /docs/learn/tests/kube-gcp/basic/todoapp.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "alpha.dagger.io/dagger" 5 | "alpha.dagger.io/kubernetes" 6 | ) 7 | 8 | // input: kubernetes objects directory to deploy to 9 | // set with `dagger input dir manifest ./k8s -e kube` 10 | manifest: dagger.#Artifact & dagger.#Input 11 | 12 | // Deploy the manifest to a kubernetes cluster 13 | todoApp: kubernetes.#Resources & { 14 | "kubeconfig": kubeconfig 15 | source: manifest 16 | } 17 | -------------------------------------------------------------------------------- /docs/learn/tests/kube-kind/basic/todoapp.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "alpha.dagger.io/dagger" 5 | "alpha.dagger.io/kubernetes" 6 | ) 7 | 8 | // input: kubernetes objects directory to deploy to 9 | // set with `dagger input dir manifest ./k8s -e kube` 10 | manifest: dagger.#Artifact & dagger.#Input 11 | 12 | // Deploy the manifest to a kubernetes cluster 13 | todoApp: kubernetes.#Resources & { 14 | "kubeconfig": kubeconfig 15 | source: manifest 16 | } 17 | -------------------------------------------------------------------------------- /docs/tests/use-cases/ci-cd-for-go-project/image.cue.fragment: -------------------------------------------------------------------------------- 1 | import ( 2 | "universe.dagger.io/alpine" 3 | "universe.dagger.io/docker" 4 | ) 5 | 6 | // Build docker image (depends on build) 7 | image: docker.#Build & { 8 | steps: [ 9 | alpine.#Build, 10 | docker.#Copy & { 11 | input: _base.output 12 | contents: build.output 13 | dest: "/usr/bin" 14 | }, 15 | docker.#Set & { 16 | config: cmd: [""] 17 | }, 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/baptiste.barbotin@epitech.eu/azure/test/azureServerless/deploy_function/HttpExample/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "authLevel": "Anonymous", 5 | "type": "httpTrigger", 6 | "direction": "in", 7 | "name": "req", 8 | "methods": [ 9 | "get", 10 | "post" 11 | ] 12 | }, 13 | { 14 | "type": "http", 15 | "direction": "out", 16 | "name": "res" 17 | } 18 | ] 19 | } -------------------------------------------------------------------------------- /docs/tests/guides/docker/pull.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "universe.dagger.io/docker" 6 | ) 7 | 8 | dagger.#Plan & { 9 | client: env: { 10 | REGISTRY_USER: string | "_token_" 11 | REGISTRY_PASS: dagger.#Secret 12 | } 13 | 14 | actions: pull: docker.#Pull & { 15 | source: "registry.gitlab.com/example/python:3.9" 16 | auth: { 17 | username: client.env.REGISTRY_USER 18 | secret: client.env.REGISTRY_PASS 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/python/image.cue: -------------------------------------------------------------------------------- 1 | package python 2 | 3 | import ( 4 | "universe.dagger.io/docker" 5 | ) 6 | 7 | #Image: { 8 | // The python version to use 9 | version: *"3.10" | string 10 | 11 | // Whether to use the alpine-based image or not 12 | alpine: *true | false 13 | 14 | docker.#Pull & { 15 | *{ 16 | alpine: true 17 | source: "python:\(version)-alpine" 18 | } | { 19 | alpine: false 20 | source: "python:\(version)" 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /tests/plan/validate/concrete/docker_image.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "universe.dagger.io/docker" 6 | ) 7 | 8 | // BEFORE: failed to execute plan: task failed: actions.test._exec: invalid FS at path "actions.test._exec.input": FS is not set 9 | // AFTER: failed to load plan: "actions.test.input" is not set: 10 | // ../../cue.mod/pkg/universe.dagger.io/docker/run.cue:13:2 11 | 12 | dagger.#Plan & { 13 | actions: test: docker.#Run 14 | } 15 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # syntax = docker/dockerfile:1.2 2 | 3 | FROM golang:1.18.3-alpine AS build 4 | WORKDIR /src 5 | RUN apk add --no-cache file git 6 | ENV GOMODCACHE /root/.cache/gocache 7 | RUN --mount=target=. --mount=target=/root/.cache,type=cache \ 8 | CGO_ENABLED=0 go build -o /out/dagger -ldflags '-s -d -w' ./cmd/dagger; \ 9 | file /out/dagger | grep "statically linked" 10 | 11 | FROM scratch 12 | COPY --from=build /out/dagger /bin/dagger 13 | ENTRYPOINT ["/bin/dagger"] 14 | 15 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/teddylear@protonmail.com/lua/test/fmtCheck.cue: -------------------------------------------------------------------------------- 1 | //Deprecated: in favor of universe.dagger.io/alpha package 2 | package lua 3 | 4 | import ( 5 | "dagger.io/dagger" 6 | "universe.dagger.io/x/teddylear@protonmail.com/lua" 7 | ) 8 | 9 | dagger.#Plan & { 10 | client: filesystem: "./data/hello": read: contents: dagger.#FS 11 | 12 | actions: test: simple: fmtCheck: lua.#StyluaCheck & { 13 | source: client.filesystem."./data/hello".read.contents 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /tests/tasks/dockerfile/dockerfile.cue: -------------------------------------------------------------------------------- 1 | package testing 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | dagger.#Plan & { 9 | client: filesystem: testdata: read: contents: dagger.#FS 10 | 11 | actions: { 12 | build: core.#Dockerfile & { 13 | source: client.filesystem.testdata.read.contents 14 | } 15 | 16 | verify: core.#Exec & { 17 | input: build.output 18 | args: ["sh", "-c", "test $(cat /dir/foo) = foobar"] 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /docs/learn/tests/kube-aws/deployment/input.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "alpha.dagger.io/git" 5 | ) 6 | 7 | manifest: git.#Repository & { 8 | remote: "https://github.com/dagger/examples.git" 9 | ref: "main" 10 | subdir: "todoapp/k8s" 11 | } 12 | 13 | repository: git.#Repository & { 14 | remote: "https://github.com/dagger/examples.git" 15 | ref: "main" 16 | subdir: "todoapp" 17 | } 18 | 19 | registry: "125635003186.dkr.ecr.\(awsConfig.region).amazonaws.com/dagger-ci" 20 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/olli.janatuinen@gmail.com/dotnet/test/test.cue: -------------------------------------------------------------------------------- 1 | //Deprecated: in favor of universe.dagger.io/alpha package 2 | package dotnet 3 | 4 | import ( 5 | "dagger.io/dagger" 6 | "universe.dagger.io/x/olli.janatuinen@gmail.com/dotnet" 7 | ) 8 | 9 | dagger.#Plan & { 10 | client: filesystem: "./data": read: contents: dagger.#FS 11 | 12 | actions: test: dotnet.#Test & { 13 | source: client.filesystem."./data".read.contents 14 | package: "./Greeting.Tests" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/ansible/test/project/main.yml: -------------------------------------------------------------------------------- 1 | - hosts: localhost 2 | connection: local 3 | remote_user: root 4 | vars_files: 5 | - "variables/hello.yml" 6 | handlers: 7 | - name: Install dependencies 8 | import_tasks: "tasks/init.yml" 9 | tasks: 10 | - command: "true" 11 | notify: Install dependencies 12 | - local_action: 13 | module: copy 14 | content: 'Hello {{ person1 }}, here is {{ person2 }}!' 15 | dest: "/tmp/output.yml" -------------------------------------------------------------------------------- /solver/socketprovider_windows.go: -------------------------------------------------------------------------------- 1 | //go:build windows 2 | // +build windows 3 | 4 | package solver 5 | 6 | import ( 7 | "errors" 8 | "net" 9 | "time" 10 | 11 | "github.com/Microsoft/go-winio" 12 | "go.dagger.io/dagger/plancontext" 13 | ) 14 | 15 | func dialSocket(socket *plancontext.Socket) (net.Conn, error) { 16 | if socket.NPipe() == "" { 17 | return nil, errors.New("unsupported socket type") 18 | } 19 | 20 | dur := time.Second 21 | return winio.DialPipe(socket.NPipe(), &dur) 22 | } 23 | -------------------------------------------------------------------------------- /.markdownlint.yaml: -------------------------------------------------------------------------------- 1 | # Default state for all rules 2 | default: true 3 | 4 | # MD001/heading-increment - Do not require h1 -> h2 transitions, 5 | # allow headings with better proportions. 6 | # h2 is too large, h3 is just right so we use h1 -> h3 in places. 7 | MD001: false 8 | 9 | # MD013/line-length - Allow long lines 10 | MD013: false 11 | 12 | # MD033 - Inline HTML. Needed for tabs in docusaurus 13 | MD033: false 14 | 15 | # MD041 - Display Caution block before a top-level heading 16 | MD041: false 17 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/ezequiel@foncubierta.com/terraform/workspace.cue: -------------------------------------------------------------------------------- 1 | //Deprecated: in favor of universe.dagger.io/alpha package 2 | package terraform 3 | 4 | // Subcommands of `terraform workspace` command 5 | #WorkspaceSubcmd: "new" | "select" | "delete" 6 | 7 | // Run `terraform workspace` 8 | #Workspace: #Run & { 9 | // Terraform `workspace` command 10 | cmd: "workspace \(subCmd)" 11 | 12 | // Terraform `workspace` subcommand (i.e. new, select, delete) 13 | subCmd: #WorkspaceSubcmd 14 | } 15 | -------------------------------------------------------------------------------- /tests/tasks/readfile/readfile.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | dagger.#Plan & { 9 | actions: { 10 | image: core.#Pull & { 11 | source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" 12 | } 13 | 14 | readfile: core.#ReadFile & { 15 | input: image.output 16 | path: "/etc/alpine-release" 17 | } & { 18 | // assert result 19 | contents: "3.15.0\n" 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /docs/learn/tests/kube-aws/basic/config.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "alpha.dagger.io/aws" 5 | "alpha.dagger.io/aws/eks" 6 | ) 7 | 8 | // Value created for generic reference of `kubeconfig` in `todoapp.cue` 9 | kubeconfig: eksConfig.kubeconfig 10 | 11 | // awsConfig for Amazon connection 12 | awsConfig: aws.#Config 13 | 14 | // eksConfig used for deployment 15 | eksConfig: eks.#KubeConfig & { 16 | // config field references `gkeConfig` value to set in once 17 | config: awsConfig 18 | } 19 | -------------------------------------------------------------------------------- /docs/learn/tests/kube-gcp/basic/config.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "alpha.dagger.io/gcp" 5 | "alpha.dagger.io/gcp/gke" 6 | ) 7 | 8 | // Value created for generic reference of `kubeconfig` in `todoapp.cue` 9 | kubeconfig: gkeConfig.kubeconfig 10 | 11 | // gcpConfig used for Google connection 12 | gcpConfig: gcp.#Config 13 | 14 | // gkeConfig used for deployment 15 | gkeConfig: gke.#KubeConfig & { 16 | // config field references `gkeConfig` value to set in once 17 | config: gcpConfig 18 | } 19 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/onepassword/read.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -eo pipefail 4 | 5 | set -u 6 | : "$ADDRESS" 7 | : "$EMAIL" 8 | : "$SECRET_KEY" 9 | : "$PASSWORD" 10 | : "$REFERENCE" 11 | 12 | OP_DEVICE=$(head -c 16 /dev/urandom | base32 | tr -d = | tr '[:upper:]' '[:lower:]') 13 | export OP_DEVICE 14 | 15 | eval "$(echo "$PASSWORD" | op account add --signin --address "$ADDRESS" --email "$EMAIL" --secret-key "$SECRET_KEY")" 16 | 17 | op read --force --no-newline "$REFERENCE" > /tmp/secret.txt -------------------------------------------------------------------------------- /pkg/universe.dagger.io/docker/set.cue: -------------------------------------------------------------------------------- 1 | package docker 2 | 3 | import ( 4 | "dagger.io/dagger/core" 5 | ) 6 | 7 | // Change image config 8 | #Set: { 9 | // The source image 10 | input: #Image 11 | 12 | // The image config to change 13 | config: core.#ImageConfig 14 | 15 | _set: core.#Set & { 16 | "input": input.config 17 | "config": config 18 | } 19 | 20 | // Resulting image with the config changes 21 | output: #Image & { 22 | rootfs: input.rootfs 23 | config: _set.output 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/paul@fgtech.fr/ansible/test/project/main.yml: -------------------------------------------------------------------------------- 1 | - hosts: localhost 2 | connection: local 3 | remote_user: root 4 | vars_files: 5 | - "variables/hello.yml" 6 | handlers: 7 | - name: Install dependencies 8 | import_tasks: "tasks/init.yml" 9 | tasks: 10 | - command: "true" 11 | notify: Install dependencies 12 | - local_action: 13 | module: copy 14 | content: 'Hello {{ person1 }}, here is {{ person2 }}!' 15 | dest: "/tmp/output.yml" -------------------------------------------------------------------------------- /tracing.compose.yaml: -------------------------------------------------------------------------------- 1 | version: "3.8" 2 | 3 | services: 4 | buildkitd: 5 | container_name: dagger-buildkitd-jaeger 6 | image: moby/buildkit:latest 7 | privileged: true 8 | environment: 9 | - JAEGER_TRACE=jaeger:6831 10 | - OTEL_EXPORTER_JAEGER_ENDPOINT=http://jaeger:14268/api/traces 11 | 12 | jaeger: 13 | container_name: jaeger 14 | image: jaegertracing/all-in-one:1.33.0 15 | ports: 16 | - "6831:6831/udp" 17 | - "14268:14268" 18 | - "16686:16686" 19 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "gomod" 4 | directory: "/" 5 | schedule: 6 | interval: "daily" 7 | labels: 8 | - "kind/dependencies" 9 | - package-ecosystem: "docker" 10 | directory: "/" 11 | schedule: 12 | interval: "daily" 13 | labels: 14 | - "kind/dependencies" 15 | - package-ecosystem: "npm" 16 | directory: "/website" 17 | schedule: 18 | interval: "daily" 19 | labels: 20 | - "kind/dependencies" 21 | -------------------------------------------------------------------------------- /tests/tasks/scratch/scratch_writefile.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | dagger.#Plan & { 9 | actions: { 10 | write: core.#WriteFile & { 11 | input: dagger.#Scratch 12 | path: "/testing" 13 | contents: "1,2,3" 14 | permissions: 700 15 | } 16 | readfile: core.#ReadFile & { 17 | input: write.output 18 | path: "/testing" 19 | } & { 20 | // assert result 21 | contents: "1,2,3" 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /.github/workflows/deploy-docs.yml: -------------------------------------------------------------------------------- 1 | name: "Deploy Docs" 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | paths: 8 | - "docs/**" 9 | - '.github/workflows/deploy-docs.yml' 10 | 11 | # Allows you to run this workflow manually from the Actions tab 12 | workflow_dispatch: 13 | 14 | jobs: 15 | deploy-docs: 16 | name: "Deploy Docs" 17 | runs-on: ubuntu-latest 18 | steps: 19 | - run: curl -X POST "https://api.netlify.com/build_hooks/${{ secrets.DOCS_NETLIFY_BUILD_HOOK }}" 20 | -------------------------------------------------------------------------------- /tests/plan/validate/concrete/definition.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | // BEFORE: failed to execute plan: task failed: actions.test._op: actions.test._op.source: non-concrete value string 9 | // AFTER: failed to load plan: "actions.test.required" is not concrete: string 10 | 11 | #Test: { 12 | required: string 13 | _op: core.#Pull & { 14 | source: required 15 | } 16 | } 17 | 18 | dagger.#Plan & { 19 | actions: test: #Test & {} 20 | } 21 | -------------------------------------------------------------------------------- /docs/plans/docker-cli-load/local.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "universe.dagger.io/docker" 6 | "universe.dagger.io/docker/cli" 7 | ) 8 | 9 | dagger.#Plan & { 10 | client: network: "unix:///var/run/docker.sock": connect: dagger.#Socket 11 | 12 | actions: { 13 | build: docker.#Build & { 14 | ... 15 | } 16 | 17 | load: cli.#Load & { 18 | image: build.output 19 | host: client.network."unix:///var/run/docker.sock".connect 20 | tag: "myimage" 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /docs/tests/core-concepts/client/plans/env.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "universe.dagger.io/docker" 6 | ) 7 | 8 | dagger.#Plan & { 9 | client: env: { 10 | // load as a string 11 | REGISTRY_USER: string 12 | // load as a secret 13 | REGISTRY_TOKEN: dagger.#Secret 14 | } 15 | 16 | actions: pull: docker.#Pull & { 17 | source: "registry.example.com/image" 18 | auth: { 19 | username: client.env.REGISTRY_USER 20 | secret: client.env.REGISTRY_TOKEN 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/rust/container.cue: -------------------------------------------------------------------------------- 1 | package rust 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "universe.dagger.io/docker" 6 | ) 7 | 8 | #Container: { 9 | // Source code 10 | source: dagger.#FS 11 | 12 | // Rust image 13 | _image: #Image 14 | 15 | _sourcePath: "/src" 16 | 17 | docker.#Run & { 18 | input: *_image.output | docker.#Image 19 | workdir: _sourcePath 20 | command: name: "cargo" 21 | mounts: "source": { 22 | dest: _sourcePath 23 | contents: source 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /tests/tasks/exec/workdir.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | dagger.#Plan & { 9 | actions: { 10 | image: core.#Pull & { 11 | source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" 12 | } 13 | 14 | verify: core.#Exec & { 15 | input: image.output 16 | workdir: "/tmp" 17 | args: [ 18 | "sh", "-c", 19 | #""" 20 | test "$(pwd)" = "/tmp" 21 | """#, 22 | ] 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /docs/tests/core-concepts/client/plans/cmd_stdin.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "strings" 5 | "dagger.io/dagger" 6 | "dagger.io/dagger/core" 7 | ) 8 | 9 | dagger.#Plan & { 10 | client: commands: rev: { 11 | // Print stdin in reverse 12 | // Same as `rev <(echo olleh)` or `echo olleh | rev` 13 | name: "rev" 14 | stdin: "olleh" 15 | } 16 | 17 | actions: test: { 18 | _op: core.#Nop & { 19 | input: strings.TrimSpace(client.commands.rev.stdout) 20 | } 21 | verify: _op.output & "hello" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/berryphillips@gmail.com/onepassword/read.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -eo pipefail 4 | 5 | set -u 6 | : "$ADDRESS" 7 | : "$EMAIL" 8 | : "$SECRET_KEY" 9 | : "$PASSWORD" 10 | : "$REFERENCE" 11 | 12 | OP_DEVICE=$(head -c 16 /dev/urandom | base32 | tr -d = | tr '[:upper:]' '[:lower:]') 13 | export OP_DEVICE 14 | 15 | eval "$(echo "$PASSWORD" | op account add --signin --address "$ADDRESS" --email "$EMAIL" --secret-key "$SECRET_KEY")" 16 | 17 | op read --force --no-newline "$REFERENCE" > /tmp/secret.txt -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/olli.janatuinen@gmail.com/dotnet/image.cue: -------------------------------------------------------------------------------- 1 | //Deprecated: in favor of universe.dagger.io/alpha package 2 | package dotnet 3 | 4 | import ( 5 | "universe.dagger.io/docker" 6 | ) 7 | 8 | // .NET image default version 9 | _#DefaultVersion: "6.0" 10 | 11 | // Pull a dotnet base image 12 | #Image: { 13 | version: *_#DefaultVersion | string 14 | docker.#Build & { 15 | steps: [ 16 | docker.#Pull & { 17 | source: "mcr.microsoft.com/dotnet/sdk:\(version)-alpine" 18 | }, 19 | ] 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /docs/plans/docker-cli-load/local_windows.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "universe.dagger.io/docker" 6 | "universe.dagger.io/docker/cli" 7 | ) 8 | 9 | dagger.#Plan & { 10 | client: network: "npipe:////./pipe/docker_engine": connect: dagger.#Socket 11 | 12 | actions: { 13 | build: docker.#Build & { 14 | ... 15 | } 16 | 17 | load: cli.#Load & { 18 | image: build.output 19 | host: client.network."npipe:////./pipe/docker_engine".connect 20 | tag: "myimage" 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /docs/tests/core-concepts/client/plans/cmd_stderr.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "strings" 5 | "dagger.io/dagger" 6 | "dagger.io/dagger/core" 7 | ) 8 | 9 | dagger.#Plan & { 10 | client: commands: cat: { 11 | name: "sh" 12 | // simulate error output without failed exit status 13 | flags: "-c": """ 14 | cat /foobar 15 | echo ok 16 | """ 17 | } 18 | 19 | actions: test: { 20 | _op: core.#Nop & { 21 | input: strings.TrimSpace(client.commands.cat.stderr) 22 | } 23 | error: _op.output 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /docs/tests/core-concepts/client/plans/unix.cue: -------------------------------------------------------------------------------- 1 | dagger.#Plan & { 2 | client: network: "unix:///var/run/docker.sock": connect: dagger.#Socket 3 | 4 | actions: { 5 | image: alpine.#Build & { 6 | packages: "docker-cli": {} 7 | } 8 | run: docker.#Run & { 9 | input: image.output 10 | mounts: docker: { 11 | dest: "/var/run/docker.sock" 12 | contents: client.network."unix:///var/run/docker.sock".connect 13 | } 14 | command: { 15 | name: "docker" 16 | args: ["info"] 17 | } 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/aws/test/default_version.cue: -------------------------------------------------------------------------------- 1 | package test 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "universe.dagger.io/aws" 6 | "universe.dagger.io/docker" 7 | ) 8 | 9 | dagger.#Plan & { 10 | actions: { 11 | build: aws.#Build 12 | 13 | getVersion: docker.#Run & { 14 | always: true 15 | input: build.output 16 | command: { 17 | name: "sh" 18 | flags: "-c": "aws --version > /output.txt" 19 | } 20 | export: files: "/output.txt": =~"^aws-cli/\(aws.#DefaultCliVersion)" 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/ezequiel@foncubierta.com/terraform/plan.cue: -------------------------------------------------------------------------------- 1 | //Deprecated: in favor of universe.dagger.io/alpha package 2 | package terraform 3 | 4 | // File to write the output plan 5 | _#DefaultPlanFile: "./out.tfplan" 6 | 7 | // Run `terraform plan` 8 | #Plan: #Run & { 9 | // Terraform `plan` command 10 | cmd: "plan" 11 | 12 | // Internal pre-defined arguments for `terraform plan` 13 | withinCmdArgs: ["-out=\(planFile)"] 14 | 15 | // Path to a Terraform plan file 16 | planFile: string | *_#DefaultPlanFile 17 | } 18 | -------------------------------------------------------------------------------- /tests/tasks/exec/env.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | dagger.#Plan & { 9 | actions: { 10 | image: core.#Pull & { 11 | source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" 12 | } 13 | 14 | verify: core.#Exec & { 15 | input: image.output 16 | env: TEST: "hello world" 17 | args: [ 18 | "sh", "-c", 19 | #""" 20 | test "$TEST" = "hello world" 21 | """#, 22 | ] 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /docs/tests/core-concepts/client/plans/windows.cue: -------------------------------------------------------------------------------- 1 | dagger.#Plan & { 2 | client: network: "npipe:////./pipe/docker_engine": connect: dagger.#Socket 3 | 4 | actions: { 5 | image: alpine.#Build & { 6 | packages: "docker-cli": {} 7 | } 8 | run: docker.#Run & { 9 | input: image.output 10 | mounts: docker: { 11 | dest: "/var/run/docker.sock" 12 | contents: client.network."npipe:////./pipe/docker_engine".connect 13 | } 14 | command: { 15 | name: "docker" 16 | args: ["info"] 17 | } 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /tests/plan/client/filesystem/read/fs/relative/test.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | dagger.#Plan & { 9 | client: filesystem: "../rootfs": read: { 10 | contents: dagger.#FS 11 | include: ["*.txt"] 12 | } 13 | actions: test: { 14 | [string]: core.#ReadFile & { 15 | input: client.filesystem."../rootfs".read.contents 16 | } 17 | valid: { 18 | path: "test.txt" 19 | contents: "local directory" 20 | } 21 | notIncluded: path: "test.log" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/netlify/test/testutils/testutils.cue: -------------------------------------------------------------------------------- 1 | package testutils 2 | 3 | import ( 4 | "universe.dagger.io/bash" 5 | "universe.dagger.io/alpine" 6 | ) 7 | 8 | // Assert the text contents available at a URL 9 | #AssertURL: { 10 | url: string 11 | contents: string 12 | 13 | run: bash.#Run & { 14 | input: image.output 15 | script: "contents": """ 16 | test "$(curl \(url))" = "\(contents)" 17 | """ 18 | } 19 | 20 | image: alpine.#Build & { 21 | packages: { 22 | bash: {} 23 | curl: {} 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/ezequiel@foncubierta.com/terraform/destroy.cue: -------------------------------------------------------------------------------- 1 | //Deprecated: in favor of universe.dagger.io/alpha package 2 | package terraform 3 | 4 | // Run `terraform destroy` 5 | #Destroy: #Run & { 6 | // Terraform `destroy` command 7 | cmd: "destroy" 8 | 9 | // Internal pre-defined arguments for `terraform destroy` 10 | withinCmdArgs: [ 11 | if autoApprove { 12 | "-auto-approve" 13 | }, 14 | ] 15 | 16 | // Flag to indicate whether or not to auto-approve (i.e. -auto-approve flag) 17 | autoApprove: bool | *true 18 | } 19 | -------------------------------------------------------------------------------- /tests/tasks/pull/pull.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | dagger.#Plan & { 9 | actions: pull: core.#Pull & { 10 | source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" 11 | } & { 12 | // assert result 13 | digest: "sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" 14 | config: { 15 | env: PATH: "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" 16 | cmd: ["/bin/sh"] 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/ezequiel@foncubierta.com/terraform/image.cue: -------------------------------------------------------------------------------- 1 | //Deprecated: in favor of universe.dagger.io/alpha package 2 | package terraform 3 | 4 | import ( 5 | "universe.dagger.io/docker" 6 | ) 7 | 8 | // Terraform image default version 9 | _#DefaultVersion: "1.1.8" 10 | 11 | // Terraform base image 12 | #Image: { 13 | // Terraform version 14 | version: *_#DefaultVersion | string 15 | 16 | docker.#Build & { 17 | steps: [ 18 | docker.#Pull & { 19 | source: "hashicorp/terraform:\(version)" 20 | }, 21 | ] 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /docs/learn/tests/cloudformation/deletion.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "alpha.dagger.io/os" 5 | "alpha.dagger.io/aws" 6 | "alpha.dagger.io/dagger" 7 | ) 8 | 9 | // Remove Cloudformation Stack 10 | stackRemoval: { 11 | // Cloudformation Stackname 12 | stackName: string & dagger.#Input 13 | 14 | ctr: os.#Container & { 15 | image: aws.#CLI & { 16 | config: awsConfig 17 | } 18 | always: true 19 | env: STACK_NAME: stackName 20 | command: """ 21 | aws cloudformation delete-stack --stack-name $STACK_NAME 22 | """ 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/dotnet/test/data/hello/hello.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | enable 7 | enable 8 | true 9 | linux-musl-x64 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/terraform/apply.cue: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | // Run `terraform apply` 4 | #Apply: #Run & { 5 | // Terraform `apply` command 6 | cmd: "apply" 7 | 8 | // Internal pre-defined arguments for `terraform apply` 9 | withinCmdArgs: [ 10 | if autoApprove { 11 | "-auto-approve" 12 | }, 13 | planFile, 14 | ] 15 | 16 | // Flag to indicate whether or not to auto-approve (i.e. -auto-approve flag) 17 | autoApprove: bool | *true 18 | 19 | // Path to a Terraform plan file 20 | planFile: string | *_#DefaultPlanFile 21 | } 22 | -------------------------------------------------------------------------------- /telemetry/context.go: -------------------------------------------------------------------------------- 1 | package telemetry 2 | 3 | import ( 4 | "context" 5 | ) 6 | 7 | var contextKey struct{} 8 | 9 | func Ctx(ctx context.Context) *Telemetry { 10 | // Return the contextual telemetry 11 | if tm, ok := ctx.Value(contextKey).(*Telemetry); ok { 12 | return tm 13 | } 14 | 15 | // If not available, return a brand new *disabled* telemetry 16 | tm := New() 17 | tm.Disable() 18 | return tm 19 | } 20 | 21 | func (t *Telemetry) WithContext(ctx context.Context) context.Context { 22 | return context.WithValue(ctx, contextKey, t) 23 | } 24 | -------------------------------------------------------------------------------- /tests/tasks/dockerfile/dockerfile_path.cue: -------------------------------------------------------------------------------- 1 | package testing 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | dagger.#Plan & { 9 | client: filesystem: testdata: read: contents: dagger.#FS 10 | 11 | actions: { 12 | build: core.#Dockerfile & { 13 | source: client.filesystem.testdata.read.contents 14 | dockerfile: path: "./dockerfilepath/Dockerfile.custom" 15 | } 16 | 17 | verify: core.#Exec & { 18 | input: build.output 19 | args: ["sh", "-c", "test $(cat /test) = dockerfilePath"] 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/tasks/exec/http_proxy.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | dagger.#Plan & { 9 | actions: { 10 | image: core.#Pull & { 11 | source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" 12 | } 13 | 14 | curlProxy: core.#Exec & { 15 | input: image.output 16 | args: [ 17 | "sh", "-c", 18 | """ 19 | apk add --no-cache curl 20 | curl -sfL -o /dev/null https://www.google.com/ 21 | """, 22 | ] 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /tests/tasks/dockerfile/build_args.cue: -------------------------------------------------------------------------------- 1 | package testing 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | dagger.#Plan & { 9 | client: filesystem: testdata: read: contents: dagger.#FS 10 | 11 | actions: build: core.#Dockerfile & { 12 | source: client.filesystem.testdata.read.contents 13 | dockerfile: contents: """ 14 | FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d 15 | ARG TEST=foo 16 | RUN test "${TEST}" = "bar" 17 | """ 18 | buildArg: TEST: "bar" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /docs/tests/core-concepts/secrets/plans/file.cue: -------------------------------------------------------------------------------- 1 | dagger.#Plan & { 2 | // Path may be absolute, or relative to current working directory 3 | client: filesystem: ".registry": read: { 4 | // CUE type defines expected content 5 | contents: dagger.#Secret 6 | } 7 | actions: { 8 | registry: core.#TrimSecret & { 9 | input: client.filesystem.".registry".read.contents 10 | } 11 | pull: docker.#Pull & { 12 | source: "registry.example.com/image" 13 | auth: { 14 | username: "_token_" 15 | secret: registry.output 16 | } 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/tom.chauveau.pro@icloud.com/kubernetes/test/data/hello-kustomize/deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: dagger-nginx 5 | labels: 6 | dagger-test: dagger-test 7 | spec: 8 | selector: 9 | matchLabels: 10 | app: dagger-nginx 11 | replicas: 1 12 | template: 13 | metadata: 14 | labels: 15 | app: dagger-nginx 16 | spec: 17 | containers: 18 | - name: dagger-nginx 19 | image: nginx:alpine 20 | ports: 21 | - containerPort: 80 -------------------------------------------------------------------------------- /plan/task/nop.go: -------------------------------------------------------------------------------- 1 | package task 2 | 3 | import ( 4 | "context" 5 | 6 | "go.dagger.io/dagger/compiler" 7 | "go.dagger.io/dagger/plancontext" 8 | "go.dagger.io/dagger/solver" 9 | ) 10 | 11 | func init() { 12 | Register("Nop", func() Task { return &nopTask{} }) 13 | } 14 | 15 | type nopTask struct { 16 | } 17 | 18 | func (t *nopTask) Run(_ context.Context, _ *plancontext.Context, _ *solver.Solver, v *compiler.Value) (*compiler.Value, error) { 19 | return compiler.NewValue().FillFields(map[string]interface{}{ 20 | "output": v.Lookup("input"), 21 | }) 22 | } 23 | -------------------------------------------------------------------------------- /tests/plan/validate/concrete/reference.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | // BEFORE: failed to execute plan: task failed: actions.test._op: actions.test._op.source: non-concrete value string 9 | // AFTER: failed to load plan: "actions.test._ref" is not concrete: string 10 | 11 | #Test: { 12 | required: string 13 | _op: core.#Pull & { 14 | source: required 15 | } 16 | } 17 | 18 | dagger.#Plan & { 19 | actions: test: #Test & { 20 | required: _ref 21 | _ref: string 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "license": "Apache-2.0", 3 | "scripts": { 4 | "test": "bats --report-formatter junit --print-output-on-failure --jobs 4 $(find ${TESTDIR:-.} -type f -name '*.bats' -not -path '*/node_modules/*' -not -path '*/x/*')", 5 | "test-experimental": "bats --report-formatter junit --print-output-on-failure --jobs 4 $(find ${TESTDIR:-./x} -type f -name '*.bats' -not -path '*/node_modules/*')" 6 | }, 7 | "devDependencies": { 8 | "bats": "^1.5.0", 9 | "bats-assert": "^2.0.0", 10 | "bats-support": "^0.3.0" 11 | } 12 | } -------------------------------------------------------------------------------- /tests/plan/validate/concrete/fs.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | // BEFORE: failed to execute plan: task failed: actions.test._op: actions.test._op.source: non-concrete value string 9 | // AFTER: failed to load plan: "actions.test.required" is not concrete: string 10 | 11 | #Test: { 12 | required: dagger.#FS 13 | _op: core.#WriteFile & { 14 | input: required 15 | path: "/test" 16 | contents: "test" 17 | } 18 | } 19 | 20 | dagger.#Plan & { 21 | actions: test: #Test & {} 22 | } 23 | -------------------------------------------------------------------------------- /tests/tasks/source/source_relative.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | dagger.#Plan & { 9 | actions: { 10 | image: core.#Pull & { 11 | source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" 12 | } 13 | 14 | source: core.#Source & { 15 | path: "./testdata" 16 | } 17 | 18 | verifyHello: core.#ReadFile & { 19 | input: source.output 20 | path: "/world.txt" 21 | } & { 22 | // assert result 23 | contents: "world\n" 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/olli.janatuinen@gmail.com/dotnet/test/data/hello/hello.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | enable 7 | enable 8 | true 9 | linux-musl-x64 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /tests/tasks/exec/hosts.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | dagger.#Plan & { 9 | actions: { 10 | image: core.#Pull & { 11 | source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" 12 | } 13 | 14 | verify: core.#Exec & { 15 | input: image.output 16 | hosts: "unit.test": "1.2.3.4" 17 | args: [ 18 | "sh", "-c", 19 | #""" 20 | grep -q "unit.test" /etc/hosts 21 | grep -q "1.2.3.4" /etc/hosts 22 | """#, 23 | ] 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | Dagger 2 | Copyright 2012-2017 Dagger, Inc. 3 | 4 | This product includes software developed at Dagger, Inc. (https://www.dagger.io). 5 | 6 | The following is courtesy of our legal counsel: 7 | 8 | 9 | Use and transfer of Dagger may be subject to certain restrictions by the 10 | United States and other governments. 11 | It is your responsibility to ensure that your use and/or transfer does not 12 | violate applicable laws. 13 | 14 | For more information, please see https://www.bis.doc.gov 15 | 16 | See also https://www.apache.org/dev/crypto.html and/or seek legal counsel. 17 | -------------------------------------------------------------------------------- /tests/tasks/dockerfile/labels.cue: -------------------------------------------------------------------------------- 1 | package testing 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | dagger.#Plan & { 9 | client: filesystem: testdata: read: contents: dagger.#FS 10 | 11 | actions: { 12 | // FIXME: this doesn't test anything beside not crashing 13 | build: core.#Dockerfile & { 14 | source: client.filesystem.testdata.read.contents 15 | dockerfile: contents: """ 16 | FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d 17 | """ 18 | label: FOO: "bar" 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /docs/plans/docker-cli-run/ssh.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "universe.dagger.io/docker/cli" 6 | ) 7 | 8 | dagger.#Plan & { 9 | client: filesystem: { 10 | "~/.ssh/id_rsa": read: contents: dagger.#Secret 11 | "~/.ssh/known_hosts": read: contents: dagger.#Secret 12 | } 13 | 14 | actions: run: cli.#Run & { 15 | host: "ssh://root@93.184.216.34" 16 | ssh: { 17 | key: client.filesystem."~/.ssh/id_rsa".read.contents 18 | knownHosts: client.filesystem."~/.ssh/known_hosts".read.contents 19 | } 20 | command: name: "info" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /telemetry/telemetry_test.go: -------------------------------------------------------------------------------- 1 | package telemetry 2 | 3 | import ( 4 | "fmt" 5 | "strings" 6 | "testing" 7 | 8 | "github.com/google/uuid" 9 | "github.com/stretchr/testify/assert" 10 | ) 11 | 12 | func TestDefaultLogFile(t *testing.T) { 13 | lf := New().logFile() 14 | lfs := strings.Split(lf, ".") 15 | prefix, id, ext := lfs[0], lfs[1], lfs[2] 16 | assert.Equal(t, "telemetry", prefix, fmt.Sprintf("log file: %#v", lf)) 17 | assert.NotPanicsf(t, func() { uuid.MustParse(id) }, fmt.Sprintf("log file: %#v", lf)) 18 | assert.Equal(t, "log", ext, fmt.Sprintf("log file: %#v", lf)) 19 | } 20 | -------------------------------------------------------------------------------- /tests/plan/validate/concrete/task.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | // BEFORE: failed to execute plan: task failed: actions.test: actions.test.path: non-concrete value string 9 | // AFTER: failed to load plan: "actions.test.path" is not set: 10 | // ../../cue.mod/pkg/dagger.io/dagger/core/fs.cue:59:2 11 | // "actions.test.contents" is not set: 12 | // ../../cue.mod/pkg/dagger.io/dagger/core/fs.cue:61:2 13 | 14 | dagger.#Plan & { 15 | actions: test: core.#WriteFile & { 16 | input: dagger.#Scratch 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /docs/tests/use-cases/node-ci/test.cue.fragment: -------------------------------------------------------------------------------- 1 | test: { 2 | integrationTest: { 3 | workdir: "./src" 4 | docker.#Run & { 5 | input: build.output 6 | command: { 7 | name: "/bin/bash" 8 | args: ["-c", "npm run test:ci"] 9 | } 10 | } 11 | } 12 | unitTest: { 13 | workdir: "./src" 14 | docker.#Run & { 15 | input: build.output 16 | command: { 17 | name: "/bin/bash" 18 | args: ["-c", "npm run test:unit"] 19 | } 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /tests/tasks/dockerfile/platform.cue: -------------------------------------------------------------------------------- 1 | package testing 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | dagger.#Plan & { 9 | client: filesystem: testdata: read: contents: dagger.#FS 10 | 11 | actions: { 12 | // FIXME: this doesn't test anything beside not crashing 13 | build: core.#Dockerfile & { 14 | source: client.filesystem.testdata.read.contents 15 | dockerfile: contents: """ 16 | FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d 17 | """ 18 | platforms: ["linux/amd64"] 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /docs/tests/core-concepts/secrets/plans/sops.cue: -------------------------------------------------------------------------------- 1 | dagger.#Plan & { 2 | client: commands: sops: { 3 | name: "sops" 4 | args: ["-d", "./secrets.yaml"] 5 | stdout: dagger.#Secret 6 | } 7 | 8 | actions: { 9 | // Makes the yaml keys easily accessible 10 | secrets: core.#DecodeSecret & { 11 | input: client.commands.sops.stdout 12 | format: "yaml" 13 | } 14 | 15 | run: docker.#Run & { 16 | mounts: secret: { 17 | dest: "/run/secrets/token" 18 | contents: secrets.output.myToken.contents 19 | } 20 | // Do something with `/run/secrets/token` 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /docs/tests/guides/handling-outputs/wrapper.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "universe.dagger.io/docker" 6 | ) 7 | 8 | dagger.#Plan & { 9 | actions: { 10 | pull: docker.#Pull & { 11 | source: "alpine" 12 | } 13 | // wrap docker.#Push to have more control over the outputs 14 | push: { 15 | _op: docker.#Push & { 16 | image: pull.output 17 | dest: "localhost:5042/alpine" 18 | } 19 | 20 | // The resulting digest 21 | digest: _op.result 22 | 23 | // The $PATH set in the image 24 | path: _op.image.config.env.PATH 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/contact@kjuulh.io/rust/container.cue: -------------------------------------------------------------------------------- 1 | //Deprecated: in favor of universe.dagger.io/alpha package 2 | package rust 3 | 4 | import ( 5 | "dagger.io/dagger" 6 | "universe.dagger.io/docker" 7 | ) 8 | 9 | #Container: { 10 | // Source code 11 | source: dagger.#FS 12 | 13 | // Rust image 14 | _image: #Image 15 | 16 | _sourcePath: "/src" 17 | 18 | docker.#Run & { 19 | input: *_image.output | docker.#Image 20 | workdir: _sourcePath 21 | command: name: "cargo" 22 | mounts: "source": { 23 | dest: _sourcePath 24 | contents: source 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/kubernetes/kustomize/test/testdata/deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: nginx-deployment 5 | labels: 6 | app: nginx-deployment 7 | spec: 8 | replicas: 1 9 | template: 10 | metadata: 11 | name: nginx-deployment 12 | labels: 13 | app: nginx-deployment 14 | spec: 15 | containers: 16 | - name: nginx-deployment 17 | image: nginx 18 | imagePullPolicy: IfNotPresent 19 | restartPolicy: Always 20 | selector: 21 | matchLabels: 22 | app: nginx-deployment 23 | -------------------------------------------------------------------------------- /tests/tasks/export/export.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | dagger.#Plan & { 9 | actions: test: { 10 | image: core.#Pull & { 11 | source: "alpine:3.15" 12 | } 13 | 14 | export: core.#Export & { 15 | input: image.output 16 | config: image.config 17 | tag: "example" 18 | } 19 | 20 | verify: core.#Exec & { 21 | input: image.output 22 | mounts: exported: { 23 | contents: export.output 24 | dest: "/src" 25 | } 26 | args: ["tar", "tf", "/src/image.tar", "manifest.json"] 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/wangwei27494731@gmail.com/kustomize/test/testdata/deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: nginx-deployment 5 | labels: 6 | app: nginx-deployment 7 | spec: 8 | replicas: 1 9 | template: 10 | metadata: 11 | name: nginx-deployment 12 | labels: 13 | app: nginx-deployment 14 | spec: 15 | containers: 16 | - name: nginx-deployment 17 | image: nginx 18 | imagePullPolicy: IfNotPresent 19 | restartPolicy: Always 20 | selector: 21 | matchLabels: 22 | app: nginx-deployment 23 | -------------------------------------------------------------------------------- /tests/tasks/exec/args.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | dagger.#Plan & { 9 | actions: { 10 | image: core.#Pull & { 11 | source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" 12 | } 13 | 14 | exec: core.#Exec & { 15 | input: image.output 16 | args: ["sh", "-c", "echo -n hello world > /output.txt"] 17 | } 18 | 19 | verify: core.#ReadFile & { 20 | input: exec.output 21 | path: "/output.txt" 22 | } & { 23 | // assert result 24 | contents: "hello world" 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /docs/tests/guides/docker/dockerfile_target.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "universe.dagger.io/docker" 6 | ) 7 | 8 | dagger.#Plan & { 9 | client: filesystem: ".": read: contents: dagger.#FS 10 | 11 | actions: { 12 | build: docker.#Dockerfile & { 13 | source: client.filesystem.".".read.contents 14 | // Use the stage `FROM base as build` 15 | target: "build" 16 | } 17 | 18 | run: docker.#Dockerfile & { 19 | source: client.filesystem.".".read.contents 20 | // Use the stage `FROM base as run` 21 | target: "run" 22 | } 23 | 24 | // push images to registry 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /mod/version.go: -------------------------------------------------------------------------------- 1 | package mod 2 | 3 | import "github.com/hashicorp/go-version" 4 | 5 | // compareVersions returns -1 if the first argument is less or 1 if it's greater than the second argument. 6 | // It returns 0 if they are equal. 7 | func compareVersions(reqV1, reqV2 string) (int, error) { 8 | v1, err := version.NewVersion(reqV1) 9 | if err != nil { 10 | return 0, err 11 | } 12 | 13 | v2, err := version.NewVersion(reqV2) 14 | if err != nil { 15 | return 0, err 16 | } 17 | 18 | if v1.LessThan(v2) { 19 | return -1, nil 20 | } 21 | 22 | if v1.Equal(v2) { 23 | return 0, nil 24 | } 25 | 26 | return 1, nil 27 | } 28 | -------------------------------------------------------------------------------- /tests/plan/hello-europa/main.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | dagger.#Plan & { 9 | actions: test: { 10 | _image: core.#Pull & { 11 | source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" 12 | } 13 | 14 | _exec: core.#Exec & { 15 | input: _image.output 16 | args: ["sh", "-c", "echo -n Hello Europa > /out.txt"] 17 | } 18 | 19 | _verify: core.#ReadFile & { 20 | input: _exec.output 21 | path: "/out.txt" 22 | } & { 23 | // assert result 24 | contents: "Hello Europa" 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /docs/guides/buildkit/1229-empty-buildkit-cache.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: /1229/empty-buildkit-cache 3 | displayed_sidebar: '0.2' 4 | --- 5 | 6 | # How to empty BuildKit's cache ? 7 | 8 | There are two ways of emptying the BuildKit cache: 9 | 10 | - Run your action with the `--no-cache` option: 11 | 12 | ```console 13 | dagger do --no-cache 14 | ``` 15 | 16 | - Stop and remove the buildkitd container then remove its associated volume: 17 | 18 | ```console 19 | docker stop dagger-buildkitd ; docker rm dagger-buildkitd ; docker volume rm dagger-buildkitd 20 | ``` 21 | 22 | In 99.9% of the cases, the first solution is enough 23 | -------------------------------------------------------------------------------- /docs/plans/docker-cli-run/tcp.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "universe.dagger.io/docker/cli" 6 | ) 7 | 8 | dagger.#Plan & { 9 | // Directory with certificates. Needs the following files: 10 | // - ca.pem --> (Certificate authority that signed the registry certificate) 11 | // - cert.pem --> (Client certificate) 12 | // - key.pem --> (Client private key) 13 | client: filesystem: "./certs": read: contents: dagger.#FS 14 | 15 | actions: run: cli.#Run & { 16 | host: "tcp://93.184.216.34:2376" 17 | certs: client.filesystem."./certs".read.contents 18 | command: name: "info" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /docs/new.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## Create a new documentation article 4 | 5 | function new() { 6 | local name 7 | name="$1" 8 | if [ -z "$name" ]; then 9 | echo >&2 "Usage: $0 NAME" 10 | return 1 11 | fi 12 | local last 13 | last="$( 14 | find . -name '[0-9]*.md' | 15 | sed -E -e 's/^.*\/([0-9]+)-([^\/]*)\.md/\1/' | 16 | sort -u -n | 17 | tail -n 1 18 | )" 19 | local next 20 | ((next="$last"+1)) 21 | 22 | local filename="$next-$name.md" 23 | echo "Creating $filename" 24 | cat <<- EOF > "$filename" 25 | --- 26 | slug: /$next/$name 27 | displayed_sidebar: "0.2" 28 | --- 29 | EOF 30 | } 31 | 32 | new "$@" 33 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/ezequiel@foncubierta.com/terraform/apply.cue: -------------------------------------------------------------------------------- 1 | //Deprecated: in favor of universe.dagger.io/alpha package 2 | package terraform 3 | 4 | // Run `terraform apply` 5 | #Apply: #Run & { 6 | // Terraform `apply` command 7 | cmd: "apply" 8 | 9 | // Internal pre-defined arguments for `terraform apply` 10 | withinCmdArgs: [ 11 | if autoApprove { 12 | "-auto-approve" 13 | }, 14 | planFile, 15 | ] 16 | 17 | // Flag to indicate whether or not to auto-approve (i.e. -auto-approve flag) 18 | autoApprove: bool | *true 19 | 20 | // Path to a Terraform plan file 21 | planFile: string | *_#DefaultPlanFile 22 | } 23 | -------------------------------------------------------------------------------- /plancontext/platform.go: -------------------------------------------------------------------------------- 1 | package plancontext 2 | 3 | import ( 4 | "github.com/containerd/containerd/platforms" 5 | specs "github.com/opencontainers/image-spec/specs-go/v1" 6 | ) 7 | 8 | type platformContext struct { 9 | platform *specs.Platform 10 | } 11 | 12 | func (c *platformContext) Get() specs.Platform { 13 | return *c.platform 14 | } 15 | 16 | func (c *platformContext) SetString(platform string) error { 17 | p, err := platforms.Parse(platform) 18 | if err != nil { 19 | return err 20 | } 21 | c.platform = &p 22 | return nil 23 | } 24 | 25 | func (c *platformContext) Set(p specs.Platform) { 26 | c.platform = &p 27 | } 28 | -------------------------------------------------------------------------------- /tests/tasks/writefile/writefile.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | dagger.#Plan & { 9 | actions: { 10 | pull: core.#Pull & { 11 | source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" 12 | } 13 | write: core.#WriteFile & { 14 | input: pull.output 15 | path: "/testing" 16 | contents: "1,2,3" 17 | permissions: 700 18 | } 19 | readfile: core.#ReadFile & { 20 | input: write.output 21 | path: "/testing" 22 | } & { 23 | // assert result 24 | contents: "1,2,3" 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /tests/tasks/exec/env_secret.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | dagger.#Plan & { 9 | client: filesystem: "secret.txt": read: contents: dagger.#Secret 10 | 11 | actions: { 12 | image: core.#Pull & { 13 | source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" 14 | } 15 | 16 | verify: core.#Exec & { 17 | input: image.output 18 | env: TEST: client.filesystem."secret.txt".read.contents 19 | args: [ 20 | "sh", "-c", 21 | #""" 22 | test "$TEST" = "hello world" 23 | """#, 24 | ] 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /docs/guides/docker/1217-docker-cli-run.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: /1217/docker-cli-run 3 | displayed_sidebar: '0.2' 4 | --- 5 | 6 | # Running commands with the docker binary (CLI) 7 | 8 | There's a `universe.dagger.io/docker/cli` package that allows you to run docker commands against a local or remote docker engine. Here's a few examples. 9 | 10 | ## Local daemon 11 | 12 | ```cue file=../../plans/docker-cli-run/local.cue 13 | 14 | ``` 15 | 16 | ## Remote daemon, via SSH 17 | 18 | ```cue file=../../plans/docker-cli-run/ssh.cue 19 | 20 | ``` 21 | 22 | ## Remote daemon, via HTTPS 23 | 24 | ```cue file=../../plans/docker-cli-run/tcp.cue 25 | 26 | ``` 27 | -------------------------------------------------------------------------------- /docs/tests/use-cases/go-docker-swarm/build-action.cue.fragment: -------------------------------------------------------------------------------- 1 | build: { 2 | luaDocs: docker.#Dockerfile & { 3 | source: client.filesystem."./lua-docs".read.contents 4 | } 5 | 6 | _addGithubSHA: core.#WriteFile & { 7 | input: luaDocs.output.rootfs 8 | path: "/www/github_sha.yml" 9 | contents: #""" 10 | keywords: ["particubes", "game", "mobile", "scripting", "cube", "voxel", "world", "docs"] 11 | title: "Github SHA" 12 | blocks: 13 | - text: "\#(client.env.GITHUB_SHA)" 14 | """# 15 | } 16 | image: docker.#Image & { 17 | rootfs: _addGithubSHA.output 18 | config: luaDocs.output.config 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /docs/tests/use-cases/go-docker-swarm/client-api.cue.fragment: -------------------------------------------------------------------------------- 1 | package docs 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | ) 6 | 7 | dagger.#Plan & { 8 | client: { 9 | // Locally, manual source of the .env or install https://direnv.net 10 | env: { 11 | GITHUB_SHA: string 12 | SSH_PRIVATE_KEY_DOCKER_SWARM: dagger.#Secret 13 | } 14 | filesystem: { 15 | "./": read: contents: dagger.#FS 16 | "./merge.output": write: contents: actions.build.image.rootfs // Creates a build artifact for debug 17 | } 18 | network: "unix:///var/run/docker.sock": connect: dagger.#Socket // Docker daemon socket 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /tests/tasks/scratch/scratch.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | dagger.#Plan & { 9 | actions: { 10 | image: core.#Pull & { 11 | source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" 12 | } 13 | 14 | exec: core.#Exec & { 15 | input: image.output 16 | mounts: fs: { 17 | dest: "/scratch" 18 | contents: dagger.#Scratch 19 | } 20 | workdir: "/" 21 | args: [ 22 | "sh", "-c", 23 | #""" 24 | test "$(ls -A /)" != "" 25 | test "$(ls -A /scratch)" = "" 26 | """#, 27 | ] 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /.gitpod.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM gitpod/workspace-go 2 | 3 | RUN sudo mkdir -p /workspace/go/.cache && sudo chown -R gitpod:gitpod /workspace \ 4 | && go install -v github.com/mikefarah/yq/v4@latest \ 5 | && go install -v honnef.co/go/tools/cmd/staticcheck@latest \ 6 | && sudo apt-add-repository ppa:fish-shell/release-3 \ 7 | && sudo apt-add-repository ppa:neovim-ppa/unstable \ 8 | && sudo add-apt-repository ppa:lazygit-team/release \ 9 | && sudo apt update && sudo install-packages \ 10 | fish \ 11 | fzf \ 12 | lazygit \ 13 | luajit \ 14 | neovim \ 15 | shellcheck \ 16 | tmux \ 17 | tree -------------------------------------------------------------------------------- /plan/task/clientplatform.go: -------------------------------------------------------------------------------- 1 | package task 2 | 3 | import ( 4 | "context" 5 | "runtime" 6 | 7 | "go.dagger.io/dagger/compiler" 8 | "go.dagger.io/dagger/plancontext" 9 | "go.dagger.io/dagger/solver" 10 | ) 11 | 12 | func init() { 13 | Register("ClientPlatform", func() Task { return &clientPlatformTask{} }) 14 | } 15 | 16 | type clientPlatformTask struct { 17 | } 18 | 19 | func (t clientPlatformTask) Run(_ context.Context, _ *plancontext.Context, _ *solver.Solver, _ *compiler.Value) (*compiler.Value, error) { 20 | return compiler.NewValue().FillFields(map[string]interface{}{ 21 | "os": runtime.GOOS, 22 | "arch": runtime.GOARCH, 23 | }) 24 | } 25 | -------------------------------------------------------------------------------- /tests/plan/client/filesystem/read/fs/usage/test.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | dagger.#Plan & { 9 | client: filesystem: rootfs: read: { 10 | contents: dagger.#FS 11 | exclude: ["*.log"] 12 | } 13 | actions: test: { 14 | [string]: core.#ReadFile & { 15 | input: client.filesystem.rootfs.read.contents 16 | } 17 | valid: { 18 | path: "test.txt" 19 | contents: "local directory" 20 | } 21 | conflictingValues: { 22 | path: "test.txt" 23 | contents: "local foobar" 24 | } 25 | excluded: path: "test.log" 26 | notExists: path: "test.json" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /docs/includes/dagger-cloud-cta.md: -------------------------------------------------------------------------------- 1 | ## Dagger Cloud 2 | 3 |

Dagger Cloud is a managed service that aims to help you troubleshoot your current dagger runs by storing operation history and enabling functionality such as storing outputs and a comprehensive detailed view of your executions.

4 | 5 | If you're interested in trying out Dagger Cloud, you can find more information in our [docs section](https://docs.dagger.io/1241/dagger-cloud/). Furthermore, if you have any feedback or ideas that could help improve the product, there is an [open discussion](https://lala.com) in GitHub where you can leave us your inputs. 6 | -------------------------------------------------------------------------------- /docs/tests/core-concepts/client/plans/env_optional.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "universe.dagger.io/docker" 6 | ) 7 | 8 | dagger.#Plan & { 9 | client: env: { 10 | // load as a string, using a default if not defined 11 | REGISTRY_USER: string | *"_token_" 12 | // load as a secret, but don't fail if not defined 13 | REGISTRY_TOKEN?: dagger.#Secret 14 | } 15 | 16 | actions: pull: docker.#Pull & { 17 | source: "registry.example.com/image" 18 | if client.env.REGISTRY_TOKEN != _|_ { 19 | auth: { 20 | username: client.env.REGISTRY_USER 21 | secret: client.env.REGISTRY_TOKEN 22 | } 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /tests/tasks/writefile/writefile_failure_diff_contents.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | dagger.#Plan & { 9 | actions: { 10 | pull: core.#Pull & { 11 | source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" 12 | } 13 | write: core.#WriteFile & { 14 | input: pull.output 15 | path: "/testing" 16 | contents: "1,2,3,4" 17 | permissions: 700 18 | } 19 | readfile: core.#ReadFile & { 20 | input: write.output 21 | path: "/testing" 22 | } & { 23 | // assert result 24 | contents: "1,2,3" 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /tests/yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | "bats-assert@https://github.com/bats-core/bats-assert": 6 | version "2.0.0" 7 | resolved "https://github.com/bats-core/bats-assert#4bdd58d3fbcdce3209033d44d884e87add1d8405" 8 | 9 | "bats-support@https://github.com/bats-core/bats-support": 10 | version "0.3.0" 11 | resolved "https://github.com/bats-core/bats-support#d140a65044b2d6810381935ae7f0c94c7023c8c3" 12 | 13 | "bats@https://github.com/bats-core/bats-core#master": 14 | version "1.5.0" 15 | resolved "https://github.com/bats-core/bats-core#172580d2ce19ee33780b5f1df817bbddced43789" 16 | -------------------------------------------------------------------------------- /cmd/dagger/cmd/project/templates/hello.cue: -------------------------------------------------------------------------------- 1 | // The first time you run the hello 2 | // action as `dagger do hello --log-format plain`, 3 | // make sure to run `dagger project update` first, 4 | // so that all required dependencies are available. 5 | 6 | package hello 7 | 8 | import ( 9 | "dagger.io/dagger" 10 | "universe.dagger.io/bash" 11 | "universe.dagger.io/alpine" 12 | 13 | ) 14 | 15 | dagger.#Plan & { 16 | actions: { 17 | _alpine: alpine.#Build & { 18 | packages: bash: _ 19 | } 20 | 21 | // Hello world 22 | hello: bash.#Run & { 23 | input: _alpine.output 24 | script: contents: "echo Hello World" 25 | always: true 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /docs/0.1.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: /0.1 3 | displayed_sidebar: '0.1' 4 | --- 5 | 6 | # Dagger 0.1 7 | 8 | This documentation is for dagger 0.1 which is no longer maintained. 9 | 10 | If you are still running dagger 0.1, we encourage you to upgrade to 0.2. 11 | These are the [current dagger 0.2 docs](/). 12 | 13 | If you need help migrating your plan, we will be happy to assist you! 14 | Simply reply to [this thread](https://github.com/dagger/dagger/discussions/1772) with a description of your configuration. 15 | If you've already started migrating, please let us know and share details of your progress and issues you're encountering. 16 | We will do our best to assist you! 17 | -------------------------------------------------------------------------------- /docs/tests/use-cases/node-ci/static-analysis.cue.fragment: -------------------------------------------------------------------------------- 1 | staticAnalysis: { 2 | lint: 3 | bash.#Run & { 4 | workdir: "./src" 5 | input: build.output 6 | script: contents: #""" 7 | npx eslint --color . 8 | """# 9 | } 10 | sonarscanner: 11 | docker.#Run & { 12 | env: { 13 | GITHUB_BRANCH_NAME: client.env.GITHUB_HEAD_REF 14 | SONAR_LOGIN: client.env.SONAR_LOGIN 15 | SONAR_HOST_URL: "https://sonarcloud.io" 16 | } 17 | workdir: "/usr/src" 18 | input: deps.sonarscanner.output 19 | } 20 | } -------------------------------------------------------------------------------- /pkg/universe.dagger.io/docker/push.cue: -------------------------------------------------------------------------------- 1 | package docker 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | // Upload an image to a remote repository 9 | #Push: { 10 | // Destination ref 11 | dest: #Ref 12 | 13 | // Complete ref after pushing (including digest) 14 | result: #Ref & _push.result 15 | 16 | // Registry authentication 17 | auth?: { 18 | username: string 19 | secret: dagger.#Secret 20 | } 21 | 22 | // Image to push 23 | image: #Image 24 | 25 | _push: core.#Push & { 26 | "dest": dest 27 | if auth != _|_ { 28 | "auth": auth 29 | } 30 | input: image.rootfs 31 | config: image.config 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /tests/tasks/dockerfile/inlined_dockerfile.cue: -------------------------------------------------------------------------------- 1 | package testing 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | dagger.#Plan & { 9 | client: filesystem: testdata: read: contents: dagger.#FS 10 | 11 | actions: { 12 | build: core.#Dockerfile & { 13 | source: client.filesystem.testdata.read.contents 14 | dockerfile: contents: """ 15 | FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d 16 | RUN echo foobar > /output 17 | """ 18 | } 19 | 20 | verify: core.#Exec & { 21 | input: build.output 22 | args: ["sh", "-c", "test $(cat /output) = foobar"] 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /docs/learn/tests/yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | "bats-assert@https://github.com/bats-core/bats-assert": 6 | version "2.0.0" 7 | resolved "https://github.com/bats-core/bats-assert#4bdd58d3fbcdce3209033d44d884e87add1d8405" 8 | 9 | "bats-support@https://github.com/bats-core/bats-support": 10 | version "0.3.0" 11 | resolved "https://github.com/bats-core/bats-support#d140a65044b2d6810381935ae7f0c94c7023c8c3" 12 | 13 | "bats@https://github.com/bats-core/bats-core#master": 14 | version "1.5.0" 15 | resolved "https://github.com/bats-core/bats-core#172580d2ce19ee33780b5f1df817bbddced43789" 16 | -------------------------------------------------------------------------------- /mod/checksum.go: -------------------------------------------------------------------------------- 1 | package mod 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "path" 7 | 8 | "golang.org/x/mod/sumdb/dirhash" 9 | ) 10 | 11 | func dirChecksum(dirPath string) (string, error) { 12 | err := cleanDirForChecksum(dirPath) 13 | if err != nil { 14 | return "", err 15 | } 16 | 17 | checksum, err := dirhash.HashDir(dirPath, "", dirhash.DefaultHash) 18 | if err != nil { 19 | return "", err 20 | } 21 | 22 | return checksum, nil 23 | } 24 | 25 | func cleanDirForChecksum(dirPath string) error { 26 | if err := os.RemoveAll(path.Join(dirPath, ".git")); err != nil { 27 | return fmt.Errorf("error cleaning up .git directory") 28 | } 29 | 30 | return nil 31 | } 32 | -------------------------------------------------------------------------------- /telemetry/event/log.go: -------------------------------------------------------------------------------- 1 | package event 2 | 3 | // LogEmitted represents a log message 4 | type LogEmitted struct { 5 | Message string `json:"message"` 6 | Level string `json:"level"` 7 | 8 | Fields map[string]interface{} `json:"fields"` 9 | } 10 | 11 | func (e LogEmitted) EventName() string { 12 | return "log.emitted" 13 | } 14 | 15 | func (e LogEmitted) EventVersion() string { 16 | return eventVersion 17 | } 18 | 19 | func (e LogEmitted) Validate() error { 20 | switch { 21 | case e.Level == "": 22 | return errEvent("Level", "cannot be empty") 23 | case e.Fields == nil: 24 | return errEvent("Fields", "cannot be empty") 25 | } 26 | 27 | return nil 28 | } 29 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/pulumi/example.cue: -------------------------------------------------------------------------------- 1 | package rawkode_pulumi_example 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "universe.dagger.io/alpha/pulumi" 6 | ) 7 | 8 | dagger.#Plan & { 9 | client: { 10 | filesystem: "./": read: contents: dagger.#FS 11 | env: { 12 | PULUMI_ACCESS_TOKEN: dagger.#Secret 13 | // If not using Pulumi SaaS, use CONFIG_PASSPHRASE 14 | // PULUMI_CONFIG_PASSPHRASE: dagger.#Secret 15 | } 16 | } 17 | actions: rawkode: pulumi.#Up & { 18 | stack: "test" 19 | stackCreate: true 20 | runtime: "nodejs" 21 | accessToken: client.env.PULUMI_ACCESS_TOKEN 22 | source: client.filesystem."./".read.contents 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/baptiste.barbotin@epitech.eu/azure/azure/resourceGroup/create.cue: -------------------------------------------------------------------------------- 1 | package resourceGroup 2 | 3 | import ( 4 | "universe.dagger.io/docker" 5 | ) 6 | 7 | #Create: { 8 | 9 | image: docker.#Image 10 | 11 | // ResourceGroup name 12 | name: string 13 | 14 | // ResourceGroup location 15 | location: string 16 | 17 | // Additional arguments 18 | args: [...string] | *[] 19 | 20 | _run: docker.#Run & { 21 | input: image 22 | command: { 23 | "name": "az" 24 | flags: { 25 | group: true 26 | create: true 27 | "-l": location 28 | "-n": name 29 | } 30 | "args": args 31 | } 32 | } 33 | 34 | output: _run.output 35 | } 36 | -------------------------------------------------------------------------------- /docs/tests/core-concepts/client/plans/file_export.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | 7 | "universe.dagger.io/go" 8 | ) 9 | 10 | dagger.#Plan & { 11 | client: filesystem: output: write: contents: actions.buildhello.output 12 | 13 | actions: buildhello: { 14 | _source: core.#WriteFile & { 15 | input: dagger.#Scratch 16 | path: "/helloworld.go" 17 | contents: """ 18 | package main 19 | import "fmt" 20 | func main() { 21 | fmt.Println("Hello, World!") 22 | } 23 | """ 24 | } 25 | go.#Build & { 26 | source: _source.output 27 | package: "/src/helloworld.go" 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/dotnet/container.cue: -------------------------------------------------------------------------------- 1 | // .NET operation 2 | package dotnet 3 | 4 | import ( 5 | "dagger.io/dagger" 6 | "universe.dagger.io/docker" 7 | ) 8 | 9 | // A standalone dotnet environment to run dotnet command 10 | #Container: { 11 | // Container app name 12 | name: *"dotnet_publisher" | string 13 | 14 | // Source code 15 | source: dagger.#FS 16 | 17 | // Use dotnet image 18 | _image: #Image 19 | 20 | _sourcePath: "/src" 21 | 22 | docker.#Run & { 23 | input: *_image.output | docker.#Image 24 | workdir: "/src" 25 | command: name: "dotnet" 26 | mounts: "source": { 27 | dest: _sourcePath 28 | contents: source 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /docs/tests/guides/docker/build.cue: -------------------------------------------------------------------------------- 1 | // This action builds a docker image from a python app. 2 | #PythonBuild: { 3 | // Source code of the Python application 4 | app: dagger.#FS 5 | 6 | _build: docker.#Build & { 7 | steps: [ 8 | docker.#Pull & { 9 | source: "python:3.9" 10 | }, 11 | docker.#Copy & { 12 | contents: app 13 | dest: "/app" 14 | }, 15 | docker.#Run & { 16 | command: { 17 | name: "pip" 18 | args: ["install", "-r", "/app/requirements.txt"] 19 | } 20 | }, 21 | docker.#Set & { 22 | config: cmd: ["python", "/app/app.py"] 23 | }, 24 | ] 25 | } 26 | 27 | // Resulting container image 28 | image: _build.output 29 | } 30 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/baptiste.barbotin@epitech.eu/azure/test/azureServerless/deploy_function/.gitignore: -------------------------------------------------------------------------------- 1 | bin 2 | obj 3 | csx 4 | .vs 5 | edge 6 | Publish 7 | 8 | *.user 9 | *.suo 10 | *.cscfg 11 | *.Cache 12 | project.lock.json 13 | 14 | /packages 15 | /TestResults 16 | 17 | /tools/NuGet.exe 18 | /App_Data 19 | /secrets 20 | /data 21 | .secrets 22 | appsettings.json 23 | local.settings.json 24 | 25 | node_modules 26 | dist 27 | 28 | # Local python packages 29 | .python_packages/ 30 | 31 | # Python Environments 32 | .env 33 | .venv 34 | env/ 35 | venv/ 36 | ENV/ 37 | env.bak/ 38 | venv.bak/ 39 | 40 | # Byte-compiled / optimized / DLL files 41 | __pycache__/ 42 | *.py[cod] 43 | *$py.class -------------------------------------------------------------------------------- /docs/tests/core-concepts/client/plans/cmd_secret.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "strings" 5 | "dagger.io/dagger" 6 | "dagger.io/dagger/core" 7 | ) 8 | 9 | dagger.#Plan & { 10 | client: { 11 | env: PRIVATE_KEY: string | *"/home/user/.ssh/id_rsa" 12 | commands: { 13 | pkey: { 14 | name: "cat" 15 | args: [env.PRIVATE_KEY] 16 | stdout: dagger.#Secret 17 | } 18 | digest: { 19 | name: "openssl" 20 | args: ["dgst", "-sha256"] 21 | stdin: pkey.stdout // a secret 22 | } 23 | } 24 | } 25 | 26 | actions: test: { 27 | _op: core.#Nop & { 28 | input: strings.TrimSpace(client.commands.digest.stdout) 29 | } 30 | digest: _op.output 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/go/test/container.cue: -------------------------------------------------------------------------------- 1 | package go 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "universe.dagger.io/go" 6 | "universe.dagger.io/alpine" 7 | ) 8 | 9 | dagger.#Plan & { 10 | actions: test: { 11 | _source: dagger.#Scratch & {} 12 | 13 | simple: go.#Container & { 14 | source: _source 15 | command: { 16 | name: "go" 17 | args: ["version"] 18 | } 19 | } 20 | 21 | override: { 22 | base: alpine.#Build & { 23 | packages: go: _ 24 | } 25 | 26 | command: go.#Container & { 27 | input: base.output 28 | source: _source 29 | command: { 30 | name: "go" 31 | args: ["version"] 32 | } 33 | } 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /docs/tests/core-concepts/plan/structure.cue.fragment: -------------------------------------------------------------------------------- 1 | // ... 2 | // A plan has pre-requisites that we cover below. 3 | // For now we focus on the dagger.#Plan structure. 4 | // ... 5 | 6 | dagger.#Plan & { 7 | client: { 8 | filesystem: { 9 | // ... 10 | } 11 | env: { 12 | // ... 13 | } 14 | } 15 | actions: { 16 | deps: docker.#Build & { 17 | // ... 18 | } 19 | test: bash.#Run & { 20 | // ... 21 | } 22 | build: { 23 | run: bash.#Run & { 24 | // ... 25 | } 26 | contents: core.#Subdir & { 27 | // ... 28 | } 29 | } 30 | deploy: netlify.#Deploy & { 31 | // ... 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/dotnet/publish.cue: -------------------------------------------------------------------------------- 1 | package dotnet 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | ) 6 | 7 | // Publish a dotnet binary 8 | #Publish: { 9 | // Source code 10 | source: dagger.#FS 11 | 12 | // Target package to publish 13 | package: *"." | string 14 | 15 | env: [string]: string 16 | 17 | container: #Container & { 18 | "source": source 19 | "env": { 20 | env 21 | } 22 | command: { 23 | args: [package] 24 | flags: { 25 | publish: true 26 | "-o": "/output/" 27 | } 28 | } 29 | export: directories: "/output": _ 30 | } 31 | 32 | // Directory containing the output of the publish 33 | output: container.export.directories."/output" 34 | } 35 | -------------------------------------------------------------------------------- /docs/learn/tests/cloudformation/source-end.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "alpha.dagger.io/aws" 5 | "alpha.dagger.io/dagger" 6 | "alpha.dagger.io/random" 7 | "alpha.dagger.io/aws/cloudformation" 8 | ) 9 | 10 | // AWS account: credentials and region 11 | awsConfig: aws.#Config 12 | 13 | // Create a random suffix 14 | suffix: random.#String & { 15 | seed: "" 16 | } 17 | 18 | // Query the Cloudformation stackname, or create one with a random suffix for uniqueness 19 | cfnStackName: *"stack-\(suffix.out)" | string & dagger.#Input 20 | 21 | // AWS Cloudformation stdlib 22 | cfnStack: cloudformation.#Stack & { 23 | config: awsConfig 24 | stackName: cfnStackName 25 | source: template 26 | } 27 | -------------------------------------------------------------------------------- /plancontext/localdir.go: -------------------------------------------------------------------------------- 1 | package plancontext 2 | 3 | import ( 4 | "path/filepath" 5 | "sync" 6 | ) 7 | 8 | type localDirContext struct { 9 | l sync.RWMutex 10 | store []string 11 | } 12 | 13 | func (c *localDirContext) Add(dir string) { 14 | c.l.Lock() 15 | defer c.l.Unlock() 16 | 17 | c.store = append(c.store, dir) 18 | } 19 | 20 | func (c *localDirContext) Paths() (map[string]string, error) { 21 | c.l.RLock() 22 | defer c.l.RUnlock() 23 | 24 | directories := make(map[string]string) 25 | for _, d := range c.store { 26 | abs, err := filepath.Abs(d) 27 | if err != nil { 28 | return nil, err 29 | } 30 | 31 | directories[d] = abs 32 | } 33 | 34 | return directories, nil 35 | } 36 | -------------------------------------------------------------------------------- /tests/plan/validate/undefined/undefined.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | dagger.#Plan & { 9 | client: {} 10 | 11 | actions: test: { 12 | undefinedAction: core.#Nop & { 13 | input: actions.nonexistent 14 | } 15 | 16 | undefinedDef: core.#NonExistent & { 17 | input: dagger.#Scratch 18 | } 19 | 20 | filesystem: core.#Nop & { 21 | input: client.filesystem."/non/existent".read.contents 22 | } 23 | 24 | interpolation: core.#ReadFile & { 25 | input: dagger.#Scratch 26 | path: "/wrong/\(core.#NonExistent)" 27 | } 28 | 29 | disjunction: string | *"default" 30 | disjunction: core.#NonExistent 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /tests/plan/with/with.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | dagger.#Plan & { 9 | actions: { 10 | params: foo?: string 11 | 12 | _image: core.#Pull & { 13 | source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" 14 | } 15 | 16 | test: { 17 | [string]: core.#Exec & { 18 | input: _image.output 19 | env: FOO: string 20 | args: [ 21 | "sh", "-c", 22 | #""" 23 | test -n "$FOO" 24 | """#, 25 | ] 26 | } 27 | 28 | direct: env: FOO: *"direct" | string 29 | if params.foo != _|_ { 30 | "params": env: FOO: params.foo 31 | } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /ci/markdownlint/markdownlint.cue: -------------------------------------------------------------------------------- 1 | package markdownlint 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | 6 | "universe.dagger.io/docker" 7 | ) 8 | 9 | #Lint: { 10 | // Source code 11 | source: dagger.#FS 12 | 13 | // shellcheck version 14 | version: *"0.31.1" | string 15 | 16 | // Files to lint 17 | files: [...string] 18 | 19 | _image: docker.#Pull & { 20 | source: "tmknom/markdownlint:\(version)" 21 | } 22 | 23 | docker.#Run & { 24 | input: _image.output 25 | mounts: "source": { 26 | dest: "/src" 27 | contents: source 28 | } 29 | workdir: "/src" 30 | command: { 31 | // FIXME: this should not be required 32 | name: "markdownlint" 33 | args: files 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /cmd/dagger/cmd/project/projectroot.go: -------------------------------------------------------------------------------- 1 | package project 2 | 3 | import ( 4 | "github.com/spf13/cobra" 5 | "github.com/spf13/viper" 6 | ) 7 | 8 | var Cmd = &cobra.Command{ 9 | Use: "project", 10 | Short: "Manage a Dagger project", 11 | // Args: cobra.NoArgs, 12 | PreRun: func(cmd *cobra.Command, args []string) { 13 | // Fix Viper bug for duplicate flags: 14 | // https://github.com/spf13/viper/issues/233 15 | if err := viper.BindPFlags(cmd.Flags()); err != nil { 16 | panic(err) 17 | } 18 | }, 19 | } 20 | 21 | func init() { 22 | if err := viper.BindPFlags(Cmd.Flags()); err != nil { 23 | panic(err) 24 | } 25 | 26 | Cmd.AddCommand( 27 | initCmd, 28 | updateCmd, 29 | infoCmd, 30 | ) 31 | } 32 | -------------------------------------------------------------------------------- /docs/learn/tests/kube-aws/cue-manifest/config.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "alpha.dagger.io/aws" 5 | "alpha.dagger.io/aws/eks" 6 | "alpha.dagger.io/aws/ecr" 7 | ) 8 | 9 | // Value created for generic reference of `kubeconfig` in `todoapp.cue` 10 | kubeconfig: eksConfig.kubeconfig 11 | 12 | // awsConfig for Amazon connection 13 | awsConfig: aws.#Config 14 | 15 | // eksConfig used for deployment 16 | eksConfig: eks.#KubeConfig & { 17 | // config field references `awsConfig` value to set in once 18 | config: awsConfig 19 | } 20 | 21 | // ecrCreds used for remote image push 22 | ecrCreds: ecr.#Credentials & { 23 | // config field references `awsConfig` value to set in once 24 | config: awsConfig 25 | } 26 | -------------------------------------------------------------------------------- /docs/learn/tests/kube-aws/deployment/config.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "alpha.dagger.io/aws" 5 | "alpha.dagger.io/aws/eks" 6 | "alpha.dagger.io/aws/ecr" 7 | ) 8 | 9 | // Value created for generic reference of `kubeconfig` in `todoapp.cue` 10 | kubeconfig: eksConfig.kubeconfig 11 | 12 | // awsConfig for Amazon connection 13 | awsConfig: aws.#Config 14 | 15 | // eksConfig used for deployment 16 | eksConfig: eks.#KubeConfig & { 17 | // config field references `awsConfig` value to set in once 18 | config: awsConfig 19 | } 20 | 21 | // ecrCreds used for remote image push 22 | ecrCreds: ecr.#Credentials & { 23 | // config field references `awsConfig` value to set in once 24 | config: awsConfig 25 | } 26 | -------------------------------------------------------------------------------- /docs/tests/guides/container-images/simple/with-dockerfile.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "universe.dagger.io/docker" 6 | ) 7 | 8 | // This action builds a docker image from a python app. 9 | // Build steps are defined in an inline Dockerfile. 10 | #PythonBuild: docker.#Dockerfile & { 11 | dockerfile: contents: """ 12 | FROM python:3.9 13 | COPY . /app 14 | RUN pip install -r /app/requirements.txt 15 | CMD python /app/app.py 16 | """ 17 | } 18 | 19 | // Example usage in a plan 20 | dagger.#Plan & { 21 | client: filesystem: "./src": read: contents: dagger.#FS 22 | 23 | actions: build: #PythonBuild & { 24 | source: client.filesystem."./src".read.contents 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /tests/tasks/dockerfile/inlined_dockerfile_heredoc.cue: -------------------------------------------------------------------------------- 1 | package testing 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | dagger.#Plan & { 9 | client: filesystem: testdata: read: contents: dagger.#FS 10 | 11 | actions: { 12 | build: core.#Dockerfile & { 13 | source: client.filesystem.testdata.read.contents 14 | dockerfile: contents: """ 15 | # syntax = docker/dockerfile:1.3 16 | FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d 17 | RUN echo foobar > /output 18 | """ 19 | } 20 | 21 | verify: core.#Exec & { 22 | input: build.output 23 | args: ["sh", "-c", "test $(cat /output) = foobar"] 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /docs/learn/tests/kube-gcp/cue-manifest/config.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "alpha.dagger.io/gcp" 5 | "alpha.dagger.io/gcp/gcr" 6 | "alpha.dagger.io/gcp/gke" 7 | ) 8 | 9 | // Value created for generic reference of `kubeconfig` in `todoapp.cue` 10 | kubeconfig: gkeConfig.kubeconfig 11 | 12 | // gcpConfig used for Google connection 13 | gcpConfig: gcp.#Config 14 | 15 | // gkeConfig used for deployment 16 | gkeConfig: gke.#KubeConfig & { 17 | // config field references `gkeConfig` value to set in once 18 | config: gcpConfig 19 | } 20 | 21 | // gcrCreds used for remote image push 22 | gcrCreds: gcr.#Credentials & { 23 | // config field references `gcpConfig` value to set in once 24 | config: gcpConfig 25 | } 26 | -------------------------------------------------------------------------------- /docs/learn/tests/kube-gcp/deployment/config.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "alpha.dagger.io/gcp" 5 | "alpha.dagger.io/gcp/gcr" 6 | "alpha.dagger.io/gcp/gke" 7 | ) 8 | 9 | // Value created for generic reference of `kubeconfig` in `todoapp.cue` 10 | kubeconfig: gkeConfig.kubeconfig 11 | 12 | // gcpConfig used for Google connection 13 | gcpConfig: gcp.#Config 14 | 15 | // gkeConfig used for deployment 16 | gkeConfig: gke.#KubeConfig & { 17 | // config field references `gkeConfig` value to set in once 18 | config: gcpConfig 19 | } 20 | 21 | // gcrCreds used for remote image push 22 | gcrCreds: gcr.#Credentials & { 23 | // config field references `gcpConfig` value to set in once 24 | config: gcpConfig 25 | } 26 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/rust/publish.cue: -------------------------------------------------------------------------------- 1 | package rust 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | ) 6 | 7 | // Publish a rust binary 8 | #Publish: { 9 | // Source code 10 | source: dagger.#FS 11 | 12 | env: [string]: string 13 | 14 | container: #Container & { 15 | "source": source 16 | "env": { 17 | env 18 | CARGO_TARGET_DIR: "/output/" 19 | } 20 | command: { 21 | name: "cargo" 22 | flags: { 23 | build: true 24 | "--release": true 25 | "--manifest-path": "/src/Cargo.toml" 26 | } 27 | } 28 | export: directories: "/output": _ 29 | } 30 | 31 | // Directory containing the output of the publish 32 | output: container.export.directories."/output" 33 | } 34 | -------------------------------------------------------------------------------- /tests/tasks/dockerfile/image_config.cue: -------------------------------------------------------------------------------- 1 | package testing 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | dagger.#Plan & { 9 | client: filesystem: testdata: read: contents: dagger.#FS 10 | 11 | actions: { 12 | // FIXME: this doesn't test anything beside not crashing 13 | build: core.#Dockerfile & { 14 | source: client.filesystem.testdata.read.contents 15 | dockerfile: contents: """ 16 | FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d 17 | ENV test foobar 18 | CMD /test-cmd 19 | """ 20 | } & { 21 | config: { 22 | env: test: "foobar" 23 | cmd: ["/bin/sh", "-c", "/test-cmd"] 24 | } 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /ci/golangci/lint.cue: -------------------------------------------------------------------------------- 1 | package golangci 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | 6 | "universe.dagger.io/docker" 7 | "universe.dagger.io/go" 8 | ) 9 | 10 | // Lint using golangci-lint 11 | #Lint: { 12 | // Source code 13 | source: dagger.#FS 14 | 15 | // golangci-lint version 16 | version: *"1.45" | string 17 | 18 | // timeout 19 | timeout: *"5m" | string 20 | 21 | _image: docker.#Pull & { 22 | source: "golangci/golangci-lint:v\(version)" 23 | } 24 | 25 | go.#Container & { 26 | "source": source 27 | input: _image.output 28 | command: { 29 | name: "golangci-lint" 30 | flags: { 31 | run: true 32 | "-v": true 33 | "--timeout": timeout 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/baptiste.barbotin@epitech.eu/azure/test/azureServerless/deploy_function/HttpExample/index.js: -------------------------------------------------------------------------------- 1 | module.exports = async function (context, req) { 2 | context.log('JavaScript HTTP trigger function processed a request.'); 3 | 4 | const name = (req.query.name || (req.body && req.body.name)); 5 | const responseMessage = name 6 | ? "Hello, " + name + ". This HTTP triggered function executed successfully." 7 | : "This HTTP triggered function executed successfully. Pass a name in the query string or in the request body for a personalized response."; 8 | 9 | context.res = { 10 | // status: 200, /* Defaults to 200 */ 11 | body: responseMessage 12 | }; 13 | } -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/ansible/args.cue: -------------------------------------------------------------------------------- 1 | package ansible 2 | 3 | import ( 4 | "strings" 5 | ) 6 | 7 | #InventoryArg: { 8 | inventoryInput: #Inventory 9 | arg: "-i inventory/\(inventoryInput.file)" 10 | } | { 11 | inventoryInput: null 12 | arg: "" 13 | } 14 | 15 | #ExtraVarsArg: { 16 | extraVarsInput: [string] 17 | arg: "--extra-vars \(strings.Join(extraVarsInput, " "))" 18 | } | { 19 | extraVarsInput: null 20 | arg: "" 21 | } 22 | 23 | #LogLevelArg: { 24 | logLevelInput: 0 25 | arg: "" 26 | } | { 27 | logLevelInput: 1 28 | arg: "-v" 29 | } | { 30 | logLevelInput: 2 31 | arg: "-vv" 32 | } | { 33 | logLevelInput: 3 34 | arg: "-vvv" 35 | } 36 | -------------------------------------------------------------------------------- /analytics/git_test.go: -------------------------------------------------------------------------------- 1 | package analytics 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/stretchr/testify/require" 7 | ) 8 | 9 | func TestParseGit(t *testing.T) { 10 | var ( 11 | endpoint string 12 | err error 13 | ) 14 | 15 | endpoint, err = parseGitURL("https://github.com/dagger/dagger") 16 | require.NoError(t, err) 17 | require.Equal(t, endpoint, "github.com/dagger/dagger") 18 | 19 | endpoint, err = parseGitURL("https://github.com/dagger/dagger.git") 20 | require.NoError(t, err) 21 | require.Equal(t, endpoint, "github.com/dagger/dagger") 22 | 23 | endpoint, err = parseGitURL("git@github.com:dagger/dagger.git") 24 | require.NoError(t, err) 25 | require.Equal(t, endpoint, "github.com/dagger/dagger") 26 | } 27 | -------------------------------------------------------------------------------- /docs/plans/docker-cli-load/ssh.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "universe.dagger.io/docker" 6 | "universe.dagger.io/docker/cli" 7 | ) 8 | 9 | dagger.#Plan & { 10 | client: filesystem: { 11 | "~/.ssh/id_rsa": read: contents: dagger.#Secret 12 | "~/.ssh/known_hosts": read: contents: dagger.#Secret 13 | } 14 | 15 | actions: { 16 | build: docker.#Build & { 17 | ... 18 | } 19 | 20 | load: cli.#Load & { 21 | image: build.output 22 | tag: "myimage:v2" 23 | host: "ssh://root@93.184.216.34" 24 | ssh: { 25 | key: client.filesystem."~/.ssh/id_rsa".read.contents 26 | knownHosts: client.filesystem."~/.ssh/known_hosts".read.contents 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /docs/learn/tests/kube-aws/cue-manifest/manifest.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "encoding/yaml" 5 | ) 6 | 7 | // Define and generate kubernetes deployment to deploy to kubernetes cluster 8 | #AppManifest: { 9 | // Name of the application 10 | name: string 11 | 12 | // Image to deploy to 13 | image: string 14 | 15 | // Define a kubernetes deployment object 16 | deployment: #Deployment & { 17 | "name": name 18 | "image": image 19 | } 20 | 21 | // Define a kubernetes service object 22 | service: #Service & { 23 | "name": name 24 | ports: http: deployment.port 25 | } 26 | 27 | // Merge definitions and convert them back from CUE to YAML 28 | manifest: yaml.MarshalStream([deployment.manifest, service.manifest]) 29 | } 30 | -------------------------------------------------------------------------------- /docs/learn/tests/kube-gcp/cue-manifest/manifest.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "encoding/yaml" 5 | ) 6 | 7 | // Define and generate kubernetes deployment to deploy to kubernetes cluster 8 | #AppManifest: { 9 | // Name of the application 10 | name: string 11 | 12 | // Image to deploy to 13 | image: string 14 | 15 | // Define a kubernetes deployment object 16 | deployment: #Deployment & { 17 | "name": name 18 | "image": image 19 | } 20 | 21 | // Define a kubernetes service object 22 | service: #Service & { 23 | "name": name 24 | ports: http: deployment.port 25 | } 26 | 27 | // Merge definitions and convert them back from CUE to YAML 28 | manifest: yaml.MarshalStream([deployment.manifest, service.manifest]) 29 | } 30 | -------------------------------------------------------------------------------- /docs/learn/tests/kube-kind/cue-manifest/manifest.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "encoding/yaml" 5 | ) 6 | 7 | // Define and generate kubernetes deployment to deploy to kubernetes cluster 8 | #AppManifest: { 9 | // Name of the application 10 | name: string 11 | 12 | // Image to deploy to 13 | image: string 14 | 15 | // Define a kubernetes deployment object 16 | deployment: #Deployment & { 17 | "name": name 18 | "image": image 19 | } 20 | 21 | // Define a kubernetes service object 22 | service: #Service & { 23 | "name": name 24 | ports: http: deployment.port 25 | } 26 | 27 | // Merge definitions and convert them back from CUE to YAML 28 | manifest: yaml.MarshalStream([deployment.manifest, service.manifest]) 29 | } 30 | -------------------------------------------------------------------------------- /tests/README.md: -------------------------------------------------------------------------------- 1 | # Testing 2 | 3 | ## TL;DR 4 | 5 | ```shell 6 | # Install dependencies 7 | yarn install 8 | 9 | # Install gnu parallel if needed 10 | # macOS 11 | brew install parallel 12 | # Debian derivatives 13 | # apt-get install parallel 14 | 15 | # Install sops if needed 16 | # macOS 17 | brew install sops 18 | 19 | # Run all tests 20 | yarn test 21 | ``` 22 | 23 | By default, the `dagger` binary is expected to be found in `../cmd/dagger/dagger` relative to the `tests` directory. 24 | 25 | If you need to change this, pass along `DAGGER_BINARY=somewhere/dagger` 26 | 27 | ## Run a single test 28 | 29 | To run a single test: 30 | 31 | ```shell 32 | make && ./tests/node_modules/.bin/bats "./tests/.bats" -f "" 33 | ``` 34 | -------------------------------------------------------------------------------- /docs/tests/guides/persistent-cache/build.cue: -------------------------------------------------------------------------------- 1 | package ci 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "universe.dagger.io/go" 6 | ) 7 | 8 | dagger.#Plan & { 9 | // Retrieve source from current directory 10 | // Input 11 | client: filesystem: ".": read: { 12 | contents: dagger.#FS 13 | // Include only contents we need to build our project 14 | // Any other files or patterns can be added 15 | include: ["**/*.go", "go.mod", "go.sum"] 16 | } 17 | 18 | // Output 19 | client: filesystem: "./output": write: contents: actions.build.output 20 | 21 | actions: { 22 | // Alias on source 23 | _source: client.filesystem.".".read.contents 24 | 25 | // Build go binary 26 | build: go.#Build & { 27 | source: _source 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /tests/tasks/mkdir/mkdir.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | dagger.#Plan & { 9 | actions: { 10 | image: core.#Pull & { 11 | source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" 12 | } 13 | 14 | mkdir: core.#Mkdir & { 15 | input: image.output 16 | path: "/test" 17 | } 18 | 19 | writeChecker: core.#WriteFile & { 20 | input: mkdir.output 21 | path: "/test/foo" 22 | contents: "bar" 23 | permissions: 700 24 | } 25 | 26 | readChecker: core.#ReadFile & { 27 | input: writeChecker.output 28 | path: "/test/foo" 29 | } & { 30 | // assert result 31 | contents: "bar" 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/kubernetes/kustomize/image.cue: -------------------------------------------------------------------------------- 1 | package kustomize 2 | 3 | import ( 4 | "universe.dagger.io/docker" 5 | "universe.dagger.io/alpine" 6 | "universe.dagger.io/bash" 7 | ) 8 | 9 | #Image: { 10 | // Kustomize binary version 11 | version: *"3.8.7" | string 12 | 13 | docker.#Build & { 14 | steps: [ 15 | alpine.#Build & { 16 | packages: { 17 | bash: {} 18 | curl: {} 19 | } 20 | }, 21 | bash.#Run & { 22 | env: VERSION: version 23 | script: contents: #""" 24 | # download Kustomize binary 25 | curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash -s $VERSION && mv kustomize /usr/local/bin 26 | """# 27 | }, 28 | ] 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/rust/image.cue: -------------------------------------------------------------------------------- 1 | package rust 2 | 3 | import ( 4 | "universe.dagger.io/docker" 5 | ) 6 | 7 | // rust image default version 8 | _#DefaultVersion: "1.60" 9 | 10 | // Pull rust base image 11 | #Image: { 12 | version: *_#DefaultVersion | string 13 | 14 | packages: [pkgName=string]: version: string | *"" 15 | 16 | docker.#Build & { 17 | steps: [ 18 | docker.#Pull & { 19 | source: "rust:\(version)-alpine" 20 | }, 21 | for pkgName, pkg in packages { 22 | docker.#Run & { 23 | command: { 24 | name: "apk" 25 | args: ["add", "\(pkgName)\(pkg.version)"] 26 | flags: { 27 | "-U": true 28 | "--no-cache": true 29 | } 30 | } 31 | } 32 | }, 33 | ] 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /ci/shellcheck/shellcheck.cue: -------------------------------------------------------------------------------- 1 | package shellcheck 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | 6 | "universe.dagger.io/docker" 7 | ) 8 | 9 | #Lint: { 10 | // Source code 11 | source: dagger.#FS 12 | 13 | // shellcheck version 14 | version: *"0.8.0" | string 15 | 16 | _image: docker.#Pull & { 17 | source: "koalaman/shellcheck-alpine:v\(version)" 18 | } 19 | 20 | docker.#Run & { 21 | input: _image.output 22 | mounts: "source": { 23 | dest: "/src" 24 | contents: source 25 | } 26 | workdir: "/src" 27 | command: { 28 | name: "sh" 29 | args: ["-c", #""" 30 | shellcheck $(find . -type f \( -iname \*.bats -o -iname \*.bash -o -iname \*.sh \) -not -path "*/node_modules/*" -not -path "*/bats-*/*") 31 | """#] 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/alpha/onepassword/onepassword.cue: -------------------------------------------------------------------------------- 1 | package onepassword 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | ) 6 | 7 | #Credentials: { 8 | // The sign-in address for the account 9 | address: dagger.#Secret 10 | 11 | // The email adress associated with the account 12 | email: dagger.#Secret 13 | 14 | // The secret key 15 | secretKey: dagger.#Secret 16 | 17 | // The password 18 | password: dagger.#Secret 19 | } 20 | 21 | #Reference: { 22 | // The vault name 23 | vault: string 24 | 25 | // The item name 26 | item: string 27 | 28 | // The section label (optional) 29 | section: string | *"" 30 | 31 | // The field label 32 | field: string 33 | 34 | output: "op://\(vault)/\(item)/\(section)/\(field)" 35 | } 36 | 37 | _#Version: "2" 38 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/olli.janatuinen@gmail.com/dotnet/container.cue: -------------------------------------------------------------------------------- 1 | //Deprecated: in favor of universe.dagger.io/alpha package 2 | // .NET operation 3 | package dotnet 4 | 5 | import ( 6 | "dagger.io/dagger" 7 | "universe.dagger.io/docker" 8 | ) 9 | 10 | // A standalone dotnet environment to run dotnet command 11 | #Container: { 12 | // Container app name 13 | name: *"dotnet_publisher" | string 14 | 15 | // Source code 16 | source: dagger.#FS 17 | 18 | // Use dotnet image 19 | _image: #Image 20 | 21 | _sourcePath: "/src" 22 | 23 | docker.#Run & { 24 | input: *_image.output | docker.#Image 25 | workdir: "/src" 26 | command: name: "dotnet" 27 | mounts: "source": { 28 | dest: _sourcePath 29 | contents: source 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /tests/tasks/hidden/hidden.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | "testing.dagger.io/hidden" 7 | ) 8 | 9 | dagger.#Plan & { 10 | actions: { 11 | pull: core.#Pull & { 12 | source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" 13 | } 14 | _write: core.#WriteFile & { 15 | input: pull.output 16 | path: "/testing" 17 | contents: "1,2,3" 18 | permissions: 700 19 | } 20 | readfile: core.#ReadFile & { 21 | input: _write.output 22 | path: "/testing" 23 | } & { 24 | // assert result 25 | contents: "1,2,3" 26 | } 27 | hiddenTasks: hidden.#Hidden & { 28 | // assert result 29 | contents: "1,2,3" 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /website/netlify.toml: -------------------------------------------------------------------------------- 1 | [build] 2 | publish = "build/" 3 | command = "yarn build" 4 | environment = { NODE_VERSION = "16.14" } 5 | 6 | [context.production] 7 | ignore = "false" 8 | 9 | [context.deploy-preview] 10 | ignore = "false" 11 | 12 | [[redirects]] 13 | # Embargoes compliance. DO NOT REMOVE 14 | conditions = {Country = ["CU", "IR", "KP", "SY", "UA"]} 15 | from = "/*" 16 | to = "/restricted" 17 | status = 302 18 | force = true 19 | 20 | [[redirects]] 21 | from = "/t" 22 | to = "https://api.amplitude.com" 23 | status = 200 24 | 25 | [[redirects]] 26 | from = "/reference" 27 | to = "/reference/alpine" 28 | status = 302 29 | 30 | [[headers]] 31 | for = "/*" 32 | [headers.values] 33 | Referrer-policy = "no-referrer-when-downgrade" 34 | -------------------------------------------------------------------------------- /website/static/img/Dagger_Icons_Caution.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/plan/client/filesystem/write/multiple/test.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | dagger.#Plan & { 9 | client: { 10 | env: TMP_DIR: string // supports dynamic paths as well 11 | filesystem: { 12 | foo: write: { 13 | path: env.TMP_DIR 14 | contents: actions.test.foo.output 15 | } 16 | bar: write: { 17 | path: env.TMP_DIR 18 | contents: actions.test.bar.output 19 | } 20 | } 21 | } 22 | actions: test: { 23 | foo: core.#WriteFile & { 24 | input: dagger.#Scratch 25 | path: "/foo.txt" 26 | contents: "foo" 27 | } 28 | bar: core.#WriteFile & { 29 | input: dagger.#Scratch 30 | path: "/bar.txt" 31 | contents: "bar" 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /tests/tasks/mkdir/mkdir_parents.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | dagger.#Plan & { 9 | actions: { 10 | image: core.#Pull & { 11 | source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" 12 | } 13 | 14 | mkdir: core.#Mkdir & { 15 | input: image.output 16 | path: "/test/baz" 17 | } 18 | 19 | writeChecker: core.#WriteFile & { 20 | input: mkdir.output 21 | path: "/test/baz/foo" 22 | contents: "bar" 23 | permissions: 700 24 | } 25 | 26 | readChecker: core.#ReadFile & { 27 | input: writeChecker.output 28 | path: "/test/baz/foo" 29 | } & { 30 | // assert result 31 | contents: "bar" 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /website/cypress/support/e2e.js: -------------------------------------------------------------------------------- 1 | // *********************************************************** 2 | // This example support/index.js is processed and 3 | // loaded automatically before your test files. 4 | // 5 | // This is a great place to put global configuration and 6 | // behavior that modifies Cypress. 7 | // 8 | // You can change the location of this file or turn off 9 | // automatically serving support files with the 10 | // 'supportFile' configuration option. 11 | // 12 | // You can read more here: 13 | // https://on.cypress.io/configuration 14 | // *********************************************************** 15 | 16 | // Import commands.js using ES2015 syntax: 17 | import './commands' 18 | 19 | // Alternatively you can use CommonJS syntax: 20 | // require('./commands') 21 | -------------------------------------------------------------------------------- /.golangci.yml: -------------------------------------------------------------------------------- 1 | run: 2 | skip-dirs: 3 | # progressui is a modified 3rd party library from buildkit 4 | - util/progressui 5 | 6 | linters: 7 | disable-all: true 8 | enable: 9 | - bodyclose 10 | - deadcode 11 | - depguard 12 | - dogsled 13 | - dupl 14 | - goconst 15 | - gocritic 16 | - gocyclo 17 | - gofmt 18 | - goimports 19 | - revive 20 | - goprintffuncname 21 | - gosec 22 | - gosimple 23 | - govet 24 | - ineffassign 25 | - misspell 26 | - nakedret 27 | - prealloc 28 | - rowserrcheck 29 | - exportloopref 30 | - staticcheck 31 | - structcheck 32 | - stylecheck 33 | - typecheck 34 | - unconvert 35 | - unparam 36 | - unused 37 | - varcheck 38 | - whitespace 39 | -------------------------------------------------------------------------------- /pkg/universe.dagger.io/x/olli.janatuinen@gmail.com/dotnet/publish.cue: -------------------------------------------------------------------------------- 1 | //Deprecated: in favor of universe.dagger.io/alpha package 2 | package dotnet 3 | 4 | import ( 5 | "dagger.io/dagger" 6 | ) 7 | 8 | // Publish a dotnet binary 9 | #Publish: { 10 | // Source code 11 | source: dagger.#FS 12 | 13 | // Target package to publish 14 | package: *"." | string 15 | 16 | env: [string]: string 17 | 18 | container: #Container & { 19 | "source": source 20 | "env": { 21 | env 22 | } 23 | command: { 24 | args: [package] 25 | flags: { 26 | publish: true 27 | "-o": "/output/" 28 | } 29 | } 30 | export: directories: "/output": _ 31 | } 32 | 33 | // Directory containing the output of the publish 34 | output: container.export.directories."/output" 35 | } 36 | -------------------------------------------------------------------------------- /tests/tasks/exec/mount_tmp.cue: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dagger.io/dagger" 5 | "dagger.io/dagger/core" 6 | ) 7 | 8 | dagger.#Plan & { 9 | actions: { 10 | image: core.#Pull & { 11 | source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" 12 | } 13 | 14 | exec: core.#Exec & { 15 | input: image.output 16 | mounts: temp: { 17 | dest: "/temp" 18 | contents: core.#TempDir 19 | } 20 | args: [ 21 | "sh", "-c", 22 | #""" 23 | echo -n hello world > /temp/output.txt 24 | """#, 25 | ] 26 | } 27 | 28 | verify: core.#Exec & { 29 | input: exec.output 30 | args: [ 31 | "sh", "-c", 32 | #""" 33 | test ! -f /temp/output.txt 34 | """#, 35 | ] 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /docs/guides/actions/1231-always-execute.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: /1231/always-execute 3 | displayed_sidebar: '0.2' 4 | --- 5 | 6 | # How to always execute an action? 7 | 8 | Dagger implemented a way to invalidate cache for a specific action. 9 | 10 | The `docker.#Run` and `core.#Exec` actions have an `always` field (which means "always run"): 11 | 12 | ```cue 13 | // If set to true, the cache will never be triggered for that specific action. 14 | always: bool | *false 15 | ``` 16 | 17 | Any package composed on top of it (`bash.#Run` for example) also exposes this field as it will inherit it from `docker.#Run`: 18 | 19 | ```cue 20 | test: bash.#Run & { 21 | always: true 22 | ... 23 | } 24 | ``` 25 | 26 | :::caution 27 | 28 | Any dependent actions will also be retriggered. 29 | 30 | ::: 31 | --------------------------------------------------------------------------------