diff --git a/.dagger/env/dev/plan/main.cue b/.dagger/env/dev/plan/main.cue index 50cbd540..dbc5dfc7 100644 --- a/.dagger/env/dev/plan/main.cue +++ b/.dagger/env/dev/plan/main.cue @@ -2,9 +2,9 @@ package main import ( - "dagger.io/dagger" - "dagger.io/os" - "dagger.io/go" + "alpha.dagger.io/dagger" + "alpha.dagger.io/os" + "alpha.dagger.io/go" ) // Dagger source code diff --git a/.dagger/env/docs/plan/main.cue b/.dagger/env/docs/plan/main.cue index 38e530e0..e5a100f8 100644 --- a/.dagger/env/docs/plan/main.cue +++ b/.dagger/env/docs/plan/main.cue @@ -1,9 +1,9 @@ package main import ( - "dagger.io/dagger" - "dagger.io/js/yarn" - "dagger.io/netlify" + "alpha.dagger.io/dagger" + "alpha.dagger.io/js/yarn" + "alpha.dagger.io/netlify" ) // dagger repository diff --git a/.dagger/env/test-core/plan/test-core.cue b/.dagger/env/test-core/plan/test-core.cue index aae00c60..c15e75a5 100644 --- a/.dagger/env/test-core/plan/test-core.cue +++ b/.dagger/env/test-core/plan/test-core.cue @@ -1,7 +1,7 @@ package testcore import ( - "dagger.io/dagger" + "alpha.dagger.io/dagger" ) name: dagger.#Input & { diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0fbdb74b..1658b159 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,7 +77,7 @@ jobs: go-version: 1.16 - name: Setup Kind Kubernetes Cluster - uses: engineerd/setup-kind@v0.5.0 + uses: helm/kind-action@v1.2.0 - name: Install Dependencies run: | diff --git a/client/client.go b/client/client.go index 644c47f2..4c3dff45 100644 --- a/client/client.go +++ b/client/client.go @@ -251,16 +251,9 @@ func (c *Client) logSolveStatus(ctx context.Context, st *state.State, ch chan *b Logger() msg := secureSprintf(format, a...) - switch stream { - case 1: - lg. - Info(). - Msg(msg) - case 2: - lg. - Error(). - Msg(msg) - } + lg. + Info(). + Msg(msg) }, ) } diff --git a/cmd/dagger/cmd/doc.go b/cmd/dagger/cmd/doc.go index ee8b21ef..e76aa2b9 100644 --- a/cmd/dagger/cmd/doc.go +++ b/cmd/dagger/cmd/doc.go @@ -8,6 +8,7 @@ import ( "os" "path" "path/filepath" + "sort" "strings" "text/tabwriter" "unicode/utf8" @@ -332,11 +333,16 @@ func walkStdlib(ctx context.Context, output, format string) { if err != nil { return err } - if p == "." || !d.IsDir() { + if p == "." || !d.IsDir() || d.Name() == "cue.mod" { return nil } - pkgName := fmt.Sprintf("dagger.io/%s", p) + // Ignore tests directories + if d.Name() == "tests" { + return nil + } + + pkgName := fmt.Sprintf("alpha.dagger.io/%s", p) lg.Info().Str("package", pkgName).Str("format", format).Msg("generating doc") val, err := loadCode(pkgName) if err != nil { @@ -365,13 +371,28 @@ func walkStdlib(ctx context.Context, output, format string) { return false } - for p, pkg := range packages { + // get filename from a package name + getFileName := func(p string) string { filename := fmt.Sprintf("%s.%s", p, format) // If this package has sub-packages (e.g. `aws`), create // `aws/README.md` instead of `aws.md`. if hasSubPackages(p) { filename = fmt.Sprintf("%s/README.%s", p, format) } + return filename + } + + // Create main index + index, err := os.Create(path.Join(output, "README.md")) + if err != nil { + lg.Fatal().Err(err).Msg("cannot generate stdlib doc index") + } + defer index.Close() + fmt.Fprintf(index, "# Index\n\n") + indexKeys := []string{} + + for p, pkg := range packages { + filename := getFileName(p) filepath := path.Join(output, filename) if err := os.MkdirAll(path.Dir(filepath), 0755); err != nil { @@ -384,6 +405,14 @@ func walkStdlib(ctx context.Context, output, format string) { } defer f.Close() + indexKeys = append(indexKeys, p) fmt.Fprintf(f, "%s", pkg.Format(format)) } + + // Generate index from sorted list of packages + sort.Strings(indexKeys) + for _, p := range indexKeys { + description := mdEscape(packages[p].Description) + fmt.Fprintf(index, "- [%s](./%s) - %s\n", p, getFileName(p), description) + } } diff --git a/cmd/dagger/cmd/down.go b/cmd/dagger/cmd/down.go index 147d7139..398ade87 100644 --- a/cmd/dagger/cmd/down.go +++ b/cmd/dagger/cmd/down.go @@ -19,6 +19,8 @@ var downCmd = &cobra.Command{ Run: func(cmd *cobra.Command, args []string) { panic("not implemented") }, + // Remove hidden flag once command has been implemented + Hidden: true, } func init() { diff --git a/cmd/dagger/cmd/history.go b/cmd/dagger/cmd/history.go index fcb4c550..22fac682 100644 --- a/cmd/dagger/cmd/history.go +++ b/cmd/dagger/cmd/history.go @@ -22,6 +22,8 @@ var historyCmd = &cobra.Command{ panic("not implemented") }, + // Remove hidden flag once command has been implemented + Hidden: true, } func init() { diff --git a/cmd/dagger/cmd/login.go b/cmd/dagger/cmd/login.go index 58028c0a..74105901 100644 --- a/cmd/dagger/cmd/login.go +++ b/cmd/dagger/cmd/login.go @@ -22,6 +22,8 @@ var loginCmd = &cobra.Command{ panic("not implemented") }, + // Remove hidden flag once command has been implemented + Hidden: true, } func init() { diff --git a/cmd/dagger/cmd/logout.go b/cmd/dagger/cmd/logout.go index 484015d5..62b5f0a7 100644 --- a/cmd/dagger/cmd/logout.go +++ b/cmd/dagger/cmd/logout.go @@ -22,6 +22,8 @@ var logoutCmd = &cobra.Command{ panic("not implemented") }, + // Remove hidden flag once command has been implemented + Hidden: true, } func init() { diff --git a/cmd/dagger/cmd/output/dir.go b/cmd/dagger/cmd/output/dir.go index 9de621d3..b621dbc3 100644 --- a/cmd/dagger/cmd/output/dir.go +++ b/cmd/dagger/cmd/output/dir.go @@ -22,6 +22,8 @@ var dirCmd = &cobra.Command{ panic("not implemented") }, + // Remove hidden flag once command has been implemented + Hidden: true, } func init() { diff --git a/cmd/dagger/cmd/up.go b/cmd/dagger/cmd/up.go index 8916e515..8acd1210 100644 --- a/cmd/dagger/cmd/up.go +++ b/cmd/dagger/cmd/up.go @@ -54,7 +54,7 @@ var upCmd = &cobra.Command{ func checkInputs(ctx context.Context, st *state.State) { lg := log.Ctx(ctx) - warnOnly := viper.GetBool("force") || !term.IsTerminal(int(os.Stdout.Fd())) + warnOnly := viper.GetBool("force") // FIXME: find a way to merge this with the EnvironmentUp client to avoid // creating the client + solver twice diff --git a/cue.mod/pkg/dagger.io b/cue.mod/pkg/dagger.io deleted file mode 120000 index 40a3fd9f..00000000 --- a/cue.mod/pkg/dagger.io +++ /dev/null @@ -1 +0,0 @@ -../../stdlib \ No newline at end of file diff --git a/docs/learn/101-use.md b/docs/learn/101-use.md index 94cdcede..c0225b07 100644 --- a/docs/learn/101-use.md +++ b/docs/learn/101-use.md @@ -5,20 +5,20 @@ slug: /learn/101-basics # Dagger 101: basic usage In this guide, you will learn the basics of Dagger by interacting with a pre-configured environment. -Then you will move on to creating your own environment from scratch. +Then you will move on to creating your environment from scratch. Our pre-configured environment deploys a simple [React](https://reactjs.org/) -application to a special hosting environment created and managed by us, the Dagger team, for the purpose of this tutorial. -This will allow you to deploy something "real" right away, without having to configure your own infrastructure first. +application to a unique hosting environment created and managed by us, the Dagger team, for this tutorial. +This will allow you to deploy something "real" right away without configuring your infrastructure first. -In later guides, you will learn how to configure Dagger to deploy to your own infrastructure. And, for advanced users, -how to share access to your infrastructure in the same way that we are sharing access to ours now. +In later guides, you will learn how to configure Dagger to deploy to your infrastructure. And, for advanced users, +how to share access to your infrastructure in the same way that we share access to ours now. ## Initial setup ### Install Dagger -First, make sure [you have installed dagger on your local machine](/install). +First, make sure [you have installed Dagger on your local machine](/install). ### Setup example app @@ -38,15 +38,15 @@ cd examples/todoapp ### Import the tutorial key Dagger natively supports encrypted secrets: when a user inputs a value marked as secret -(for example a password, API token or ssh key) it is automatically encrypted with that user's key, +(for example, a password, API token, or ssh key) it is automatically encrypted with that user's key, and no other user can access that value unless they are explicitly given access. In the interest of security, Dagger has no way _not_ to encrypt a secret value. -But this causes a dilemma for this tutorial: how do we give unrestricted public access to our -(carefully sandboxed) infrastructure, so that anyone can deploy to it? +But this causes a dilemma for this tutorial: how do we give unrestricted, public access to our +(carefully sandboxed) infrastructure so that anyone can deploy to it? To solve this dilemma, we included the private key used to encrypt the tutorial's secret inputs. -Simply import the key to your Dagger installation, and you're good to go: +Import the key to your Dagger installation, and you're good to go: ```shell ./import-tutorial-key.sh @@ -54,7 +54,7 @@ Simply import the key to your Dagger installation, and you're good to go: ## First deployment -Now that your environment is setup, you are ready to deploy: +Now that your environment is set up, you are ready to deploy: ```shell dagger up @@ -75,7 +75,7 @@ NOTE: you don't have to commit your changes to the git repository before deployi ## Under the hood -This example showed you how to deploy and develop on an application that is already configured with dagger. Now, let's learn a few concepts to help you understand how this was put together. +This example showed you how to deploy and develop an application that is already configured with Dagger. Now, let's learn a few concepts to help you understand how this was put together. ### The Environment @@ -87,13 +87,13 @@ You can list existing environment from the `./todoapp` directory: dagger list ``` -You should see an environment named `s3`. You can have many environments within your app. For instance one for `staging`, one for `dev`, etc... +You should see an environment named `s3`. You can have many environments within your app. For instance, one for `staging`, one for `dev`, etc... -Each environment can have different kind of deployment code. For example, a `dev` environment can deploy locally, a `staging` environment can deploy to a remote infrastructure, and so on. +Each environment can have a different kind of deployment code. For example, a `dev` environment can deploy locally; a `staging` environment can deploy to a remote infrastructure, and so on. ### The plan -The plan is the deployment code, that includes the logic to deploy the local application to an AWS S3 bucket. From the `todoapp` directory, you can list the code of the plan: +The plan is the deployment code that includes the logic to deploy the local application to an AWS S3 bucket. From the `todoapp` directory, you can list the code of the plan: ```shell ls -l .dagger/env/s3/plan/ @@ -103,7 +103,7 @@ Any code change to the plan will be applied during the next `dagger up`. ### The inputs -The plan can define one or several `inputs` in order to take some information from the user. Here is how to list the current inputs: +The plan can define one or several `inputs`. Inputs may be configuration values, artifacts, or encrypted secrets provided by the user. Here is how to list the current inputs: ```shell dagger input list @@ -113,7 +113,7 @@ The inputs are persisted inside the `.dagger` directory and pushed to your git r ### The outputs -The plan defines one or several `outputs`. They can show useful information at the end of the deployment. That's how we read the deploy `url` at the end of the deployment. Here is the command to list all inputs: +The plan defines one or several `outputs`. They can show helpful information at the end of the deployment. That's how we read the deploy `url` at the end of the deployment. Here is the command to list all inputs: ```shell dagger output list @@ -121,4 +121,4 @@ dagger output list ## What's next? -At this point, you have deployed your first application using dagger and learned some dagger commands. You are now ready to [learn more about how to program dagger](/learn/102-dev). +At this point, you have deployed your first application using Dagger and learned some dagger commands. You are now ready to [learn more about how to program Dagger](/learn/102-dev). diff --git a/docs/learn/102-dev.md b/docs/learn/102-dev.md index 42fc10f3..da901325 100644 --- a/docs/learn/102-dev.md +++ b/docs/learn/102-dev.md @@ -6,47 +6,46 @@ slug: /learn/102-dev ## Overview -In this guide you will create your first Dagger environment from scratch, -and use it to deploy a React application to 2 locations in parallel: +In this guide, you will create your first Dagger environment from scratch, +and use it to deploy a React application to two locations in parallel: a dedicated [Amazon S3](https://wikipedia.org/wiki/Amazon_S3) bucket, and a [Netlify](https://en.wikipedia.org/wiki/Netlify) site. ### Anatomy of a Dagger environment -A Dagger environment contains all the code and data necessary to deliver a particular application in a particular way. -For example the same application might be delivered to a production and staging environment, each with their own -configuration. +A Dagger environment contains all the code and data necessary to deliver a particular application in a specific way. +For example, the same application might be delivered to a production and staging environment, each with its own configuration. An environment is made of 3 parts: -* A *plan*, authored by the environment's *developer*, using the [Cue](https://cuelang.org) language. +- A _plan_, authored by the environment's _developer_, using the [Cue](https://cuelang.org) language. -* *Inputs*, supplied by the environment's *user* via the `dagger input` command, and written to a special file. Inputs may be configuration values, artifacts, or encrypted secrets. +- _Inputs_, supplied by the environment's _user_ via the `dagger input` command and written to a particular file. Inputs may be configuration values, artifacts, or encrypted secrets. -* *Outputs*, computed by the Dagger engine via the `dagger up` command, and recorded to a special directory. +- _Outputs_, computed by the Dagger engine via the `dagger up` command and recorded to a particular directory. -We will first develop our environment's *plan*, then configure its initial inputs, then finally run it to verify that it works. +We will first develop our environment's _plan_, configure its initial inputs, then finally run it to verify that it works. ### Anatomy of a plan -A _plan_ specifies, in code, how to deliver a particular application in a particular way. +A _plan_ specifies, in code, how to deliver a particular application in a specific way. It is your environment's source code. -Unlike regular imperative programs which specify a sequence of instructions to execute, +Unlike regular imperative programs, which specify a sequence of instructions to execute, a Dagger plan is _declarative_: it lays out your application's supply chain as a graph of interconnected nodes. Each node in the graph represents a component of the supply chain, for example: -* Development tools: source control, CI, build systems, testing systems -* Hosting infrastructure: compute, storage, networking, databases, CDNs -* Software dependencies: operating systems, languages, libraries, frameworks, etc. +- Development tools: source control, CI, build systems, testing systems +- Hosting infrastructure: compute, storage, networking, databases, CDNs +- Software dependencies: operating systems, languages, libraries, frameworks, etc. Each link in the graph represents a flow of data between nodes. For example: -* source code flows from a git repository to a build system -* system dependencies are combined in a docker image, then uploaded to a registry -* configuration files are generated then sent to a compute cluster or load balancer +- source code flows from a git repository to a build system +- system dependencies are combined in a docker image, then uploaded to a registry +- configuration files are generated then sent to a compute cluster or load balancer ### Introduction to Cue development @@ -56,22 +55,22 @@ Cue is a powerful declarative language by Marcel van Lohuizen. Marcel co-created If you are new to Cue development, don't worry: this tutorial will walk you through the basic steps to get started, and give you resources to learn more. -In technical terms, our plan is a [Cue Package](https://cuelang.org/docs/concepts/packages/#packages). In this tutorial we will develop a new Cue package from scratch for our plan; but you can use any Cue package as a plan. +In technical terms, our plan is a [Cue Package](https://cuelang.org/docs/concepts/packages/#packages). This tutorial will develop a new Cue package from scratch for our plan, but you can use any Cue package as a plan. ## Initial setup ### Install Cue -Although not strictly necessary, for an optimal development experience we recommend +Although not strictly necessary, for an optimal development experience, we recommend [installing a recent version of Cue](https://github.com/cuelang/cue/releases/). ### Prepare Cue learning resources If you are new to Cue, we recommend keeping the following resources in browser tabs: -* The unofficial but excellent [Cuetorials](https://cuetorials.com/overview/foundations/) in a browser tab, to look up Cue concepts as they appear. +- The unofficial but excellent [Cuetorials](https://cuetorials.com/overview/foundations/) in a browser tab, to look up Cue concepts as they appear. -* The official [Cue interactive sandbox](https://cuelang.org/play) for easy experimentation. +- The official [Cue interactive sandbox](https://cuelang.org/play) for easy experimentation. ### Setup example app @@ -94,9 +93,9 @@ cd examples/todoapp Developing for Dagger takes place in a [Cue module](https://cuelang.org/docs/concepts/packages/#modules). If you are familiar with Go, Cue modules are directly inspired by Go modules. -Otherwise, don't worry: a Cue module is simply a directory with one or more Cue packages in it. A Cue module has a `cue.mod` directory at its root. +Otherwise, don't worry: a Cue module is simply a directory with one or more Cue packages in it. For example, a Cue module has a `cue.mod` directory at its root. -In this guide we will use the same directory as the root of the Dagger workspace and the root of the Cue module; but you can create your Cue module anywhere inside the Dagger workspace. +This guide will use the same directory as the root of the Dagger workspace and the Cue module, but you can create your Cue module anywhere inside the Dagger workspace. ```shell cue mod init @@ -106,10 +105,9 @@ cue mod init Now we start developing our Cue package at the root of our Cue module. -In this guide we will split our package in multiple files, one per component. -But you can organize your package any way you want: the Cue evaluator simply merges together -all files from the same package, as long as they are in the same directory and start with the same -`package` clause. It is common for a Cue package to have only one file. +In this guide, we will split our package into multiple files, one per component. +Thus, it is typical for a Cue package to have only one file. However, you can organize your package any way you want: the Cue evaluator merges all files from the same package, as long as they are in the same directory, and start with the same +`package` clause... See the [Cue documentation](https://cuelang.org/docs/concepts/packages/#files-belonging-to-a-package) for more details. We will call our package `multibucket` because it sounds badass and vaguely explains what it does. @@ -118,42 +116,42 @@ But you can call your packages anything you want. Let's create a new directory for our Cue package: ```shell -mkdir multibucket +mkdir cue.mod/multibucket ``` ### Component 1: app source code The first component of our plan is the source code of our React application. -In Dagger terms, this component has 2 important properties: +In Dagger terms, this component has two essential properties: -1. It is an *artifact*: something that can be represented as a directory. -2. It is an *input*: something that is provided by the end user. +1. It is an _artifact_: something that can be represented as a directory. +2. It is an _input_: something that is provided by the end-user. Let's write the corresponding Cue code to a new file in our package: -```cue title="todoapp/multibucket/source.cue" +```cue title="todoapp/cue.mod/multibucket/source.cue" package multibucket import ( - "dagger.io/dagger" + "alpha.dagger.io/dagger" ) // Source code of the sample application src: dagger.#Artifact & dagger.#Input ``` -This defines a component at the key `src`, and specifies that it is both an artifact and an input. +This code defines a component at the key `src`, and specifies that it is both an artifact and an input. ### Component 2: yarn package The second component of our plan is the Yarn package built from the app source code: -```cue title="todoapp/multibucket/yarn.cue" +```cue title="todoapp/cue.mod/multibucket/yarn.cue" package multibucket import ( - "dagger.io/js/yarn" + "alpha.dagger.io/js/yarn" ) // Build the source code using Yarn @@ -164,25 +162,25 @@ app: yarn.#Package & { Let's break it down: -* `package multibucket`: this file is part of the multibucket package -* `import ( "dagger.io/js/yarn" )`: import a package from the [Dagger Universe](https://github.com/dagger/dagger/tree/main/stdlib). -* `app: yarn.#Package`: apply the `#Package` definition at the key `app` -* `&`: also merge the following values at the same key... -* `{ source: src }`: set the key `app.source` to the value of `src`. This connects our 2 components, forming the first link in our DAG. +- `package multibucket`: this file is part of the multibucket package +- `import ( "alpha.dagger.io/js/yarn" )`: import a package from the [Dagger Universe](../reference/universe/README.md). +- `app: yarn.#Package`: apply the `#Package` definition at the key `app` +- `&`: also merge the following values at the same key... +- `{ source: src }`: set the key `app.source` to the value of `src`. This snippet of code connects our two components, forming the first link in our DAG ### Component 3: dedicated S3 bucket -*FIXME*: this section is not yet available, because the [Amazon S3 package](https://github.com/dagger/dagger/tree/main/stdlib/aws/s3) does [not yet support bucket creation](https://github.com/dagger/dagger/issues/623). We welcome external contributions :) +_FIXME_: this section is not yet available because the [Amazon S3 package](https://github.com/dagger/dagger/tree/main/stdlib/aws/s3) does [not yet support bucket creation](https://github.com/dagger/dagger/issues/623). We welcome external contributions :) ### Component 4: deploy to Netlify The third component of our plan is the Netlify site to which the app will be deployed: -```cue title="todoapp/multibucket/netlify.cue" +```cue title="todoapp/cue.mod/multibucket/netlify.cue" package multibucket import ( - "dagger.io/netlify" + "alpha.dagger.io/netlify" ) // Netlify site @@ -191,25 +189,25 @@ site: "netlify": netlify.#Site & { } ``` -This is very similar to the previous component: +This component is very similar to the previous one: -* We use the same package name as the other files -* We import another package from the [Dagger Universe](https://github.com/dagger/dagger/tree/main/stdlib). -* `site: "netlify": site.#Netlify`: apply the `#Site` definition at the key `site.netlify`. Note the use of quotes to protect the key from name conflict. -* `&`: also merge the following values at the same key... -* `{ contents: app.build }`: set the key `site.netlify.contents` to the value of `app.build`. This connects our components 2 and 3, forming the second link in our DAG. +- We use the same package name as the other files +- We import another package from the [Dagger Universe](../reference/universe/README.md). +- `site: "netlify": site.#Netlify`: apply the `#Site` definition at the key `site.netlify`. Note the use of quotes to protect the key from name conflict. +- `&`: also merge the following values at the same key... +- `{ contents: app.build }`: set the key `site.netlify.contents` to the value of `app.build`. This line connects our components 2 and 3, forming the second link in our DAG. ### Exploring a package documentation But wait: how did we know what fields were available in `yarn.#Package` and `netlify.#Site`? -Answer: thanks to the `dagger doc` command, which prints the documentation of any package from [Dagger Universe](https://github.com/dagger/dagger/tree/main/stdlib). +Answer: thanks to the `dagger doc` command, which prints the documentation of any package from [Dagger Universe](../reference/universe/README.md). ```shell -dagger doc dagger.io/netlify -dagger doc dagger.io/js/yarn +dagger doc alpha.dagger.io/netlify +dagger doc alpha.dagger.io/js/yarn ``` -You can also browse the [Dagger Universe](/reference/universe) reference in the documentation. +You can also browse the [Dagger Universe](../reference/universe/README.md) reference in the documentation. ## Setup the environment @@ -218,27 +216,56 @@ You can also browse the [Dagger Universe](/reference/universe) reference in the Now that your Cue package is ready, let's create an environment to run it: ```shell -dagger new 'multibucket' +dagger new 'multibucket' -m cue.mod/multibucket ``` -### Load the plan into the environment - -Now let's configure the new environment to use our package as its plan: - -```shell -cp multibucket/*.cue .dagger/env/multibucket/plan/ -``` - -Note: you need to copy the files from your package into the environment, as shown above. -If you make more changes to your package, you will need to copy the new version, or it will not be used. -In the future, we will add the ability to reference your Cue package directory, making this manual copy unnecessary. - ### Configure user inputs -[This section is not yet written](https://github.com/dagger/dagger/blob/main/CONTRIBUTING.md) +You can inspect the list of inputs (both required and optional) using dagger input list: + +```shell +dagger input list -e multibucket +# Input Value Set by user Description +# site.netlify.account.name *"" | string false Use this Netlify account name (also referred to as "team" in the Netlify docs) +# site.netlify.account.token dagger.#Secret false Netlify authentication token +# site.netlify.name string false Deploy to this Netlify site +# site.netlify.create *true | bool false Create the Netlify site if it doesn't exist? +# src dagger.#Artifact false Source code of the sample application +# app.cwd *"." | string false working directory to use +# app.writeEnvFile *"" | string false Write the contents of `environment` to this file, in the "envfile" format +# app.buildDir *"build" | string false Read build output from this directory (path must be relative to working directory) +# app.script *"build" | string false Run this yarn script +# app.args *[] | [] false Optional arguments for the script +``` + +All the values without default values (without `*`) have to be specified by the user. Here, required fields are: + +- `site.netlify.account.token`, your access token +- `site.netlify.name`, name of the published website +- `src`, source code of the app + +Please note the type of the user inputs: a string, a #Secret and an artifact. Let's see how to input them: + +```shell +# As a string input is expected for `site.netlify.name`, we set a `text` input +dagger input text site.netlify.name -e multibucket + +# As a secret input is expected for `site.netlify.account.token`, we set a `secret` input +dagger input secret site.netlify.account.token -e multibucket + +# As an Artifact is exepected for `src`, we set a `dir` input (dagger input list for alternatives) +dagger input dir src . -e multibucket + +``` ### Deploy +Now that everything is properly set, let's deploy on Netlify: + +```shell +dagger up -e multibucket +``` + [This section is not yet written](https://github.com/dagger/dagger/blob/main/CONTRIBUTING.md) ### Using the environment diff --git a/docs/learn/103-script.md b/docs/learn/103-script.md index 5c41a031..066d1bb4 100644 --- a/docs/learn/103-script.md +++ b/docs/learn/103-script.md @@ -4,7 +4,7 @@ slug: /learn/103-script # Dagger 103: integrate custom shell scripts -In this guide, you will learn how to incorporate your custom shell scripts into a Dagger environment. For example, to run integration tests before deployment; call a custom processing step; or any other custom task which you have already automated, and want to incorporate into your Dagger environment with minimal effort. +In this guide, you will learn how to incorporate your custom shell scripts into a Dagger environment. For example, run integration tests before deployment; call a custom processing step; or any other custom task which you have already automated and want to incorporate into your Dagger environment with minimal effort. This section is not yet written. Help Dagger growing by suggesting content improvements. diff --git a/docs/learn/107-kubernetes.md b/docs/learn/107-kubernetes.md index f8a76595..8f86a96f 100644 --- a/docs/learn/107-kubernetes.md +++ b/docs/learn/107-kubernetes.md @@ -164,14 +164,14 @@ values={[ package kube import ( - "dagger.io/kubernetes" + "alpha.dagger.io/kubernetes" ) // input: ~/.kube/config file used for deployment // set with `dagger input text kubeconfig -f ~/.kube/config` kubeconfig: string @dagger(input) -// deploy uses the `dagger.io/kubernetes` package to apply a manifest to a +// deploy uses the `alpha.dagger.io/kubernetes` package to apply a manifest to a // Kubernetes cluster. deploy: kubernetes.#Resources & { // reference the `kubeconfig` input above @@ -190,8 +190,8 @@ deploy: kubernetes.#Resources & { package kube import ( - "dagger.io/kubernetes" - "dagger.io/gcp/gke" + "alpha.dagger.io/kubernetes" + "alpha.dagger.io/gcp/gke" ) // gkeConfig used for deployment @@ -199,7 +199,7 @@ gkeConfig: gke.#KubeConfig @dagger(input) kubeconfig: gkeConfig.kubeconfig -// deploy uses the `dagger.io/kubernetes` package to apply a manifest to a +// deploy uses the `alpha.dagger.io/kubernetes` package to apply a manifest to a // Kubernetes cluster. deploy: kubernetes.#Resources & { // reference the `kubeconfig` input above @@ -218,8 +218,8 @@ deploy: kubernetes.#Resources & { package kube import ( - "dagger.io/kubernetes" - "dagger.io/aws/eks" + "alpha.dagger.io/kubernetes" + "alpha.dagger.io/aws/eks" ) // eksConfig used for deployment @@ -227,7 +227,7 @@ eksConfig: eks.#KubeConfig @dagger(input) kubeconfig: eksConfig.kubeconfig -// deploy uses the `dagger.io/kubernetes` package to apply a manifest to a +// deploy uses the `alpha.dagger.io/kubernetes` package to apply a manifest to a // Kubernetes cluster. deploy: kubernetes.#Resources & { // reference the `kubeconfig` input above @@ -245,7 +245,7 @@ This defines: - `kubeconfig` a _string_ **input**: kubernetes configuration (`~/.kube/config`) used for `kubectl` -- `deploy`: Deployment step using the package `dagger.io/kubernetes`. It takes +- `deploy`: Deployment step using the package `alpha.dagger.io/kubernetes`. It takes the `manifest` defined earlier and deploys it to the Kubernetes cluster specified in `kubeconfig`. ### Setup the environment @@ -578,7 +578,7 @@ The following configuration will: - Declare a `repository` input as a `dagger.#Artifact`. This will be mapped to the source code directory. - Declare a `registry` input. This is the address used for docker push -- Use `dagger.io/docker` to build and push the image +- Use `alpha.dagger.io/docker` to build and push the image - Use the registry image reference (`push.ref`) as the image for the deployment. ```cue title="todoapp/kube/manifest.cue" @@ -587,8 +587,8 @@ package kube import ( "encoding/yaml" - "dagger.io/dagger" - "dagger.io/docker" + "alpha.dagger.io/dagger" + "alpha.dagger.io/docker" ) // input: source code repository, must contain a Dockerfile diff --git a/docs/learn/108-cloudformation.md b/docs/learn/108-cloudformation.md index 47451383..b7f0ba3b 100644 --- a/docs/learn/108-cloudformation.md +++ b/docs/learn/108-cloudformation.md @@ -4,9 +4,9 @@ slug: /learn/108-cloudformation # Dagger 108: provision infrastructure on AWS -In this guide you will learn how to automatically [provision infrastructure](https://dzone.com/articles/infrastructure-provisioning-–) on AWS, by integrating [Amazon Cloudformation](https://aws.amazon.com/cloudformation/) in your Dagger environment. +In this guide, you will learn how to automatically [provision infrastructure](https://dzone.com/articles/infrastructure-provisioning-–) on AWS by integrating [Amazon Cloudformation](https://aws.amazon.com/cloudformation/) in your Dagger environment. -We will start with something simple: provisioning a new bucket on [Amazon S3](https://en.wikipedia.org/wiki/Amazon_S3). But Cloudformation can provision almost any AWS resource; and Dagger can integrate with the full Cloudformation API. +We will start with something simple: provisioning a new bucket on [Amazon S3](https://en.wikipedia.org/wiki/Amazon_S3). But Cloudformation can provision almost any AWS resource, and Dagger can integrate with the full Cloudformation API. ## Prerequisites @@ -14,11 +14,11 @@ We will start with something simple: provisioning a new bucket on [Amazon S3](ht #### Guidelines -The provisioning strategy detailed below follows S3 best practices. In order to remain agnostic of your current AWS level, it deeply relies on S3 and Cloudformation documentation. +The provisioning strategy detailed below follows S3 best practices. However, to remain agnostic of your current AWS level, it profoundly relies on S3 and Cloudformation documentation. #### Relays -When developing a plan based on relays, the first thing to consider is to read their universe reference: it summarizes the expected inputs and their corresponding formats. [Here](https://dagger.io/aws/cloudformation) is the Cloudformation one. +The first thing to consider when developing a plan based on relays is to read their universe reference: it summarizes the expected inputs and their corresponding formats. [Here](/reference/universe/aws/cloudformation) is the Cloudformation one. ## Initialize a Dagger Workspace and Environment @@ -30,7 +30,7 @@ You will need the local copy of the [Dagger examples repository](https://github. git clone https://github.com/dagger/examples ``` -Make sure that all commands are run from the todoapp directory: +Make sure to run all commands from the todoapp directory: ```shell cd examples/todoapp @@ -38,7 +38,7 @@ cd examples/todoapp ### (optional) Initialize a Cue module -In this guide we will use the same directory as the root of the Dagger workspace and the root of the Cue module; but you can create your Cue module anywhere inside the Dagger workspace. +This guide will use the same directory as the root of the Dagger workspace and the root of the Cue module, but you can create your Cue module anywhere inside the Dagger workspace. ```shell cue mod init @@ -49,304 +49,361 @@ cue mod init Let's create a new directory for our Cue package: ```shell -mkdir cloudformation +mkdir cue.mod/cloudformation ``` -### Setup the environment +## Create a basic plan -#### Create a new environment +Let's implement the Cloudformation template and convert it to a Cue definition for further flexibility. -Now that your Cue package is ready, let's create an environment to run it: +### Setup the template and the environment -```shell -dagger new 'cloudformation' -``` +#### Setup the template -## Cloudformation +The idea here is to follow best practices in [S3 buckets](https://docs.aws.amazon.com/AmazonS3/latest/userguide/HostingWebsiteOnS3Setup.html) provisioning. Thankfully, the AWS documentation contains a working [Cloudformation template](https://docs.aws.amazon.com/fr_fr/AWSCloudFormation/latest/UserGuide/quickref-s3.html#scenario-s3-bucket-website) that fits 95% of our needs. -Now that a plan has been set, let's implement the Cloudformation template and convert it to a Cue definition for further flexibility. +##### 1. Tweaking the template: output bucket name only -### Template creation +Create a file named `template.cue` and add the following configuration to it. -The idea here is to follow best practices in [S3 buckets](https://docs.aws.amazon.com/AmazonS3/latest/userguide/HostingWebsiteOnS3Setup.html) provisioning. Thanksfully, the AWS documentation contains a working [Cloudformation template](https://docs.aws.amazon.com/fr_fr/AWSCloudFormation/latest/UserGuide/quickref-s3.html#scenario-s3-bucket-website) that fits 95% of our needs. +```cue title="todoapp/cue.mod/cloudformation/template.cue" +package cloudformation -1.Tweaking the template: removing some of the ouputs - -The [template](https://docs.aws.amazon.com/fr_fr/AWSCloudFormation/latest/UserGuide/quickref-s3.html#scenario-s3-bucket-website) has far more outputs than necessary, as we just want to retrieve the bucket name: - -import Tabs from "@theme/Tabs"; -import TabItem from "@theme/TabItem"; - - - - -```json -"Outputs": { - "WebsiteURL": { - "Value": { - "Fn::GetAtt": [ - "S3Bucket", - "WebsiteURL" - ] +// inlined s3 cloudformation template as a string +template: """ + { + "AWSTemplateFormatVersion": "2010-09-09", + "Resources": { + "S3Bucket": { + "Type": "AWS::S3::Bucket", + "Properties": { + "AccessControl": "PublicRead", + "WebsiteConfiguration": { + "IndexDocument": "index.html", + "ErrorDocument": "error.html" + } }, - "Description": "URL for website hosted on S3" - }, - "S3BucketSecureURL": { - "Value": { - "Fn::Join": [ - "", - [ - "https://", - { - "Fn::GetAtt": [ - "S3Bucket", - "DomainName" - ] - } - ] - ] - }, - "Description": "Name of S3 bucket to hold website content" - } -} -``` - - - - -```json -"Outputs": { - "Name": { - "Value": { - "Fn::GetAtt": [ - "S3Bucket", - "Arn" - ] - }, - "Description": "Name S3 Bucket" - } -} -``` - - - - -```json -{ - "AWSTemplateFormatVersion": "2010-09-09", - "Resources": { - "S3Bucket": { - "Type": "AWS::S3::Bucket", - "Properties": { - "AccessControl": "PublicRead", - "WebsiteConfiguration": { - "IndexDocument": "index.html", - "ErrorDocument": "error.html" - } + "DeletionPolicy": "Retain" }, - "DeletionPolicy": "Retain" - }, - "BucketPolicy": { - "Type": "AWS::S3::BucketPolicy", - "Properties": { - "PolicyDocument": { - "Id": "MyPolicy", - "Version": "2012-10-17", - "Statement": [ - { - "Sid": "PublicReadForGetBucketObjects", - "Effect": "Allow", - "Principal": "*", - "Action": "s3:GetObject", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:aws:s3:::", - { - "Ref": "S3Bucket" - }, - "/*" + "BucketPolicy": { + "Type": "AWS::S3::BucketPolicy", + "Properties": { + "PolicyDocument": { + "Id": "MyPolicy", + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "PublicReadForGetBucketObjects", + "Effect": "Allow", + "Principal": "*", + "Action": "s3:GetObject", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:aws:s3:::", + { + "Ref": "S3Bucket" + }, + "/*" + ] ] - ] + } } - } - ] - }, - "Bucket": { - "Ref": "S3Bucket" + ] + }, + "Bucket": { + "Ref": "S3Bucket" + } } } - } - }, - "Outputs": { - "Name": { - "Value": { - "Fn::GetAtt": ["S3Bucket", "Arn"] - }, - "Description": "Name S3 Bucket" + }, + "Outputs": { + "Name": { + "Value": { + "Fn::GetAtt": ["S3Bucket", "Arn"] + }, + "Description": "Name S3 Bucket" + } } } +""" +``` + +##### 2. Cloudformation relay + +As our plan relies on [Cloudformation's relay](/reference/universe/aws/cloudformation), let's dissect the expected inputs by gradually incorporating them into our plan. + +```shell +dagger doc alpha.dagger.io/aws/cloudformation +# Inputs: +# config.region string AWS region +# config.accessKey dagger.#Secret AWS access key +# config.secretKey dagger.#Secret AWS secret key +# source string Source is the Cloudformation template (JSON/YAML… +# stackName string Stackname is the cloudformation stack +# parameters struct Stack parameters +# onFailure *"DO_NOTHING" | "ROLLBACK" | "DELETE" Behavior when failure to create/update the Stack +# timeout *10 | >=0 & int Maximum waiting time until stack creation/update… +# neverUpdate *false | true Never update the stack if already exists +``` + +###### 1. General insights + +As seen above in the documentation, values starting with `*` are default values. However, as a plan developer, we may need to add default values to inputs from relays without one: Cue gives you this flexibility. + +###### 2. The config value + +The config values are all part of the `aws` relay. Regarding this package, as you can see above, five of the required inputs miss default options (`parameters` field is optional): + +> - _config.region_ +> - _config.accessKey_ +> - _config.secretKey_ +> - _source_ +> - _stackName_ + +Let's implement the first step, use the `aws.#Config` relay, and request its first inputs: the region to deploy and the AWS credentials. + +```cue title="todoapp/cue.mod/cloudformation/source.cue" +package cloudformation + +import ( + "alpha.dagger.io/aws" +) + +// AWS account: credentials and region +awsConfig: aws.#Config +``` + +This defines: + +- `awsConfig`: AWS CLI Configuration step using the package `alpha.dagger.io/aws`. It takes three user inputs: a `region`, an `accessKey`, and a `secretKey` + +#### Setup the environment + +##### 1. Create a new environment + +Now that the Cue package is ready, let's create an environment to run it: + +```shell +dagger new 'cloudformation' -m cue.mod/cloudformation +``` + +##### 2. Check plan + +_Pro tips_: To check whether it worked or not, these three commands might help + +```shell +dagger input list -e cloudformation # List our personal plan's inputs +# Input Value Set by user Description +# awsConfig.region string false AWS region +# awsConfig.accessKey dagger.#Secret false AWS access key +# awsConfig.secretKey dagger.#Secret false AWS secret key + +dagger query -e cloudformation # Query values / inspect default values (Instrumental in case of conflict) +# {} + +dagger up -e cloudformation # Try to run the plan. As expected, we encounter a failure because some user inputs haven't been set +# 4:11PM ERR system | required input is missing input=awsConfig.region +# 4:11PM ERR system | required input is missing input=awsConfig.accessKey +# 4:11PM ERR system | required input is missing input=awsConfig.secretKey +# 4:11PM FTL system | some required inputs are not set, please re-run with `--force` if you think it's a mistake missing=0s +``` + +#### Finish template setup + +Now that we have the `config` definition properly configured, let's modify the Cloudformation one: + +```cue title="todoapp/cue.mod/cloudformation/source.cue" +package cloudformation + +import ( + "alpha.dagger.io/aws" + "alpha.dagger.io/dagger" + "alpha.dagger.io/random" + "alpha.dagger.io/aws/cloudformation" +) + +// AWS account: credentials and region +awsConfig: aws.#Config + +// Create a random suffix +suffix: random.#String & { + seed: "" } + +// Query the Cloudformation stackname, or create one with a random suffix to keep unicity +cfnStackName: *"stack-\(suffix.out)" | string & dagger.#Input + +// AWS Cloudformation stdlib +cfnStack: cloudformation.#Stack & { + config: awsConfig + stackName: cfnStackName + source: template +} +``` + +This defines: + +- `suffix`: random suffix leveraging the `random` relay. It doesn't have a seed because we don't care about predictability +- `cfnStackName`: Name of the stack, either a default value `stack-suffix` or user input +- `cfnStack`: Cloudformation relay with `AWS config`, `stackName` and `JSON template` as inputs + +### Configure the environment + +Before bringing up the deployment, we need to provide the `cfnStack` inputs declared in the configuration. Otherwise, Dagger will complain about missing inputs. + +```shell +dagger up -e cloudformation +# 3:34PM ERR system | required input is missing input=awsConfig.region +# 3:34PM ERR system | required input is missing input=awsConfig.accessKey +# 3:34PM ERR system | required input is missing input=awsConfig.secretKey +# 3:34PM FTL system | some required inputs are not set, please re-run with `--force` if you think it's a mistake missing=0s +``` + +You can inspect the list of inputs (both required and optional) using dagger input list: + +```shell +dagger input list -e cloudformation +# Input Value Set by user Description +# awsConfig.region string false AWS region +# awsConfig.accessKey dagger.#Secret false AWS access key +# awsConfig.secretKey dagger.#Secret false AWS secret key +# suffix.length *12 | number false length of the string +# cfnStack.onFailure *"DO_NOTHING" | "ROLLBACK" | "DELETE" false Behavior when failure to create/update the Stack +# cfnStack.timeout *10 | >=0 & int false Maximum waiting time until stack creation/update (in minutes) +# cfnStack.neverUpdate *false | true false Never update the stack if already exists +``` + +Let's provide the missing inputs: + +```shell +dagger input text awsConfig.region us-east-2 -e cloudformation +dagger input secret awsConfig.accessKey yourAccessKey -e cloudformation +dagger input secret awsConfig.secretKey yourSecretKey -e cloudformation +``` + +### Deploying + +Finally ! We now have a working template ready to be used to provision S3 infrastructures. Let's deploy it: + + + +```shell +dagger up -e cloudformation +#2:22PM INF suffix.out | computing +#2:22PM INF suffix.out | completed duration=200ms +#2:22PM INF cfnStack.outputs | computing +#2:22PM INF cfnStack.outputs | #15 1.304 { +#2:22PM INF cfnStack.outputs | #15 1.304 "Parameters": [] +#2:22PM INF cfnStack.outputs | #15 1.304 } +#2:22PM INF cfnStack.outputs | #15 2.948 { +#2:22PM INF cfnStack.outputs | #15 2.948 "StackId": "arn:aws:cloudformation:us-east-2:817126022176:stack/stack-emktqcfwksng/207d29a0-cd0b-11eb-aafd-0a6bae5481b4" +#2:22PM INF cfnStack.outputs | #15 2.948 } +#2:22PM INF cfnStack.outputs | completed duration=35s + +dagger output list -e cloudformation +# Output Value Description +# suffix.out "emktqcfwksng" generated random string +# cfnStack.outputs.Name "arn:aws:s3:::stack-emktqcfwksng-s3bucket-9eiowjs1jab4" - +``` + + + + +```shell +dagger up -l debug -e cloudformation +#Output: +# 3:50PM DBG system | detected buildkit version version=v0.8.3 +# 3:50PM DBG system | spawning buildkit job localdirs={ +# "/tmp/infra-provisioning/.dagger/env/infra/plan": "/tmp/infra-provisioning/.dagger/env/infra/plan" +# } attrs=null +# 3:50PM DBG system | loading configuration +# ... Lots of logs ... :-D +# Output Value Description +# suffix.out "abnyiemsoqbm" generated random string +# cfnStack.outputs.Name "arn:aws:s3:::stack-abnyiemsoqbm-s3bucket-9eiowjs1jab4" - + +dagger output list -e cloudformation +# Output Value Description +# suffix.out "abnyiemsoqbm" generated random string +# cfnStack.outputs.Name "arn:aws:s3:::stack-abnyiemsoqbm-s3bucket-9eiowjs1jab4" - ``` -2.Some _"Pro tips"_ +The deployment went well! -Double-checks at the template level can be done with manual uploads on Cloudformation's web interface or by executing the below command locally: +In case of a failure, the `Debug deploy` tab shows the command to get more information. +The name of the provisioned S3 instance lies in the `cfnStack.outputs.Name` output key, without `arn:aws:s3:::` -```shell -aws cloudformation validate-template --template-body file://template.json -``` +> With this provisioning infrastructure, your dev team will easily be able to instantiate aws infrastructures: all they need to know is `dagger input list -e cloudformation` and `dagger up -e cloudformation` isn't that awesome? :-D -> PS: The _"Full Base Template"_ tab contains the base template used for the following parts of the guide +## Cue Cloudformation template -### JSON / YAML to Cue conversion +This section will convert the inlined JSON template to CUE to take advantage of the language features. -Once you'll get used to Cue, you might directly write Cloudformation templates in this language. As most of the current examples are either written in JSON or in YAML, let's see how to lazily convert them in Cue (optional but recommended). +To do so quickly, we will first transform the template from JSON format to Cue format, then optimize it to leverage Cue's forces. -#### 1. Create convert.cue +### 1. Create convert.cue -We will create a `convert.cue` to process the conversion +We will create a new `convert.cue` file to process the conversion + +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; -```cue title="todoapp/cloudformation/convert.cue" +```cue title="todoapp/cue.mod/cloudformation/convert.cue" package cloudformation import "encoding/json" -point: json.Unmarshal(data) -data: #""" -// Paste above final JSON template here -"""# -``` - - - - -```cue title="todoapp/cloudformation/convert.cue" -package cloudformation -import "encoding/json" - -point: json.Unmarshal(data) -data: #""" -{ - "AWSTemplateFormatVersion": "2010-09-09", - "Resources": { - "S3Bucket": { - "Type": "AWS::S3::Bucket", - "Properties": { - "AccessControl": "PublicRead", - "WebsiteConfiguration": { - "IndexDocument": "index.html", - "ErrorDocument": "error.html" - } - }, - "DeletionPolicy": "Retain" - }, - "BucketPolicy": { - "Type": "AWS::S3::BucketPolicy", - "Properties": { - "PolicyDocument": { - "Id": "MyPolicy", - "Version": "2012-10-17", - "Statement": [ - { - "Sid": "PublicReadForGetBucketObjects", - "Effect": "Allow", - "Principal": "*", - "Action": "s3:GetObject", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:aws:s3:::", - { - "Ref": "S3Bucket" - }, - "/*" - ] - ] - } - } - ] - }, - "Bucket": { - "Ref": "S3Bucket" - } - } - } - }, - "Outputs": { - "Name": { - "Value": { - "Fn::GetAtt": [ - "S3Bucket", - "Arn" - ] - }, - "Description": "Name S3 Bucket" - } - } -} -"""# +s3Template: json.Unmarshal(template) ``` -```cue title="todoapp/cloudformation/convert.cue" +```cue title="todoapp/cue.mod/cloudformation/convert.cue" package cloudformation import "encoding/yaml" -point: yaml.Unmarshal(data) -data: """ -// Paste YAML here -""" +s3Template: yaml.Unmarshal(template) ``` -You need to copy the changes to the plan in order for Dagger to reference them +This defines: + +- `s3Template`: contains the unmarshalled template. + +You need to empty the plan and copy the `convert.cue` file to the plan for Dagger to reference it ```shell -cp cloudformation/*.cue .dagger/env/cloudformation/plan/ +rm cue.mod/cloudformation/source.cue ``` -#### 2. Retrieve the Unmarshalled JSON +### 2. Retrieve the Unmarshalled JSON -Then, still in the same folder, query the `point` value to retrieve the Unmarshalled result of `data`: - - - +Then, still in the same folder, query the `s3Template` value to retrieve the Unmarshalled result of `s3`: ```shell -dagger query point -# Output: +dagger query s3Template -e cloudformation # { # "AWSTemplateFormatVersion": "2010-09-09", # "Outputs": { @@ -356,384 +413,28 @@ dagger query point # "Fn::GetAtt": [ # "S3Bucket", # "Arn" -# ] -# } -# } -# }, -# "Resources": { -# "BucketPolicy": { -# "Properties": { -# "Bucket": { -# "Ref": "S3Bucket" -# }, -# "PolicyDocument": { -# "Id": "MyPolicy", -# "Statement": [ -# { -# "Action": "s3:GetObject", -# "Effect": "Allow", -# "Principal": "*", -# "Resource": { -# "Fn::Join": [ -# "", -# [ -# "arn:aws:s3:::", -# { -# "Ref": "S3Bucket" -# }, -# "/*" -# ] -# ] -# }, -# "Sid": "PublicReadForGetBucketObjects" -# } -# ], -# "Version": "2012-10-17" -# } -# }, -# "Type": "AWS::S3::BucketPolicy" -# }, -# "S3Bucket": { -# "DeletionPolicy": "Retain", -# "Properties": { -# "AccessControl": "PublicRead", -# "WebsiteConfiguration": { -# "ErrorDocument": "error.html", -# "IndexDocument": "index.html" -# } -# }, -# "Type": "AWS::S3::Bucket" -# } -# } -# } +# ... ``` - - +The commented output above is the cue version of the JSON Template, copy it + +### 3. Remove convert.cue ```shell -dagger query point -# Output: -# { - #Prints value stored in point key -# } +rm cue.mod/cloudformation/convert.cue ``` - - +### 4. Store the output -#### 3. Store the output +Open `cloudformation/template.cue` and append below elements with copied Cue definition of the JSON: -This Cue version of the JSON template is going to be integrated inside our provisioning plan. Save the output for the next steps of the guide. - -## Personal plan - -With the Cloudformation template now finished, tested and converted in Cue. We can now enter the last part of our guide: piping everything together inside our personal plan. - -Before continuing, don't forget to delete your `convert.cue` plan: - -```shell -rm todoapp/cloudformation/convert.cue -rm .dagger/env/cloudformation/plan/convert.cue -``` - -### Cloudformation relay - -As our plan relies on [Cloudformation's relay](https://dagger.io/aws/cloudformation), let's dissect the expected inputs by gradually incorporating them in our plan. - -| Name | Type | Description | -| ------------------ | :---------------------------------------: | :------------------------------------------------------------------: | -| _config.region_ | `string` | AWS region | -| _config.accessKey_ | `dagger.#Secret` | AWS access key | -| _config.secretKey_ | `dagger.#Secret` | AWS secret key | -| _source_ | `string` | Source is the Cloudformation template (JSON/YAML string) | -| _stackName_ | `string` | Stackname is the cloudformation stack | -| _onFailure_ | `*"DO_NOTHING" \| "ROLLBACK" \| "DELETE"` | Behavior when failure to create/update the Stack | -| _timeout_ | `*10 \| \>=0 & int` | Timeout for waiting for the stack to be created/updated (in minutes) | -| _neverUpdate_ | `*false \| bool` | Never update the stack if already exists | - -1.General insights - -As seen before in the documentation, values starting with `*` are default values. However, as a plan developer, we may face the need to add default values to inputs from relays that don't have one : Cue gives you this flexibility. - -> WARNING: All inputs without a default option have to be filled for a proper execution of the relay. In our case: -> -> - _config.region_ -> - _config.accessKey_ -> - _config.secretKey_ -> - _source_ -> - _stackName_ - -2.The config value - -The config values are all part of the `aws` relay. Regarding this package, as you can see above, none of the 3 required inputs contain default options. - -Let's implement the first step : use the `aws.#Config` relay and request the user it's first input, the region to deploy in. - - - - -```cue title="todoapp/cloudformation/source.cue" +```cue title="todoapp/cue.mod/cloudformation/template.cue" +// Add this line, to make it part to the cloudformation template package cloudformation -``` +import "encoding/json" - - - -```cue title="todoapp/cloudformation/source.cue" -package cloudformation - -import ( - "dagger.io/aws" -) - -// AWS account: credentials and region -awsConfig: aws.#Config & { - region: string @dagger(input) -} -``` - - - - -```cue title="todoapp/cloudformation/source.cue" -package cloudformation - -import ( - "dagger.io/aws" // <-- Import AWS relay to instanciate aws.#Config -) - -// AWS account: credentials and region -awsConfig: aws.#Config & { // Assign an aws.#Config definition to a field named `awsConfig` - // awsConfig will be a directly requestable key : `dagger query awsConfig` - // awsConfig sets the region to either an input, or a default string: "us-east-2" - region: string @dagger(input) - // As we declare an aws.#Config, Dagger/Cue will automatically know that some others values inside this definition - // are inputs, especially secrets (AccessKey, secretKey). Due to the confidential nature of secrets, we won't declare default values to them -} -``` - - - - -Update the plan - -```shell -cp cloudformation/*.cue .dagger/env/cloudformation/plan/ -``` - -Pro tips: In order to check wether it worked or not, these two commands might help - - - - -```shell -dagger input list # List required input in our personal plan -# Output: -# Input Value Set by user Description -# awsConfig.region string false AWS region -# awsConfig.accessKey dagger.#Secret false AWS access key -# awsConfig.secretKey dagger.#Secret false AWS secret key -``` - - - - -```shell -dagger query # Query values / inspect default values (Very useful in case of conflict) -# Output: -# { -# "awsConfig": { -# "region": "us-east-2" -# } -# } -``` - - - - -```shell -dagger up # Try to run the plan. As expected, we encounter a failure -# Output: -# 9:07PM ERR system | required input is missing input=awsConfig.accessKey -# 9:07PM ERR system | required input is missing input=awsConfig.secretKey -# 9:07PM FTL system | some required inputs are not set, please re-run with `--force` if you think it's a mistake missing=0s -``` - - - - -Inside the `firstCommand` tab, we see that the `awsConfig.region` key has a default value set. It wasn't the case when we just imported the base relay. - -Furthemore, in the `Failed execution` tab, the execution of the `dagger up` command fails because of the unspecified secret inputs. - -3.Integrating Cloudformation relay - -Now that we have the `config` definition properly configured, we can now import the Cloudformation one, and properly fill it : - - - - -```cue title="todoapp/cloudformation/source.cue" -package cloudformation - -import ( - "dagger.io/aws" -) - -// AWS account: credentials and region -awsConfig: aws.#Config & { - region: string @dagger(input) -} -``` - - - - -```cue title="todoapp/cloudformation/source.cue" -package cloudformation - -import ( - "dagger.io/aws" - "dagger.io/random" - "dagger.io/aws/cloudformation" -) - -// AWS account: credentials and region -awsConfig: aws.#Config & { - region: string @dagger(input) -} - - -// Create a random suffix -suffix: random.#String & { - seed: "" -} - -// Request the cloudformation stackname as an input, or generated a default one with a random suffix to keep uniqueness -cfnStackName: *"stack-\(suffix.out)" | string @dagger(input) // Has to be unique - -// AWS Cloudformation stdlib -cfnStack: cloudformation.#Stack & { - config: awsConfig - stackName: cfnStackName - onFailure: "DO_NOTHING" - source: json.Marshal(#cfnTemplate) -} - -#cfnTemplate: { - // Paste Cue Cloudformation template here -} -``` - - - - -```cue title="todoapp/cloudformation/source.cue" -package cloudformation - -import ( - "dagger.io/aws" // <-- Import AWS relay to instanciate aws.#Config - "dagger.io/random" // <-- Import Random relay to instanciate random.#String - "dagger.io/aws/cloudformation" // <-- Import Cloudformation relay to instanciate aws.#Cloudformation -) - -// AWS account: credentials and region -awsConfig: aws.#Config & { // Assign an aws.#Config definition to a field named `awsConfig` - // awsConfig will be a directly requestable key : `dagger query awsConfig` - // awsConfig sets the region to either an input, or a default string: "us-east-2" - region: string @dagger(input) - // As we declare an aws.#Config, Dagger/Cue will automatically know that some others values inside this definition - // are inputs, especially secrets (AccessKey, secretKey). Due to the confidential nature of secrets, we won't declare default values to them -} - -// AWS Cloudformation stdlib -cfnStack: cloudformation.#Stack & { // Assign an aws.#Cloudformation definition to a field named `cfnStack` - // This definition is the stdlib package to use in order to deploy AWS instances programmatically - - config: awsConfig // As seen in the relay doc, 3 config fields have to be provided : `config.region`, `config.accessKey` and `config.secretKey` - // As their names contain a `.`, it means that the value `config` expects 3 fields `region`, `accessKey` and `secretKey`, included in a `aws.#Config` parent definition - - stackName: cfnStackName // We assign to the `stackName` the `cfnStackName` declared below. - // `stackName` expects a string type. However, as a plan developer, we wanted to give the developer a choice : either a default random value, or an input - // The default random value *"stack-\(suffix.out)" uses the random.#String relay to generate a random value. We append it's result inside `"\(append_happening_here)"` - - onFailure: "DO_NOTHING" // As cited in the Cloudformation relay, the `onFailure` key defines Cloudformation's stack behavior on failure - - source: json.Marshal(#cfnTemplate) // source expects a JSON artifact. Here we remarshall the template decaled in Cue -} - -// Create a random suffix (cf. random relay) -suffix: random.#String & { // Assign a #random definition to a field named `suffix` - seed: "" // Set seed to empty string, to generate a new random string every time -} // Output -> suffix.out is a random string - -// Request the cloudformation stackname as an input, or generated a default one with a random suffix to keep uniqueness -cfnStackName: *"stack-\(suffix.out)" | string @dagger(input) // Has to be unique - -#cfnTemplate: { - // Paste Cue Cloudformation template here -} -``` - - - - -```cue title="todoapp/cloudformation/source.cue" -package cloudformation - -import ( - "encoding/json" - - "dagger.io/aws" - "dagger.io/random" - "dagger.io/aws/cloudformation" -) - -// AWS account: credentials and region -awsConfig: aws.#Config & { - region: string @dagger(input) -} - -// Create a random suffix -suffix: random.#String & { - seed: "" -} - -// Query the Cloudformation stackname, or create one with a random suffix to keep unicity -cfnStackName: *"stack-\(suffix.out)" | string @dagger(input) - -// AWS Cloudformation stdlib -cfnStack: cloudformation.#Stack & { - config: awsConfig - stackName: cfnStackName - onFailure: "DO_NOTHING" - source: json.Marshal(#cfnTemplate) -} - -#cfnTemplate: { +// Wrap exported Cue in previous point inside the `s3` value +s3: { "AWSTemplateFormatVersion": "2010-09-09", "Outputs": { "Name": { @@ -792,42 +493,154 @@ cfnStack: cloudformation.#Stack & { } } } + +// Template contains the marshalled value of the s3 template +template: json.Marshal(s3) ``` - - +We're using the built-in `json.Marshal` function to convert CUE back to JSON, so Cloudformation still receives the same template. -### Deploy - -Finally ! We now have a working template ready to be used to provision S3 infrastructures. Let's add the missing inputs (aws credentials) and let's deploy it : - - - +You can inspect the configuration using `dagger query -e cloudformation` to verify it produces the same manifest: ```shell -dagger input secret awsConfig.accessKey yourAccessKey +dagger query template -f text -e cloudformation +``` -dagger input secret awsConfig.secretKey yourSecretKey +Now that the template is defined in CUE, we can use the language to add more flexibility to our template. -dagger input list -# Input Value Set by user Description -# awsConfig.region string false AWS region -# awsConfig.accessKey dagger.#Secret true AWS access key <-- Specified -# awsConfig.secretKey dagger.#Secret true AWS secret key <-- Specified -# suffix.length *12 | number false length of the string -# cfnStack.timeout *10 | >=0 & int false Timeout for waiting for the stack to be created/updated (in minutes) -# cfnStack.neverUpdate *false | bool false Never update the stack if already exists +Let's define a re-usable `#Deployment` definition in `todoapp/cloudformation/deployment.cue`: -# All the other inputs have default values, we're good to go ! +```cue title="todoapp/cue.mod/cloudformation/deployment.cue" +package cloudformation -dagger up -# Output: +#Deployment: { + + // Bucket's output description + description: string + + // index file + indexDocument: *"index.html" | string + + // error file + errorDocument: *"error.html" | string + + // Bucket policy version + version: *"2012-10-17" | string + + // Retain as default deletion policy. Delete is also accepted but requires the s3 bucket to be empty + deletionPolicy: *"Retain" | "Delete" + + // Canned access control list (ACL) that grants predefined permissions to the bucket + accessControl: *"PublicRead" | "Private" | "PublicReadWrite" | "AuthenticatedRead" | "LogDeliveryWrite" | "BucketOwnerRead" | "BucketOwnerFullControl" | "AwsExecRead" + + // Modified copy of s3 value in `todoapp/cloudformation/template.cue` + template: { + "AWSTemplateFormatVersion": "2010-09-09", + "Outputs": { + "Name": { + "Description": description, + "Value": { + "Fn::GetAtt": [ + "S3Bucket", + "Arn" + ] + } + } + }, + "Resources": { + "BucketPolicy": { + "Properties": { + "Bucket": { + "Ref": "S3Bucket" + }, + "PolicyDocument": { + "Id": "MyPolicy", + "Statement": [ + { + "Action": "s3:GetObject", + "Effect": "Allow", + "Principal": "*", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:aws:s3:::", + { + "Ref": "S3Bucket" + }, + "/*" + ] + ] + }, + "Sid": "PublicReadForGetBucketObjects" + } + ], + "Version": version + } + }, + "Type": "AWS::S3::BucketPolicy" + }, + "S3Bucket": { + "DeletionPolicy": deletionPolicy, + "Properties": { + "AccessControl": "PublicRead", + "WebsiteConfiguration": { + "ErrorDocument": errorDocument, + "IndexDocument": indexDocument + } + }, + "Type": "AWS::S3::Bucket" + } + } + } +} +``` + +`template.cue` can be rewritten as follows: + +```cue title="todoapp/cue.mod/cloudformation/template.cue" +package cloudformation +import "encoding/json" + +s3: #Deployment & { + description: "Name S3 Bucket" +} + +// Template contains the marshalled value of the s3 template +template: json.Marshal(s3.template) +``` + +Verify template + +Double-checks at the template level can be done with manual uploads on Cloudformation's web interface or by executing the below command locally: + +```shell +tmpfile=$(mktemp ./tmp.XXXXXX) && dagger query template -f text -e cloudformation > "$tmpfile" && aws cloudformation validate-template --template-body file://"$tmpfile" ; rm "$tmpfile" +``` + +Let's make sure it yields the same result: + +```shell +dagger query template -f text -e cloudformation +# { +# "description": "Name S3 Bucket", +# "indexDocument": "index.html", +# "errorDocument": "error.html", +# "version": "2012-10-17", +# "deletionPolicy": "Retain", +# "accessControl": "PublicRead", +# "template": { +# "AWSTemplateFormatVersion": "2010-09-09", +# "Outputs": { +# "Name": { +# "Description": "Name S3 Bucket", +# "Value": { +``` + +And we can now deploy it: + +```shell +dagger up -e cloudformation #2:22PM INF suffix.out | computing #2:22PM INF suffix.out | completed duration=200ms #2:22PM INF cfnStack.outputs | computing @@ -838,60 +651,19 @@ dagger up #2:22PM INF cfnStack.outputs | #15 2.948 "StackId": "arn:aws:cloudformation:us-east-2:817126022176:stack/stack-emktqcfwksng/207d29a0-cd0b-11eb-aafd-0a6bae5481b4" #2:22PM INF cfnStack.outputs | #15 2.948 } #2:22PM INF cfnStack.outputs | completed duration=35s - -dagger output list -# Output Value Description -# suffix.out "emktqcfwksng" generated random string -# cfnStack.outputs.Name "arn:aws:s3:::stack-emktqcfwksng-s3bucket-9eiowjs1jab4" - ``` - - +Name of the deployed bucket: ```shell -dagger input secret awsConfig.accessKey yourAccessKey - -dagger input secret awsConfig.secretKey yourSecretKey - -dagger input list -# Input Value Set by user Description -# awsConfig.region string false AWS region -# awsConfig.accessKey dagger.#Secret true AWS access key <-- Specified -# awsConfig.secretKey dagger.#Secret true AWS secret key <-- Specified -# suffix.length *12 | number false length of the string -# cfnStack.timeout *10 | >=0 & int false Timeout for waiting for the stack to be created/updated (in minutes) -# cfnStack.neverUpdate *false | bool false Never update the stack if already exists - -# All the other inputs have default values, we're good to go ! - -dagger up -l debug -#Output: -# 3:50PM DBG system | detected buildkit version version=v0.8.3 -# 3:50PM DBG system | spawning buildkit job localdirs={ -# "/tmp/infra-provisioning/.dagger/env/infra/plan": "/tmp/infra-provisioning/.dagger/env/infra/plan" -# } attrs=null -# 3:50PM DBG system | loading configuration -# ... Lots of logs ... :-D +dagger output list -e cloudformation # Output Value Description -# suffix.out "abnyiemsoqbm" generated random string -# cfnStack.outputs.Name "arn:aws:s3:::stack-abnyiemsoqbm-s3bucket-9eiowjs1jab4" - - -dagger output list -# Output Value Description -# suffix.out "abnyiemsoqbm" generated random string -# cfnStack.outputs.Name "arn:aws:s3:::stack-abnyiemsoqbm-s3bucket-9eiowjs1jab4" - +# suffix.out "ucwcecwwshdl" generated random string +# cfnStack.outputs.Name "arn:aws:s3:::stack-ucwcecwwshdl-s3bucket-gaqmj8rzsl08" - ``` - - - -> The deployment went well ! - -In case of a failure, the `Debug deploy` tab shows the command to use in order to get more informations. The name of the provisioned S3 instance lies in the `cfnStack.outputs.Name` output key, without `arn:aws:s3:::` -> With this provisioning infrastructure, your dev team will easily be able to instanciate aws infrastructures : all they need to know is `dagger input list` and `dagger up`, isn't that awesome ? :-D +PS: This plan could be further extended with the AWS S3 example. It could provide infrastructure and quickly deploy it. -PS: This plan could be further extended with the AWS S3 example : it could not only provision an infrastructure but also easily deploy on it. - -PS1: As it could make a nice first exercise for you, this won't be detailed here. However, we're interested in your imagination : let us know your implementations :-) +PS1: As it could be an excellent first exercise for you, this won't be detailed here. However, we're interested in your imagination: let us know your implementations :-) diff --git a/docs/reference/universe/README.md b/docs/reference/universe/README.md new file mode 100644 index 00000000..139b2b41 --- /dev/null +++ b/docs/reference/universe/README.md @@ -0,0 +1,31 @@ +# Index + +- [alpine](./alpine.md) - Base package for Alpine Linux +- [aws](./aws/README.md) - AWS base package +- [aws/cloudformation](./aws/cloudformation.md) - AWS CloudFormation +- [aws/ecr](./aws/ecr.md) - Amazon Elastic Container Registry (ECR) +- [aws/ecs](./aws/ecs.md) - AWS Elastic Container Service (ECS) +- [aws/eks](./aws/eks.md) - AWS Elastic Kubernetes Service (EKS) +- [aws/elb](./aws/elb.md) - AWS Elastic Load Balancer (ELBv2) +- [aws/rds](./aws/rds.md) - AWS Relational Database Service (RDS) +- [aws/s3](./aws/s3.md) - AWS Simple Storage Service +- [dagger](./dagger/README.md) - Dagger core types +- [dagger/op](./dagger/op.md) - op: low-level operations for Dagger processing pipelines +- [docker](./docker/README.md) - Docker container operations +- [docker/compose](./docker/compose.md) - Docker-compose operations +- [gcp](./gcp/README.md) - Google Cloud Platform +- [gcp/gcr](./gcp/gcr.md) - Google Container Registry +- [gcp/gcs](./gcp/gcs.md) - Google Cloud Storage +- [gcp/gke](./gcp/gke.md) - Google Kubernetes Engine +- [git](./git.md) - Git operations +- [go](./go.md) - Go build operations +- [io](./io.md) - IO operations +- [java/maven](./java/maven.md) - Maven is a build automation tool for Java +- [js/yarn](./js/yarn.md) - Yarn is a package manager for Javascript applications +- [kubernetes](./kubernetes/README.md) - Kubernetes client operations +- [kubernetes/helm](./kubernetes/helm.md) - Helm package manager +- [kubernetes/kustomize](./kubernetes/kustomize.md) - Kustomize config management +- [netlify](./netlify.md) - Netlify client operations +- [os](./os.md) - OS operations +- [random](./random.md) - Random generation utilities +- [terraform](./terraform.md) - Terraform operations diff --git a/docs/reference/universe/alpine.md b/docs/reference/universe/alpine.md index fb3bdd16..7c2e6df8 100644 --- a/docs/reference/universe/alpine.md +++ b/docs/reference/universe/alpine.md @@ -2,12 +2,12 @@ sidebar_label: alpine --- -# dagger.io/alpine +# alpha.dagger.io/alpine Base package for Alpine Linux ```cue -import "dagger.io/alpine" +import "alpha.dagger.io/alpine" ``` ## alpine.#Image diff --git a/docs/reference/universe/aws/README.md b/docs/reference/universe/aws/README.md index b0755acc..7484c97e 100644 --- a/docs/reference/universe/aws/README.md +++ b/docs/reference/universe/aws/README.md @@ -2,12 +2,12 @@ sidebar_label: aws --- -# dagger.io/aws +# alpha.dagger.io/aws AWS base package ```cue -import "dagger.io/aws" +import "alpha.dagger.io/aws" ``` ## aws.#CLI diff --git a/docs/reference/universe/aws/cloudformation.md b/docs/reference/universe/aws/cloudformation.md index cf8f136e..8528db70 100644 --- a/docs/reference/universe/aws/cloudformation.md +++ b/docs/reference/universe/aws/cloudformation.md @@ -2,12 +2,12 @@ sidebar_label: cloudformation --- -# dagger.io/aws/cloudformation +# alpha.dagger.io/aws/cloudformation AWS CloudFormation ```cue -import "dagger.io/aws/cloudformation" +import "alpha.dagger.io/aws/cloudformation" ``` ## cloudformation.#Stack @@ -30,6 +30,4 @@ AWS CloudFormation Stack ### cloudformation.#Stack Outputs -| Name | Type | Description | -| ------------- |:-------------: |:-------------: | -|*outputs* | `struct` |- | +_No output._ diff --git a/docs/reference/universe/aws/ecr.md b/docs/reference/universe/aws/ecr.md index a77199d8..c45d1824 100644 --- a/docs/reference/universe/aws/ecr.md +++ b/docs/reference/universe/aws/ecr.md @@ -2,12 +2,12 @@ sidebar_label: ecr --- -# dagger.io/aws/ecr +# alpha.dagger.io/aws/ecr Amazon Elastic Container Registry (ECR) ```cue -import "dagger.io/aws/ecr" +import "alpha.dagger.io/aws/ecr" ``` ## ecr.#Credentials diff --git a/docs/reference/universe/aws/ecs.md b/docs/reference/universe/aws/ecs.md index 578d36ed..e80cafa8 100644 --- a/docs/reference/universe/aws/ecs.md +++ b/docs/reference/universe/aws/ecs.md @@ -2,10 +2,10 @@ sidebar_label: ecs --- -# dagger.io/aws/ecs +# alpha.dagger.io/aws/ecs AWS Elastic Container Service (ECS) ```cue -import "dagger.io/aws/ecs" +import "alpha.dagger.io/aws/ecs" ``` diff --git a/docs/reference/universe/aws/eks.md b/docs/reference/universe/aws/eks.md index 1f47ce10..7d445769 100644 --- a/docs/reference/universe/aws/eks.md +++ b/docs/reference/universe/aws/eks.md @@ -2,12 +2,12 @@ sidebar_label: eks --- -# dagger.io/aws/eks +# alpha.dagger.io/aws/eks AWS Elastic Kubernetes Service (EKS) ```cue -import "dagger.io/aws/eks" +import "alpha.dagger.io/aws/eks" ``` ## eks.#KubeConfig diff --git a/docs/reference/universe/aws/elb.md b/docs/reference/universe/aws/elb.md index 91661c59..adf122a4 100644 --- a/docs/reference/universe/aws/elb.md +++ b/docs/reference/universe/aws/elb.md @@ -2,12 +2,12 @@ sidebar_label: elb --- -# dagger.io/aws/elb +# alpha.dagger.io/aws/elb AWS Elastic Load Balancer (ELBv2) ```cue -import "dagger.io/aws/elb" +import "alpha.dagger.io/aws/elb" ``` ## elb.#RandomRulePriority diff --git a/docs/reference/universe/aws/rds.md b/docs/reference/universe/aws/rds.md index 735fb50f..9c5735f1 100644 --- a/docs/reference/universe/aws/rds.md +++ b/docs/reference/universe/aws/rds.md @@ -2,12 +2,12 @@ sidebar_label: rds --- -# dagger.io/aws/rds +# alpha.dagger.io/aws/rds AWS Relational Database Service (RDS) ```cue -import "dagger.io/aws/rds" +import "alpha.dagger.io/aws/rds" ``` ## rds.#Database diff --git a/docs/reference/universe/aws/s3.md b/docs/reference/universe/aws/s3.md index 69c5533c..ca7b54dd 100644 --- a/docs/reference/universe/aws/s3.md +++ b/docs/reference/universe/aws/s3.md @@ -2,12 +2,12 @@ sidebar_label: s3 --- -# dagger.io/aws/s3 +# alpha.dagger.io/aws/s3 AWS Simple Storage Service ```cue -import "dagger.io/aws/s3" +import "alpha.dagger.io/aws/s3" ``` ## s3.#Object diff --git a/docs/reference/universe/dagger/README.md b/docs/reference/universe/dagger/README.md index 83e7c398..60694e45 100644 --- a/docs/reference/universe/dagger/README.md +++ b/docs/reference/universe/dagger/README.md @@ -2,10 +2,12 @@ sidebar_label: dagger --- -# dagger.io/dagger +# alpha.dagger.io/dagger + +Dagger core types ```cue -import "dagger.io/dagger" +import "alpha.dagger.io/dagger" ``` ## dagger.#Secret diff --git a/docs/reference/universe/dagger/op.md b/docs/reference/universe/dagger/op.md index ddff6a1e..a862f0d8 100644 --- a/docs/reference/universe/dagger/op.md +++ b/docs/reference/universe/dagger/op.md @@ -2,12 +2,12 @@ sidebar_label: op --- -# dagger.io/dagger/op +# alpha.dagger.io/dagger/op op: low-level operations for Dagger processing pipelines ```cue -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" ``` ## op.#Copy diff --git a/docs/reference/universe/docker.md b/docs/reference/universe/docker/README.md similarity index 94% rename from docs/reference/universe/docker.md rename to docs/reference/universe/docker/README.md index 7812a1ec..6ec5f28c 100644 --- a/docs/reference/universe/docker.md +++ b/docs/reference/universe/docker/README.md @@ -2,12 +2,12 @@ sidebar_label: docker --- -# dagger.io/docker +# alpha.dagger.io/docker Docker container operations ```cue -import "dagger.io/docker" +import "alpha.dagger.io/docker" ``` ## docker.#Build @@ -33,6 +33,7 @@ A container image that can run any docker command | Name | Type | Description | | ------------- |:-------------: |:-------------: | |*command* | `string` |Command to execute | +|*registries* | `[]` |Image registries | ### docker.#Command Outputs @@ -99,6 +100,7 @@ _No output._ |*run.ssh.key* | `dagger.#Secret` |private key | |*run.command* | `"""\n # Run detach container\n OPTS=""\n \n if [ ! -z "$CONTAINER_NAME" ]; then\n \tOPTS="$OPTS --name $CONTAINER_NAME"\n fi\n \n docker container run -d $OPTS "$IMAGE_REF"\n """` |Command to execute | |*run.env.IMAGE_REF* | `string` |- | +|*run.registries* | `[]` |Image registries | ### docker.#Run Outputs diff --git a/docs/reference/universe/docker/compose.md b/docs/reference/universe/docker/compose.md new file mode 100644 index 00000000..2a74308c --- /dev/null +++ b/docs/reference/universe/docker/compose.md @@ -0,0 +1,40 @@ +--- +sidebar_label: compose +--- + +# alpha.dagger.io/docker/compose + +Docker-compose operations + +```cue +import "alpha.dagger.io/docker/compose" +``` + +## compose.#App + +### compose.#App Inputs + +| Name | Type | Description | +| ------------- |:-------------: |:-------------: | +|*name* | `*"source" \| string` |App name (use as COMPOSE_PROJECT_NAME) | +|*registries* | `[]` |Image registries | +|*run.command* | `"""\n if [ -n "$DOCKER_HOSTNAME" ]; then\n \tssh -i /key -fNT -o "StreamLocalBindUnlink=yes" -L "$(pwd)"/docker.sock:/var/run/docker.sock -p "$DOCKER_PORT" "$DOCKER_USERNAME"@"$DOCKER_HOSTNAME"\n \texport DOCKER_HOST="unix://$(pwd)/docker.sock"\n fi\n \n # Extend session duration\n echo "Host *\\nServerAliveInterval 240" \>\> "$HOME"/.ssh/config\n chmod 600 "$HOME"/.ssh/config\n \n # Move compose\n if [ -d "$SOURCE_DIR" ]; then\n \tif [ -f docker-compose.yaml ]; then\n \t\tcp docker-compose.yaml "$SOURCE_DIR"/docker-compose.yaml\n \tfi\n \tcd "$SOURCE_DIR"\n fi\n \n docker-compose build\n docker-compose up -d\n """` |Command to execute | +|*run.env.COMPOSE_PROJECT_NAME* | `*"source" \| string` |- | +|*run.package."docker-compose"* | `true` |- | +|*run.registries* | `[]` |Image registries | + +### compose.#App Outputs + +_No output._ + +## compose.#Client + +A container image to run the docker-compose client + +### compose.#Client Inputs + +_No input._ + +### compose.#Client Outputs + +_No output._ diff --git a/docs/reference/universe/file.md b/docs/reference/universe/file.md deleted file mode 100644 index d7be3274..00000000 --- a/docs/reference/universe/file.md +++ /dev/null @@ -1,84 +0,0 @@ ---- -sidebar_label: file ---- - -# dagger.io/file - -DEPRECATED: see dagger.io/os - -## #Append - -### #Append Inputs - -| Name | Type | Description | -| ------------- |:-------------: |:-------------: | -|*filename* | `string` |- | -|*permissions* | `*0o644 \| int` |- | -|*contents* | `(string\|bytes)` |- | -|*from* | `dagger.#Artifact` |- | - -### #Append Outputs - -| Name | Type | Description | -| ------------- |:-------------: |:-------------: | -|*orig* | `string` |- | - -## #Create - -### #Create Inputs - -| Name | Type | Description | -| ------------- |:-------------: |:-------------: | -|*filename* | `string` |- | -|*permissions* | `*0o644 \| int` |- | -|*contents* | `(string\|bytes)` |- | - -### #Create Outputs - -_No output._ - -## #Glob - -### #Glob Inputs - -| Name | Type | Description | -| ------------- |:-------------: |:-------------: | -|*glob* | `string` |- | -|*from* | `dagger.#Artifact` |- | - -### #Glob Outputs - -| Name | Type | Description | -| ------------- |:-------------: |:-------------: | -|*filenames* | `_\|_` |trim suffix because ls always ends with newline | -|*files* | `string` |- | - -## #Read - -### #Read Inputs - -| Name | Type | Description | -| ------------- |:-------------: |:-------------: | -|*filename* | `string` |- | -|*from* | `dagger.#Artifact` |- | - -### #Read Outputs - -| Name | Type | Description | -| ------------- |:-------------: |:-------------: | -|*contents* | `string` |- | - -## #read - -### #read Inputs - -| Name | Type | Description | -| ------------- |:-------------: |:-------------: | -|*path* | `string` |- | -|*from* | `dagger.#Artifact` |- | - -### #read Outputs - -| Name | Type | Description | -| ------------- |:-------------: |:-------------: | -|*data* | `string` |- | diff --git a/docs/reference/universe/gcp/README.md b/docs/reference/universe/gcp/README.md index f2ded155..1b42d71e 100644 --- a/docs/reference/universe/gcp/README.md +++ b/docs/reference/universe/gcp/README.md @@ -2,12 +2,12 @@ sidebar_label: gcp --- -# dagger.io/gcp +# alpha.dagger.io/gcp Google Cloud Platform ```cue -import "dagger.io/gcp" +import "alpha.dagger.io/gcp" ``` ## gcp.#Config diff --git a/docs/reference/universe/gcp/gcr.md b/docs/reference/universe/gcp/gcr.md index 9bfc320d..169fcdbc 100644 --- a/docs/reference/universe/gcp/gcr.md +++ b/docs/reference/universe/gcp/gcr.md @@ -2,12 +2,12 @@ sidebar_label: gcr --- -# dagger.io/gcp/gcr +# alpha.dagger.io/gcp/gcr Google Container Registry ```cue -import "dagger.io/gcp/gcr" +import "alpha.dagger.io/gcp/gcr" ``` ## gcr.#Credentials diff --git a/docs/reference/universe/gcp/gcs.md b/docs/reference/universe/gcp/gcs.md new file mode 100644 index 00000000..462d5245 --- /dev/null +++ b/docs/reference/universe/gcp/gcs.md @@ -0,0 +1,34 @@ +--- +sidebar_label: gcs +--- + +# alpha.dagger.io/gcp/gcs + +Google Cloud Storage + +```cue +import "alpha.dagger.io/gcp/gcs" +``` + +## gcs.#Object + +GCS Bucket object(s) sync + +### gcs.#Object Inputs + +| Name | Type | Description | +| ------------- |:-------------: |:-------------: | +|*config.region* | `string` |GCP region | +|*config.project* | `string` |GCP project | +|*config.serviceKey* | `dagger.#Secret` |GCP service key | +|*source* | `dagger.#Artifact` |Source Artifact to upload to GCS | +|*target* | `string` |Target GCS URL (eg. gs://\/\/\) | +|*delete* | `*false \| true` |Delete files that already exist on remote destination | +|*contentType* | `*"" \| string` |Object content type | +|*always* | `*true \| false` |Always write the object to GCS | + +### gcs.#Object Outputs + +| Name | Type | Description | +| ------------- |:-------------: |:-------------: | +|*url* | `string` |URL of the uploaded GCS object | diff --git a/docs/reference/universe/gcp/gke.md b/docs/reference/universe/gcp/gke.md index 781db781..a01c1fd6 100644 --- a/docs/reference/universe/gcp/gke.md +++ b/docs/reference/universe/gcp/gke.md @@ -2,12 +2,12 @@ sidebar_label: gke --- -# dagger.io/gcp/gke +# alpha.dagger.io/gcp/gke Google Kubernetes Engine ```cue -import "dagger.io/gcp/gke" +import "alpha.dagger.io/gcp/gke" ``` ## gke.#KubeConfig diff --git a/docs/reference/universe/git.md b/docs/reference/universe/git.md index 95cdcaa5..956a4125 100644 --- a/docs/reference/universe/git.md +++ b/docs/reference/universe/git.md @@ -2,12 +2,12 @@ sidebar_label: git --- -# dagger.io/git +# alpha.dagger.io/git Git operations ```cue -import "dagger.io/git" +import "alpha.dagger.io/git" ``` ## git.#CurrentBranch diff --git a/docs/reference/universe/go.md b/docs/reference/universe/go.md index adb63faf..e464fe5c 100644 --- a/docs/reference/universe/go.md +++ b/docs/reference/universe/go.md @@ -2,12 +2,12 @@ sidebar_label: go --- -# dagger.io/go +# alpha.dagger.io/go Go build operations ```cue -import "dagger.io/go" +import "alpha.dagger.io/go" ``` ## go.#Build diff --git a/docs/reference/universe/io.md b/docs/reference/universe/io.md index ada35879..84bf2422 100644 --- a/docs/reference/universe/io.md +++ b/docs/reference/universe/io.md @@ -2,12 +2,12 @@ sidebar_label: io --- -# dagger.io/io +# alpha.dagger.io/io IO operations ```cue -import "dagger.io/io" +import "alpha.dagger.io/io" ``` ## io.#Dir diff --git a/docs/reference/universe/java/maven.md b/docs/reference/universe/java/maven.md new file mode 100644 index 00000000..17387563 --- /dev/null +++ b/docs/reference/universe/java/maven.md @@ -0,0 +1,32 @@ +--- +sidebar_label: maven +--- + +# alpha.dagger.io/java/maven + +Maven is a build automation tool for Java + +```cue +import "alpha.dagger.io/java/maven" +``` + +## maven.#Project + +A Maven project + +### maven.#Project Inputs + +| Name | Type | Description | +| ------------- |:-------------: |:-------------: | +|*source* | `dagger.#Artifact` |Application source code | +|*package* | `struct` |Extra alpine packages to install | +|*env* | `struct` |Environment variables | +|*phases* | `*["package"] \| []` |- | +|*goals* | `*[] \| []` |- | +|*args* | `*[] \| []` |Optional arguments for the script | + +### maven.#Project Outputs + +| Name | Type | Description | +| ------------- |:-------------: |:-------------: | +|*build* | `struct` |Build output directory | diff --git a/docs/reference/universe/js/yarn.md b/docs/reference/universe/js/yarn.md index 1c4a2c35..322847d0 100644 --- a/docs/reference/universe/js/yarn.md +++ b/docs/reference/universe/js/yarn.md @@ -2,12 +2,12 @@ sidebar_label: yarn --- -# dagger.io/js/yarn +# alpha.dagger.io/js/yarn Yarn is a package manager for Javascript applications ```cue -import "dagger.io/js/yarn" +import "alpha.dagger.io/js/yarn" ``` ## yarn.#Package diff --git a/docs/reference/universe/kubernetes/README.md b/docs/reference/universe/kubernetes/README.md index d89aad60..9b4f102c 100644 --- a/docs/reference/universe/kubernetes/README.md +++ b/docs/reference/universe/kubernetes/README.md @@ -2,12 +2,12 @@ sidebar_label: kubernetes --- -# dagger.io/kubernetes +# alpha.dagger.io/kubernetes Kubernetes client operations ```cue -import "dagger.io/kubernetes" +import "alpha.dagger.io/kubernetes" ``` ## kubernetes.#Kubectl diff --git a/docs/reference/universe/kubernetes/helm.md b/docs/reference/universe/kubernetes/helm.md index 52a5e127..39c6c010 100644 --- a/docs/reference/universe/kubernetes/helm.md +++ b/docs/reference/universe/kubernetes/helm.md @@ -2,12 +2,12 @@ sidebar_label: helm --- -# dagger.io/kubernetes/helm +# alpha.dagger.io/kubernetes/helm Helm package manager ```cue -import "dagger.io/kubernetes/helm" +import "alpha.dagger.io/kubernetes/helm" ``` ## helm.#Chart diff --git a/docs/reference/universe/kubernetes/kustomize.md b/docs/reference/universe/kubernetes/kustomize.md index d7e8efe1..188b999b 100644 --- a/docs/reference/universe/kubernetes/kustomize.md +++ b/docs/reference/universe/kubernetes/kustomize.md @@ -2,12 +2,12 @@ sidebar_label: kustomize --- -# dagger.io/kubernetes/kustomize +# alpha.dagger.io/kubernetes/kustomize Kustomize config management ```cue -import "dagger.io/kubernetes/kustomize" +import "alpha.dagger.io/kubernetes/kustomize" ``` ## kustomize.#Kustomization diff --git a/docs/reference/universe/netlify.md b/docs/reference/universe/netlify.md index 823a429c..ccd4a68f 100644 --- a/docs/reference/universe/netlify.md +++ b/docs/reference/universe/netlify.md @@ -2,12 +2,12 @@ sidebar_label: netlify --- -# dagger.io/netlify +# alpha.dagger.io/netlify Netlify client operations ```cue -import "dagger.io/netlify" +import "alpha.dagger.io/netlify" ``` ## netlify.#Account diff --git a/docs/reference/universe/os.md b/docs/reference/universe/os.md index 48309e3d..9a37823b 100644 --- a/docs/reference/universe/os.md +++ b/docs/reference/universe/os.md @@ -2,10 +2,12 @@ sidebar_label: os --- -# dagger.io/os +# alpha.dagger.io/os + +OS operations ```cue -import "dagger.io/os" +import "alpha.dagger.io/os" ``` ## os.#Container @@ -32,7 +34,7 @@ _No output._ ## os.#File -Built-in file implementation, using buildkit +Built-in file implementation, using buildkit A single file ### os.#File Inputs diff --git a/docs/reference/universe/random.md b/docs/reference/universe/random.md index b5f6a347..e80e4ed0 100644 --- a/docs/reference/universe/random.md +++ b/docs/reference/universe/random.md @@ -2,12 +2,12 @@ sidebar_label: random --- -# dagger.io/random +# alpha.dagger.io/random Random generation utilities ```cue -import "dagger.io/random" +import "alpha.dagger.io/random" ``` ## random.#String diff --git a/docs/reference/universe/terraform.md b/docs/reference/universe/terraform.md index 7188503f..0318ba15 100644 --- a/docs/reference/universe/terraform.md +++ b/docs/reference/universe/terraform.md @@ -2,12 +2,12 @@ sidebar_label: terraform --- -# dagger.io/terraform +# alpha.dagger.io/terraform Terraform operations ```cue -import "dagger.io/terraform" +import "alpha.dagger.io/terraform" ``` ## terraform.#Configuration diff --git a/go.mod b/go.mod index 178cbebe..e928cafc 100644 --- a/go.mod +++ b/go.mod @@ -22,7 +22,7 @@ require ( github.com/opentracing/opentracing-go v1.2.0 github.com/rs/zerolog v1.23.0 github.com/spf13/cobra v1.1.3 - github.com/spf13/viper v1.8.0 + github.com/spf13/viper v1.8.1 github.com/stretchr/testify v1.7.0 github.com/tonistiigi/fsutil v0.0.0-20201103201449-0834f99b7b85 github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea @@ -33,7 +33,7 @@ require ( golang.org/x/sync v0.0.0-20210220032951-036812b2e83c golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1 - google.golang.org/grpc v1.38.0 + google.golang.org/grpc v1.39.0 gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b ) diff --git a/go.sum b/go.sum index 58fc4482..6ebca3be 100644 --- a/go.sum +++ b/go.sum @@ -230,6 +230,7 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= github.com/cockroachdb/apd/v2 v2.0.1 h1:y1Rh3tEU89D+7Tgbw+lp52T6p/GJLpDmNvr10UWqLTE= @@ -352,6 +353,7 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= @@ -997,8 +999,8 @@ github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DM github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/spf13/viper v1.6.1/go.mod h1:t3iDnF5Jlj76alVNuyFBk5oUMCvsrkbvZK0WQdfDi5k= github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.8.0 h1:QRwDgoG8xX+kp69di68D+YYTCWfYEckbZRfUlEIAal0= -github.com/spf13/viper v1.8.0/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= +github.com/spf13/viper v1.8.1 h1:Kq1fyeebqsBfbjZj4EL7gj2IO0mMaiyjYUWcUsl2O44= +github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= github.com/stretchr/objx v0.0.0-20180129172003-8a3f7159479f/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -1108,6 +1110,7 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= @@ -1535,8 +1538,9 @@ google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA5 google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.38.0 h1:/9BgsAsa5nWe26HqOlvlgJnqBuktYOLCgjCPqsa56W0= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.39.0 h1:Klz8I9kdtkIN6EpHHUOMLCYhTn/2WAe5a0s1hcBkdTI= +google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/stdlib/.dagger/env/alpine/values.yaml b/stdlib/.dagger/env/alpine/values.yaml index 9ac829e5..719d86f5 100644 --- a/stdlib/.dagger/env/alpine/values.yaml +++ b/stdlib/.dagger/env/alpine/values.yaml @@ -1,5 +1,6 @@ plan: - module: .dagger/env/alpine/plan + module: ./alpine + package: ./tests name: alpine sops: kms: [] @@ -16,8 +17,8 @@ sops: N0JOK1FwdzkrcGR5V0xhUDdNOFNvYk0KetOvulxA0Hilyhv+eWBqYO3GXNvm38Y1 9Pa7HYazNyi0qMcZpecWlp4QsOoL876dj1rE62cYHT2hkt2J2ijAUw== -----END AGE ENCRYPTED FILE----- - lastmodified: "2021-06-15T16:25:52Z" - mac: ENC[AES256_GCM,data:wk0mr4hUjg7ipIBE1Aph55inRgrXyO1K3jL1hj6N2oY10t6OyeL5IzZbS3aVBYZZh7QfEGkD0uVTqTJXgj5YorvJ2ZYo2RUV8uyUzUemI5jjytUHhKLV26Xz6R6fGHTFOoHYffZH7YhpX3lrc210eQCxHq8WDONeOqbRmwQT4Lw=,iv:HXQUdMlZvi1oEPQIrVuEk0qg1fGAhifPKRa3Fl4oGJM=,tag:gPSbqGPkNmavb6Zf4P2tWA==,type:str] + lastmodified: "2021-06-24T15:12:38Z" + mac: ENC[AES256_GCM,data:nDngshXQgLAIMAllALoPFQk2HbtnapzDud4LXqZLmHVUZP2LaAES9dGRbWwYc4iLVB1M+Gryk/FdI5/eafsvhSAytGXr6A6CEsrweHc4XPKfyxGS40LVZkxa0ntKUNQDZhlu+NTX333h8NEh99Xx3b7tfg+BtU9fvjnpv7zilW4=,iv:l5A2Bfvb4iT/IER0b2SMV42+7h9+YOIsMuMGG9jhq6E=,tag:v5yE3hZvs5Y5fK9JKaKUSQ==,type:str] pgp: [] encrypted_suffix: secret version: 3.7.1 diff --git a/stdlib/.dagger/env/aws-ecr/values.yaml b/stdlib/.dagger/env/aws-ecr/values.yaml index 3a5d6451..15fa6a9e 100644 --- a/stdlib/.dagger/env/aws-ecr/values.yaml +++ b/stdlib/.dagger/env/aws-ecr/values.yaml @@ -1,5 +1,6 @@ plan: - module: .dagger/env/aws-ecr/plan + module: ./aws/ecr + package: ./tests name: aws-ecr inputs: TestConfig.awsConfig.accessKey: @@ -21,8 +22,8 @@ sops: aXlvVWJVSGNTSkVyYmpZbi9nUVJZdmMK6csXZ2RMxFw5DB+Hb2TyhyoZT8c2/z7Y Lc9Pe8gb8aUq5Ha+wCybYvY6JWEM5A9XYJKbE7f4borTfGKS72d6pw== -----END AGE ENCRYPTED FILE----- - lastmodified: "2021-06-15T16:26:04Z" - mac: ENC[AES256_GCM,data:OjiRs9wN04IGRKDF7ibgerSnAEkPxQjKQ20ZN6X5cCwppVitwFnTPI9J/HiHQ7XaJSr6oaoELUywzCHa17cQNnz9o4NyDc947h9Tsu90fl2S9ChdSZ+dAP85+T3NWm1fbXPLdFw4EgePfTf6F7/Cktx/UVEFkkeggQoj7/cugRQ=,iv:vFQTDgqbEzIrVwNOKKi4M5DAEVGR3NFwWV9PwyT1Bck=,tag:Anjj7Zbt8oxpAI7RD1GZag==,type:str] + lastmodified: "2021-06-24T15:15:54Z" + mac: ENC[AES256_GCM,data:gH9/NLLJEEX+dYKmHS44aa9ENtN6dUJHcMgpdygPZVnqYYku7UF7ZZYF9FFw6VittsDUaTXPKsA4oXHXBxPws8uFOJ6t3B/WQAXCoSXe/3t7Z99RlaetZEWzAmfecGG1AcQnihwr7ymO6uuZ36s9q+LS1wZ81LG70gCqLR5c+kQ=,iv:kXnb23lkKVnyn3ewfvJhStGEGvT/OUNv5rSzfyV2kJc=,tag:q9IjsV9Yi4J7LS5wLQtx/A==,type:str] pgp: [] encrypted_suffix: secret version: 3.7.1 diff --git a/stdlib/.dagger/env/aws-eks/values.yaml b/stdlib/.dagger/env/aws-eks/values.yaml index 7d9d9582..4480794f 100644 --- a/stdlib/.dagger/env/aws-eks/values.yaml +++ b/stdlib/.dagger/env/aws-eks/values.yaml @@ -1,5 +1,6 @@ plan: - module: .dagger/env/aws-eks/plan + module: ./aws/eks + package: ./tests name: aws-eks inputs: TestConfig.awsConfig.accessKey: @@ -21,8 +22,8 @@ sops: M3U4UFV5REQzYko3QjlXVE02Z0J4WUkK8uHC67Mutls4drXbCi8AwuFqbRXeb69P ZnOFZEB4NoayoOojr1mY9ssDTywHF4KwR4E9ZmJ3V3hlEAgMkqfvSA== -----END AGE ENCRYPTED FILE----- - lastmodified: "2021-06-17T18:46:34Z" - mac: ENC[AES256_GCM,data:B+WtEMOKXy8AT/YTUaKZ9aA8fQRt2pJp3IaABpj0oYI1vCG953MnDCIxj0j2bTQN5gyaFPF8UQ1o/pRJzCKhm26wbCByUrVdHxHTwoJ7arDqQGwcNKYAuQjLtMG7gsl0BqjCg0oKO5YEa24BqHVf1dEo9AcXd6LBwqvxVjmd98g=,iv:aWxj1Oq6wmUYuWnGOc2zIpzOYJVyXV9qSzBgF+iGsHI=,tag:Bx1A8UxghYq97wEdUxbmdg==,type:str] + lastmodified: "2021-06-24T15:24:06Z" + mac: ENC[AES256_GCM,data:zRB7rhRuH95k2IxAbpf8FBfn0tiXKG4xEOv/M7qHxvexNhZWcBp1GnGnMI53CkzCMtTZcsdzquJJhQct2oyqXGbD9XNk9njC/hamtPVeXXtvDm2FTK8eHbb70tqIFCwspFXvfFMoNWCIZ5+CZTggTIOExnvAqsQ6QAN+FV3o25o=,iv:aghslE9r7hx1zmm2j/XznCyOJEoIs8CgUr5Wy/kuki0=,tag:6e701Vdjg+hnJElvZFnX7Q==,type:str] pgp: [] encrypted_suffix: secret version: 3.7.1 diff --git a/stdlib/.dagger/env/aws-s3/values.yaml b/stdlib/.dagger/env/aws-s3/values.yaml index c603a91d..9b79415b 100644 --- a/stdlib/.dagger/env/aws-s3/values.yaml +++ b/stdlib/.dagger/env/aws-s3/values.yaml @@ -1,5 +1,6 @@ plan: - module: .dagger/env/aws-s3/plan + module: ./aws/s3/ + package: ./tests name: aws-s3 inputs: TestConfig.awsConfig.accessKey: @@ -8,7 +9,7 @@ inputs: secret: ENC[AES256_GCM,data:Q/W+KH3NEouGt6C5S+KiC43837soYi2Mjb/z5K8rD9gtaNaBjjkJHg==,iv:8nGEzLXd91rF5YBZ/EdQoMN27yrpc0sgm26DEvIuSHM=,tag:/oyKl/vj5MJAm+jZMOOAuQ==,type:str] TestDirectory: dir: - path: ./aws/s3/testdata + path: ./aws/s3/tests/testdata sops: kms: [] gcp_kms: [] @@ -24,8 +25,8 @@ sops: aXlvVWJVSGNTSkVyYmpZbi9nUVJZdmMK6csXZ2RMxFw5DB+Hb2TyhyoZT8c2/z7Y Lc9Pe8gb8aUq5Ha+wCybYvY6JWEM5A9XYJKbE7f4borTfGKS72d6pw== -----END AGE ENCRYPTED FILE----- - lastmodified: "2021-06-15T16:26:02Z" - mac: ENC[AES256_GCM,data:hnPBOe4zF1jRtCKDCY8S5Zo+dCbitBBoQrmb2vcCclKhzbwKf6znTnd9F518DIgMUcRER3ii+7dvHgNXWI9gqlvuJleR+rnpUGa1jSlHHrhKFmc+5bKaOPdo394C+wZd/z5sMk02GVNSAJzLI3YhSureE+FUb90oc5Efp3hml7Y=,iv:e5AvOpWVvtBnZ3FnrorOk6HrWF+mFbH2xvSCUzA3g3Q=,tag:2WC4P/1xBzOMpCp72omHkg==,type:str] + lastmodified: "2021-06-24T15:29:49Z" + mac: ENC[AES256_GCM,data:tv+8xGY5Q2TkrO9qLxgtvUzfQG50ugCWGZZ7qIyYu2MB4Am88SVUG95GX/zHt5BGRMZQ/FJRnog7SiprC91wAgCjWR+kykhKeE7lygpVZpJTN0TD72a1X1vQKU7729KxPlu266q47Zc/w1N2tfx3krkQth2AjF12hokdZh93hhc=,iv:BPY2WVnKvxo2MYi58TW/gYPnfnFsOPIupSB7Hlh3y78=,tag:wBtD7PALUBAvO5OUGPuSbg==,type:str] pgp: [] encrypted_suffix: secret version: 3.7.1 diff --git a/stdlib/.dagger/env/docker-build/values.yaml b/stdlib/.dagger/env/docker-build/values.yaml index e876cc46..2ced3d22 100644 --- a/stdlib/.dagger/env/docker-build/values.yaml +++ b/stdlib/.dagger/env/docker-build/values.yaml @@ -1,13 +1,14 @@ plan: - module: .dagger/env/docker-build/plan + module: ./docker + package: ./tests/build name: docker-build inputs: TestSourceBuild: dir: - path: ./docker/testdata/build + path: ./docker/tests/build/testdata/build TestSourceImageFromDockerfile: dir: - path: ./docker/testdata/dockerfile + path: ./docker/tests/build/testdata/dockerfile sops: kms: [] gcp_kms: [] @@ -23,8 +24,8 @@ sops: Mm5vT1dHbFViK2ZIakNnVkZTd2lhUHMK63jJsJVLJMbQE2NkAB8qv8JnPHpvcNes z17EJgl0lCLqeNHtfrTfSiIP4wq8gNLK4avCKK+WGDOIMsXPzK6RNw== -----END AGE ENCRYPTED FILE----- - lastmodified: "2021-06-17T20:14:11Z" - mac: ENC[AES256_GCM,data:hlc0Bnfeoor/WKMbQRgTalkxngL0YXTwHAys/moXZ4ZMGd2lt+j4l4EkKSjb3QrJfPllCeqroohLKtN+lP4K9fSCMcfYzic2DTEP68rPwufmrgxys1snOHHgIEfqogL8p55fJdXn91x+WHhPNkbWaaH0WcboYsy0zemUIkjb+xc=,iv:8oUeR1dfT4lrVWyJpGPPFa/jlPgWA/ld3UM9Cw2znxk=,tag:59RyiXwzJ5j+c5faxs9U3w==,type:str] + lastmodified: "2021-06-24T15:44:20Z" + mac: ENC[AES256_GCM,data:zJsFrUaGd2Germ5nzov/0nDFBgtEL8W1Q9iYg3jQmOQhE6n91r4XipKHMuySbznHPqrZPPDeMabJXzMKlvqhAaWXOBAz9FRxSPlKH/UgdeNr9/YyMj25tqF4oycUAZUm6FZ6YCsEVsj7QIZnKKGR1oivE1Qe2gW9brpBzzu9JSU=,iv:ORQlfXm7+NjNA0tKtVVQMvvflS8p4mxZGk7bmzAiOfc=,tag:IKoqSXxl0zuQAcFW7RF1lA==,type:str] pgp: [] encrypted_suffix: secret version: 3.7.1 diff --git a/stdlib/.dagger/env/docker-command-ssh-key-passphrase/values.yaml b/stdlib/.dagger/env/docker-command-ssh-key-passphrase/values.yaml index 42d4c884..158809d9 100644 --- a/stdlib/.dagger/env/docker-command-ssh-key-passphrase/values.yaml +++ b/stdlib/.dagger/env/docker-command-ssh-key-passphrase/values.yaml @@ -1,5 +1,6 @@ plan: - module: .dagger/env/docker-command-ssh-key-passphrase/plan + module: ./docker + package: ./tests/command-ssh-key-passphrase name: docker-command-ssh-key-passphrase inputs: TestConfig.host: @@ -25,8 +26,8 @@ sops: cW1kbGZveVlkQkJDL2xYbmFRNjZEK0UKrSrOB/RL5lki54j4GUCE2G3CCO/8jpMU jfYkl7Yowb7kK3kKSNWORhB4ne3MEeGRZpJC8cvH7zjGvt/YYeU14A== -----END AGE ENCRYPTED FILE----- - lastmodified: "2021-06-15T16:26:14Z" - mac: ENC[AES256_GCM,data:N5P+lP0Ct5RH79VKEn8fCZE4OOo77j6+PrKzAbVXlVgC2GfV2nTxd18zQOYLBy5uErD6EWGUqeUgjDaDoSky67a+kOpeja1eNvKVSSzXFXcBjTgCIrbeS6tJfxM1682J8Vj6Kwmsmhc7csSeFOr5yCw5SwZ7NP81QQ+hrPb1348=,iv:EJyFQuZOCI9qq2bZZvlHTZdIh4EO9Z/A+Hq3cwnLNK4=,tag:W5WuqPEFOH8Yv68g/eyTIQ==,type:str] + lastmodified: "2021-06-24T15:57:03Z" + mac: ENC[AES256_GCM,data:YqGUjsf7fG8lMv791l5Td9a2oTbg1DVvZt4Dt1q7+L5opaAxhKoDwSimR7WsYuJJxEqkMoyB4X+7+SNzoAarMWqg20sFjUut6wMgi0iUOhym9OX76UYlC5AvsJ6zbIalgKktiece+3j9vwcqB7rR1ArwddbflRvxkw5VSpVXqj4=,iv:ch01NpT3K14dHrEZ3yigH8S3QlvpAK5Myjhh2P1CRpE=,tag:DjjxGwrGIeMeOaaVJx7DMA==,type:str] pgp: [] encrypted_suffix: secret version: 3.7.1 diff --git a/stdlib/.dagger/env/docker-command-ssh-wrong-key-passphrase/values.yaml b/stdlib/.dagger/env/docker-command-ssh-wrong-key-passphrase/values.yaml index c9d72a06..62eb0e8f 100644 --- a/stdlib/.dagger/env/docker-command-ssh-wrong-key-passphrase/values.yaml +++ b/stdlib/.dagger/env/docker-command-ssh-wrong-key-passphrase/values.yaml @@ -1,3 +1,6 @@ +plan: + module: ./docker + package: ./tests/command-ssh-wrong-key-passphrase name: docker-command-ssh-wrong-key-passphrase inputs: TestConfig.host: @@ -23,8 +26,8 @@ sops: R2tNU2JJWHFQTmhnUDd6eE13UUhQazgK+OQ50Q3+S5Fn2Y132ZeDrgUKWPcAk+et q8ppfZiPOtH4p6MwboSuh/vaTAAsxks7ctnqnU1pY+EHfnp8bHYHgQ== -----END AGE ENCRYPTED FILE----- - lastmodified: "2021-06-11T16:09:47Z" - mac: ENC[AES256_GCM,data:RTbDkgxWqVa4kgJPXny9u9hfwF1NG3g9L/6P2P44KE97yNdoxuAkuU1hs6DiATl4hgeck7p56gWLeUTeGAi+llMDqOodmSQEtD/XZvvdmyh4J+09+jg9QRwSL54xNR4Q83YBWy5PZm+hyYQdVl9H3omMCrdO78ydYXPSdDnRk3I=,iv:crEuUK+jQ6QBrf/Dxouu9+I3VXdZazKnHJ1g5JZLD0E=,tag:ymExWezKBTowuH4pugiQ/g==,type:str] + lastmodified: "2021-06-24T15:55:39Z" + mac: ENC[AES256_GCM,data:iE8xzhQ5/nBkzsASZ4R/yK85lb89/TUpLGL+5kfxNlWx6gQmLpzcRAuMObV5Xebv0nd+znLKcmDA35Qj5j66FsaGpk5Lym7c6/W7PT9dt/gfAvjTydHPgkJ8L/EMiSd06cQXq4jMB9/OAzZmPsosRAsmrijvy/tuDXAZM0IjazI=,iv:JfJ3UJsNhRsTz/3npxZ/Hy1HtAsczeVm8F7E0KvLwAE=,tag:fmf+1RVzTtijApc77LnSrQ==,type:str] pgp: [] encrypted_suffix: secret version: 3.7.1 diff --git a/stdlib/.dagger/env/docker-command-ssh/values.yaml b/stdlib/.dagger/env/docker-command-ssh/values.yaml index 77263ab3..6ec50ca8 100644 --- a/stdlib/.dagger/env/docker-command-ssh/values.yaml +++ b/stdlib/.dagger/env/docker-command-ssh/values.yaml @@ -1,5 +1,6 @@ plan: - module: .dagger/env/docker-command-ssh/plan + module: ./docker + package: ./tests/command-ssh name: docker-command-ssh inputs: TestConfig.host: @@ -23,8 +24,8 @@ sops: UEpoZy9HZUlHOVV3M05OSkZQS1l6aXcK3NfBITvd6la6nkcIzqH69xfv9RR0Jm7x vU5FvGROK3Z0ZR8NNXAtNH6VQQ21TDD2MOXWOVvjnIAAOVNEyc1amA== -----END AGE ENCRYPTED FILE----- - lastmodified: "2021-06-15T16:26:12Z" - mac: ENC[AES256_GCM,data:61Y9VaYoL4kUrxqhS5BVU1g6b4y7vJnuLsoRZF3ltdM7EojZq4bSiKoQHm4AxFL9exoM6ze6NqgqJBaMXQ7erOvX85/SFceCmksWz92n+HJxOfeqbVkY72c7ULVbf9hUs/YJaz7b5kelN6sFFVedY/iUf2JEGg4NSjL53jearNs=,iv:TVMMLWE7A5x1JrvXZxaCrHc5rxdtS/RdGqu7gwGkPS0=,tag:m2JfKTc9A9m0LblO5r1vjA==,type:str] + lastmodified: "2021-06-24T15:50:11Z" + mac: ENC[AES256_GCM,data:smCRgqcXPpgI909GOomUGrPfj5b0cNfha3CTicV7uzj675tTNqEVJTpgZiOWNUv3pQ535nhGuF4WRESZj+TuNabCWj0sMMU1EGvxUXuaV/TSXo3JtdFeU8tpn549UtcHez71sjKHiCTfGDdESPsAsYDLkkMBZkb9UE409on1Ypk=,iv:odHs0ukQTqfWb9ARFHpAh1qTZ/AZMLMQ6ZtVOged97k=,tag:sev1dRKD/7ZBgJamRCHqhQ==,type:str] pgp: [] encrypted_suffix: secret version: 3.7.1 diff --git a/stdlib/.dagger/env/docker-compose/.gitignore b/stdlib/.dagger/env/docker-compose/.gitignore new file mode 100644 index 00000000..01ec19b0 --- /dev/null +++ b/stdlib/.dagger/env/docker-compose/.gitignore @@ -0,0 +1,2 @@ +# dagger state +state/** diff --git a/stdlib/.dagger/env/docker-compose/values.yaml b/stdlib/.dagger/env/docker-compose/values.yaml new file mode 100644 index 00000000..e05bf4f3 --- /dev/null +++ b/stdlib/.dagger/env/docker-compose/values.yaml @@ -0,0 +1,34 @@ +plan: + module: ./docker/compose + package: ./tests +name: docker-compose +inputs: + TestSSH.host: + text: 143.198.64.230 + TestSSH.key: + secret: ENC[AES256_GCM,data:8heZn3UqcB0aV9XAn9uLx9gBcTqbmfNX7voBpYCNCGaX1nustSzKhbR29dxAoETIdfSFPetX2s4cCYbPTqFc6KTyRvfdmI8tXvb5+lin/CkdQJy7cR+RiynLEfbs32EPQilaph+kyGyGBAWAme49g8U2om/QObxCSes+Zn8ihfv7lBkLEj8hen2OC7YwIqjs9V8ozNCJ0zsk+NIk5LkryXdWTaYvgGHOmO/NuWz411L/pF1HieOV1L4Fe6E5hsUun0kVny8GxXQSbVCKle9A9TxD2bs+IBVNAUZVTsrjZYyTjYlNNgTaOqPASS5VDrOtR8csrGJ6GyGxtGrtRdhaoXYQA1zfA7uMfSMNlCwk3VB70P60s0U9tKr3HnRFX6rQdKcUwR2a1zbJ8UmHPy9apsM+tc+m/CAb8dkdu6UyiwvBK+kyPDyBVz4rwyhmtiB7cjw9vXYWX3hbZcE0e3RR4Upqw5NkIIlLfNH7T1fPDmVmIlXQk0wKIZJ//dwdJZyrraA+RRtG5b3PECSojIN3x57LnHdIXfp5drHK,iv:xqGFk9QgC6YwqFODSLRwShf+SMyY4PmtfWt5neHwfSY=,tag:vVZtGty5ehLvYzd8H0+Xsw==,type:str] + TestSSH.user: + text: root + repo: + dir: + path: ./docker/compose/tests/testdata +sops: + kms: [] + gcp_kms: [] + azure_kv: [] + hc_vault: [] + age: + - recipient: age1gxwmtwahzwdmrskhf90ppwlnze30lgpm056kuesrxzeuyclrwvpsupwtpk + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBMSmROdEtUblF3REhwS3hC + bU9ObTE0aWQzdGJzRlB5WjA0UG5nZFFJTEJjClljQWFYYWNQaFozZGRMcWxyT3p3 + Y0ZVUlZISUNlVkxVSVBqY0RRaGxPN3cKLS0tIGhsUTFCK2ljaWZFekVQMlRSRmtD + bEY3N3ZLTFpUNzZVWVBOK3VNRk9hWlUKd9db3j7FqFW4t7TxFyzudKDPTVqr66v2 + KqedhRYCjF4ZozN0H++xQPH24RBRnwc6Uq0Vm38UYv1ozDN2L/l5DA== + -----END AGE ENCRYPTED FILE----- + lastmodified: "2021-06-25T13:17:45Z" + mac: ENC[AES256_GCM,data:RclYzWUgBU06881KztfHdaeBtHLOiQZ5xNp0taaxS152rUxyXCXEAFlOu/yqE3RvEoorUp473wDwFUa9DudHidY88YNdfdk5AUuZdsOXW4bRMFPF4eiFugqZJNPepaW1YBDUMeH7XQBN1jyEkFOvzyk2KKQhoUshWyrU5QDR2kc=,iv:MjhUSjzVm6nV2PnSNi346GxkirmF3yAti3Jmb94gLGg=,tag:t4fHAYh60//PlkwUPQh2uA==,type:str] + pgp: [] + encrypted_suffix: secret + version: 3.7.1 diff --git a/stdlib/.dagger/env/docker-run-local/values.yaml b/stdlib/.dagger/env/docker-run-local/values.yaml index e46a9019..c54a04f3 100644 --- a/stdlib/.dagger/env/docker-run-local/values.yaml +++ b/stdlib/.dagger/env/docker-run-local/values.yaml @@ -1,5 +1,6 @@ plan: - module: .dagger/env/docker-run-local/plan + module: ./docker + package: ./tests/run-local name: docker-run-local sops: kms: [] @@ -16,8 +17,8 @@ sops: cnh2eHU5TzFjVkNvTzUyczFBL0pwTDQK60+wrLmTaD3Ws5ZAXdqBkMjaVP7Iz69k UrkqkMbaUlvvSKK7dB5MuTGEEN6A1viAGal9ZjDHlSobkNPuE24QEA== -----END AGE ENCRYPTED FILE----- - lastmodified: "2021-06-15T16:26:06Z" - mac: ENC[AES256_GCM,data:mW3780hxQmjmMD4BvcZbHzfckigDRBlq3DAlkpFqiPIchszGgOoXYC+TK9gkYUWfpDfunucwZ6UdYi2FpVo2p9MVPLEtAAIBgApmCz5OHtQMDIsz8Bt/RLiZpp+FQF77J9eeFELdCkxV904r9QNe1Qy7sfh5s2YDXkhxdQRb5X8=,iv:fnwektBV2bRAI7Zn9wAWoEZeTsbr1iu0wrapBacf5Ao=,tag:JK02UNTC8DzCUmK9A6JnfA==,type:str] + lastmodified: "2021-06-24T16:03:04Z" + mac: ENC[AES256_GCM,data:LJDMvMfHEoJ513yDitCDn8N87J+l+Rtp7tvbV+Px+9K1f/lQavNnlCJk8jVILrxtFmtK3vr6mPNLti8Q78GpjNTO5W/fW9MbXURxNMBfEnbgOP473vBgOHp4wZ/QofbJLvl19o8ldQVy5pdcsoQwYKpukDKpnrvw3zFS5flO87k=,iv:OgtV3N1MIMIfQP4HD08LtBBrefq6xK79dNzJutY2M4o=,tag:yTpgOE9rOmEoTY5l4C0v5g==,type:str] pgp: [] encrypted_suffix: secret version: 3.7.1 diff --git a/stdlib/.dagger/env/docker-run-ssh/values.yaml b/stdlib/.dagger/env/docker-run-ssh/values.yaml index 5a3a13d8..8f8cd13b 100644 --- a/stdlib/.dagger/env/docker-run-ssh/values.yaml +++ b/stdlib/.dagger/env/docker-run-ssh/values.yaml @@ -1,5 +1,6 @@ plan: - module: .dagger/env/docker-run-ssh/plan + module: ./docker + package: ./tests/run-ssh name: docker-run-ssh inputs: TestConfig.host: @@ -23,8 +24,8 @@ sops: cnh2eHU5TzFjVkNvTzUyczFBL0pwTDQK60+wrLmTaD3Ws5ZAXdqBkMjaVP7Iz69k UrkqkMbaUlvvSKK7dB5MuTGEEN6A1viAGal9ZjDHlSobkNPuE24QEA== -----END AGE ENCRYPTED FILE----- - lastmodified: "2021-06-15T16:26:22Z" - mac: ENC[AES256_GCM,data:ih3SIsrljcXC+2YGDKo02BG3uPoGlV0E80Z6yK1HGqxQJRICU9WJYLQqnt2Ughq8xNdfuMMuveiIUx2y4e/5a+S1tQi33N9OITCyzPHSVqcRVHj3r3pJXVORFfF++DTAmLamswA6918HHGXmsOqxbTC0rvtV7aIkdU6r6Hh4oCQ=,iv:e+yeE7je7kFjCERTztBxuNria+4nwOXU+qpnHyaR1lQ=,tag:0E+nnEPnnU1S2Ku9I1v1/w==,type:str] + lastmodified: "2021-06-24T16:03:21Z" + mac: ENC[AES256_GCM,data:sTXjqAY5c6jD8alHiGNwM/nHxNWFxD/mJ9mY5L8mAkA2BR/633/JShlMRDMUeUX+fYPDpwDdG5QEy4XT2EsqMdN2+N6SNNpHikg7T6iIbdY4XYY9Toil8Gv3ahXoCQoZyek7uXKUi9mXQiSpI2u4cLsHNDvL5IhWE7maR++403Q=,iv:SLqSa/k+e66kOs1IhKUxj2YQJRUQZYIXacqhTDSefvQ=,tag:fUBQ5vns81L/DFV18HfhEw==,type:str] pgp: [] encrypted_suffix: secret version: 3.7.1 diff --git a/stdlib/.dagger/env/git/values.yaml b/stdlib/.dagger/env/git/values.yaml index c209a8bd..0d7a5773 100644 --- a/stdlib/.dagger/env/git/values.yaml +++ b/stdlib/.dagger/env/git/values.yaml @@ -1,5 +1,6 @@ plan: - module: .dagger/env/git/plan + module: ./git + package: ./tests name: git sops: kms: [] @@ -16,8 +17,8 @@ sops: TmhJNisyamw3d244aGVJSEVFVUVLZGsKvd+nowA0CLXQbdvyI4J0lBjs9vdISWlo gGvR49uul3Z8raVWXFUzsyQ8xTvYNg0ovynFG2KdagSKr1DlhKMBEQ== -----END AGE ENCRYPTED FILE----- - lastmodified: "2021-06-18T16:23:23Z" - mac: ENC[AES256_GCM,data:AdTUEx0RIrJU6aZZNn9iIrl0eM2eParknCVIQL7k1arLRfYH4WyMf9lUa03+Qy83r4miNh4a9kFpNWyodbOR/j7OiLgAxWGXc08XAnIU51F2H7b55cSW9yNJj5kfos2e1pS356MoSaswg4fH8EYVUNgWC6mdBcXzC1m7uiqTS0E=,iv:mK9sjOCd7ePWR4xe5qNwmPuIyNR1nE3Ql65cF15SovI=,tag:DPUTnGTF+Ve+A7ShACNrnQ==,type:str] + lastmodified: "2021-06-24T16:14:47Z" + mac: ENC[AES256_GCM,data:3UHY8Jg+qnbaqTmqzdbmV08zXIFQ8141KMT4Zl3ud5d7PABqQnVAPaL3b7/UvnNo6+ssjnlMVUbKG6duZpqw3scWyrGfUgWfGM6VASoy+LCyquuPuOVzImBeZw19FZsUVzqr79NnzL353KRCz+fM68ZGryZpsyXsl+t6wgd1gpM=,iv:EosxY4VFRGLeIDJ9dNehFK2yey+dKnggbWwRwuORWtI=,tag:R5cvDSq/9GkhhF1fz3e5aQ==,type:str] pgp: [] encrypted_suffix: secret version: 3.7.1 diff --git a/stdlib/.dagger/env/go/values.yaml b/stdlib/.dagger/env/go/values.yaml index 8312f374..5ea05507 100644 --- a/stdlib/.dagger/env/go/values.yaml +++ b/stdlib/.dagger/env/go/values.yaml @@ -1,10 +1,11 @@ plan: - module: .dagger/env/go/plan + module: ./go + package: ./tests name: go inputs: TestData: dir: - path: ./go/testdata + path: ./go/tests/testdata sops: kms: [] gcp_kms: [] @@ -20,8 +21,8 @@ sops: R0o3dlptazJPTmp3OFo5RDcxOVg1VVkK1lLu/wrPvgzXa8Ym3qdvcuYCj8csbtOG T4HjRvA0EEF8jmFEuqS8Y/N0vQiezoZR7JU9PbjOoD1B5bLHtJcryQ== -----END AGE ENCRYPTED FILE----- - lastmodified: "2021-06-17T13:10:32Z" - mac: ENC[AES256_GCM,data:oD5rZ0k3KHxQ21eeDP0CQRdSYWBNfrgynNB3xrT3ntSTCsLkRuFH1G5NBnV3Hpvd5B5l5qQuuUDlQLY4nB8mbJJKr/TwYIRMELDDMqpitTfkddjm+UeUrRyTP/YStVnR+g6nv8NcDdHcg4eF2lXl6Q7JKNlsMAGndgb5920QNcY=,iv:vx84/Tp727FpbpXcp2Dm9MXz1OPnnVIICgcofjPjiHI=,tag:8+lCqBKc535mYMmVV2k1wQ==,type:str] + lastmodified: "2021-06-24T16:19:27Z" + mac: ENC[AES256_GCM,data:3dJTQZFlzj4sJkIB99zHMgH7MsTcHiGKwT5GykEzjzq4OH8KOkKyFx0uVrvw4ePYhHMjAcTKcJFWRD+ebrRusKF5yZ19Si7IleCSh4y/IzRE0fWfzCDCYSN2MVwreE9Q10UeL/vBw51cK/k7kCF2DNGkIr5et5wO9R3eStuHfDE=,iv:QJlR6fIRD0AfWneMhCY6HpXpVSFt6431dJuWzXplfB4=,tag:h43ENEs/oVkd/ZtSfgmlmg==,type:str] pgp: [] encrypted_suffix: secret version: 3.7.1 diff --git a/stdlib/.dagger/env/google-gcr/values.yaml b/stdlib/.dagger/env/google-gcr/values.yaml index c724534b..35d27ee0 100644 --- a/stdlib/.dagger/env/google-gcr/values.yaml +++ b/stdlib/.dagger/env/google-gcr/values.yaml @@ -1,5 +1,6 @@ plan: - module: .dagger/env/google-gcr/plan + module: ./gcp/gcr/ + package: ./tests name: google-gcr inputs: TestConfig.gcpConfig.project: @@ -23,8 +24,8 @@ sops: ZXd6Qmd1YUtxMnVTVkYybWgrV3pVK2MKowMeOZU3j3BxERT0DwhQYCGUDBK6gCdo WByubiBATdsb7h7ytCC4HutWppynK4MpU+Ya9NP83AZuXo+Wa2u6aQ== -----END AGE ENCRYPTED FILE----- - lastmodified: "2021-06-15T16:26:26Z" - mac: ENC[AES256_GCM,data:/ZsuT9I5KMWGWc6Kg8jDxiHGhaLd0aGSRv2U4LKLr0LIYQrgmkTRrWSWmaU0QDKSrd+ovVDvg4KhGtGeKHENWp64zWM0I+icdYMByL7qGj8tSPmll4u7SjOIOEzpWHjLVAC+JPD1fpBo4WIwlfDjW1yjFulmxYb4utDLsDuaEH8=,iv:xWrFWD5fkmKA0dbIIiRNOp8mGRKtDX+1BInXJuKjRDE=,tag:Jqeujum1JS1ONt3kV7bvRA==,type:str] + lastmodified: "2021-06-24T16:22:49Z" + mac: ENC[AES256_GCM,data:8VyOUX7cwS6VCrLJi1luMag+vgh9WA0nxi3WqNMpI+w//SVHVtYaZ0wnzof+yictU0+PECwGFWS0ircpmLvLDUGENv2T3fCNgQj4x3TnYRdgHpd1na2XSzc/J1+uWP1FyYBR/ipvY6LnDIY4u7IWpjGNcSs+Iq+gm3S4Hc2e/Eo=,iv:UaYq9P0Y7MvW3DucgpBgc3n/n7vo+itaMhz1umIfOYI=,tag:j1suX3zEBSdRzsDexXNBVA==,type:str] pgp: [] encrypted_suffix: secret version: 3.7.1 diff --git a/stdlib/.dagger/env/google-gcs/.gitignore b/stdlib/.dagger/env/google-gcs/.gitignore new file mode 100644 index 00000000..01ec19b0 --- /dev/null +++ b/stdlib/.dagger/env/google-gcs/.gitignore @@ -0,0 +1,2 @@ +# dagger state +state/** diff --git a/stdlib/.dagger/env/google-gcs/values.yaml b/stdlib/.dagger/env/google-gcs/values.yaml new file mode 100644 index 00000000..298a1223 --- /dev/null +++ b/stdlib/.dagger/env/google-gcs/values.yaml @@ -0,0 +1,36 @@ +plan: + module: ./gcp/gcs/ + package: ./tests +name: google-gcs +inputs: + TestConfig.bucket: + text: dagger-ci + TestConfig.gcpConfig.project: + text: dagger-ci + TestConfig.gcpConfig.region: + text: us-west2-a + TestConfig.gcpConfig.serviceKey: + secret: ENC[AES256_GCM,data:UEKTXvyrBgHKOYE9vSGoHua9wWALjghxWu+ui9K3MAS+1mnVlc1qjTbwv/1/hIIkRNlyhY6WlN0k3x2imusFFInzrNZ5G4FJHGiP/zaazd7shUS8LZsh1cL0I1jnsaDJaz4Zw0yVu+FT1z2/+9l81U9MrtvbLNKFSqZJsrymZl5lUCxiRsUEBiC0/rOoOlQ88kfnxUdBXnG7ABciqPUK7cYaMo5RbB1a9YfacB8S2sosClxK727jUgD20I12ru+y5Y/hg00BhBl9bIg35VTI8PFeZvRqQowqaJO+i1BjQbBYef8s9faYdZGEP0hUrvUpPek4Z0ZBDRbxRfRFAiXBbWbvCJErGlsmcNGqllixgDbcYQNKBTjZEKke4PGHtahmPXOIOO9/fxnUCoci//azJ5fUP0Kdiw06DQYQnngwRSA/nOqTBiuWcfiTLY00iQxoh+8Mt5/CMTXhRz8PpRpvXtKLe4ogaVbEBMOXe8+nMtwt0H6kV+YmHgA+vVHw0WYtBF6gmKnXuGWT/dz94SHGe9oMiK7H7KtfRCyN1SBAx3H9R3qitt9114TlWRBvfrVtDsb/E0MQdnbXZQirJ/2ev78DTc5bdRTFus2vvHZB2RP+wr7sB8A+jcWS1RBv0NJOZoPlHqKIfB93NBhI8wU+lqEbTn2Zm0LAvGVypws3ci+0GJFReIok9yGc/WucFBDMWi8tDOwUdbreX7EpdGLSn9Rwq0Oeuo5Udy5Qo4xFAC/v2yCzqb7MrZzX1S+OHyNObUTGuEyTOL8t91KYBebHtLK0Ud9qQoYuO5IvYCGeKIHr5FDFCYKDJAlW8Y9Iw27LsU45rqeHTjUi1BqOLfXZbns79w8WYiz5bqc3eMXmYOgCKtU5BwLo9LV7WR+FW8cCi9gSJHnRbc8uT9V1NWaGeoKuaPXpBWLH/GTKXEKuy1HXz+yPgQsYYN2yrGNgmgXpKbxgp92h6LRA/PRjxrjkAV8kVdivxG3GUFVfq4ZtGlLdRrcYCkDIZVpwPrNp8Qg5NLn5xhWj1hsqqOOJdeDHHLkS48A9pLAhPubRWH0s1IixLstnJ95DGIZDE0QpEh7STctqvS7SVhclroKI5xzT7w3C78fxTKC//JkdrV0/rQ2CQ1u+emaCUt3X1WwYofudoMjp5iESscDvw6PnqzubUT51FwGtAf2hkT07VQWZ2CcNP4dvYgDSsc26Y0hwWdr+ppCy1xbmpENU5moUPELtF9w2da1zG5N32Fcxr9VOqOGwa4pqkasIQPCRdqsEa/34g95L7Z1BAXpMxCLTbW5nxD3wQBsrsTjO0rmBh4n9BdKjqj5GrXOTceAaJ+L3o07aVIzICJ5HGo7GQXjaQOABzysbGr7bdBIQyp//ruqXNLVSaylIunZJY4/HFdqetZj6jfb4rE+/GkjFLw23Ym8RIDYJQsTAR8OdwZNtVPrILdve1ohlyBW/nS+gy5dZ3qHnE9ZxbgN6FpRYr9G4acK3yCyMeuBdiB6Tqz0o6xz/c2WLWpWcw/HivVce53MfbqMhj0K/jjpl+fsJT/+ZkaPviDrOtKR/WPz/ewNwQ7pZgCubtlzCmPw8pBKjP+uI9tvwydgnV8I/LdEvS0IrP9m22kPZiw/m7mPQPkDA7IzQSIlrmWMCt/iJ0rvVEtkyi1pPyzVVby4OyzvyhexVcFu2X1x5jOqfUL3eEjO+IhMJufVCOVlUKNHPci0r4KQZ07n1wPCjUoCN4MMl9D8yaP0l8SQmSmp9/DFVZ1Cd5m+O0cmaQfZX8dYV52uxkPnkRNn9SnKCz5Nf8tBG8p+kvznEYw6d4UKQLocFdzeBU6FBa4zQSf+oXHghds9YGJoWNAGzD9ucgVNyu4hU2rq7UDnAwT/pm8FTbw/OM2uCyPr80J3CpgKPdA0+jEvBNxlezsZeLyTntoZLIstgllETxC9QjqfCVtnQYBYT8oFCXZPadyBZPPVrXvQORCpRXJCQ9iyoiKTQCCOGqGyIgC+23Q0ebmZPr7e4I5JbBZWeh6ek2RRWOZMI0lkLeE72KO+9h8HPxmgMhPtDes/l6DmWjAPb6IwZSM9SseTYF447HL5rQKkv4x7W4Cu1pACSc/2qqdUwnC6jydk8EY2zPa9kdguwdSiDr+KwASZex2MKMJa+peXhTDLqB7jxiO7snU4r0nk7E0B3IBqWM89PVskyNTJXqTkAXyzHWag1S8URPhk9Q9UYpyVCWRzs4nfXAX2WgCJl9iw8ZXrIJZ3fGs3vXQMYI/kGJ7rGIDWhcQEDJGKJYrBCh6zNsbSzBagd5AQ6DNIUEvTUcPvxZP6sy+uiiMMqErDgbi2IT3G6E5sEL0sO7GtrVWoxDQWXX80vtf146fnNNp4uS2wGta7b4kguAt39olceX7nUrYgzLm1aXcr0ObbRjcPdeSlNGLTJGlZRNtvTlFdT1RgTQBfRdG3d1JCraCGsAWxBC+Bwa/zAcdIwUNnMfgdZ5eOAyiBTmoGAAOkUr7avSVvP5Xyrk9JlNzeArrjZUFMYOcXBfkMquqD1NoPHUZ12u9jCoj109zJquxcJ1zGT5TylJYSTc9xz46TfLrz5KvsMhfetBx0ocY8lXjbs3pzB6ZswDGzF4j0eiWBfu9UZoiQVtt1eIfAPoZO9u/n2Wbpx+ov+mJFf0dZklKDED5CUbmj8/izOdE9KbiPDFr1nZZQbO+YwJYhjxxqxzwC41CvH5XQTCCadeWgb5cHEwwunFRVCYeEFvTlP6nR9pS19UZoQvPNk5NEnZVKxWVD1lK18frvX8MxIpB2xaSbUkvGi3tueinLa7OYVfjirBJ1GYbuADa4H0KOxi4MP59ah6TOmsZstA6plFbtRRtk4Iofzu1mAyUN52SZzwCvH5/IxOh6vQxg7EcMfB8O5+S87PeE3vd1ch+UVDwQ3fvNmjd7/77XdKZiR7bwiDxodxABpG4iYrxcfkGPOTCKUlisgFNNmSmwG7FJMYWkz3RcEHib/biklnEKbm/9G5000cwZXXglZb8QjleSklkSEZa4DYec1SNvD/KwRbk5lYr03TDl7DrZo3WjKWvWGMUs3,iv:tPbOGayR7NiXcuHWjX0pX/nSitOxmsr4qqrc6irlIJI=,tag:apejA4UTYTuwT4CUSeoaRQ==,type:str] + TestDirectory: + dir: + path: ./gcp/gcs/tests/testdata +sops: + kms: [] + gcp_kms: [] + azure_kv: [] + hc_vault: [] + age: + - recipient: age1gxwmtwahzwdmrskhf90ppwlnze30lgpm056kuesrxzeuyclrwvpsupwtpk + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBCRThSTEE1Rm5HU2Y2NkJZ + SEd2blAyeEVnMHBqRGxXMEQ3TGFzWTBwd1EwCnA0OFVmTCsxSmpNV29adGt2ZHFH + WE9vN1ZoNENFV2t1TGVuZkdwVndNbVUKLS0tIGpHZEptYWxEZVNjcXF4NkoyWHRv + ZXd6Qmd1YUtxMnVTVkYybWgrV3pVK2MKowMeOZU3j3BxERT0DwhQYCGUDBK6gCdo + WByubiBATdsb7h7ytCC4HutWppynK4MpU+Ya9NP83AZuXo+Wa2u6aQ== + -----END AGE ENCRYPTED FILE----- + lastmodified: "2021-06-30T10:44:08Z" + mac: ENC[AES256_GCM,data:bVjVtONv7ILxZ3UkYy/l3MnuJB8g4EG++fBfeL/CQPHyembwBURC3nxfB0IdqQmPsa0/ahycNawIvB/owy+Sw6yyaDWGtd/8Jn0CILLZ4Nyx9lNN95J4Ad0FbUKr24Fu17I339rB1GrEjAaTs1qcle53sp4Wq9Blg26Vkut9jmc=,iv:TdFDptBZrScOfywWsIhoLijSFQL18DF94bKMh5DfW5s=,tag:wVoa1K/Nyx05nu+Op0Viuw==,type:str] + pgp: [] + encrypted_suffix: secret + version: 3.7.1 diff --git a/stdlib/.dagger/env/google-gke/values.yaml b/stdlib/.dagger/env/google-gke/values.yaml index bb035979..e7c63f2a 100644 --- a/stdlib/.dagger/env/google-gke/values.yaml +++ b/stdlib/.dagger/env/google-gke/values.yaml @@ -1,5 +1,6 @@ plan: - module: .dagger/env/google-gke/plan + module: ./gcp/gke + package: ./tests name: google-gke inputs: TestConfig.gcpConfig.project: @@ -23,8 +24,8 @@ sops: ZXd6Qmd1YUtxMnVTVkYybWgrV3pVK2MKowMeOZU3j3BxERT0DwhQYCGUDBK6gCdo WByubiBATdsb7h7ytCC4HutWppynK4MpU+Ya9NP83AZuXo+Wa2u6aQ== -----END AGE ENCRYPTED FILE----- - lastmodified: "2021-06-15T16:26:28Z" - mac: ENC[AES256_GCM,data:mCi/vNSrtuLP+hBssCP6D5DI9wFSajN7EeFxfKnbqMGRgHRGjbbA0ty1RtJCwlTLYHmLWRxNclkLtCD+tJXQ84YnE/jocPjUK2Z3lR/La/7imy32QM1hfpg14pT4A7lkIizwKfcV+HXgRTE8rQ8eZM+KnuQJXwa1Qds2G33sTpM=,iv:xqDuKP7vBHug+o1lffkJ5YNzh/YPjCGmHCb0U7lgijo=,tag:6ln/mKsYB4Zu6l3YtZ59RA==,type:str] + lastmodified: "2021-06-24T16:23:14Z" + mac: ENC[AES256_GCM,data:xUwP0iRtKFl159PD5u8byQbxMyPHYuQvGQLuplUJMZs/OMSd+YWiWoJRhup4j9/sZbq4Ob6uHr37HMmwbNgieiGX6qabS90Je/1UiufCOWwfVswnT+iUMHyudnS0r+Gh81vwl2eP3xLr6Odm2FbFh8kwF3Yw+NNi3wgei+yZIjU=,iv:tNI8ti2zAem+dcWVdciPLqdpJ6SDIK3CoeQUchlWE58=,tag:MgTShPwKT565cJV2BJLi2g==,type:str] pgp: [] encrypted_suffix: secret version: 3.7.1 diff --git a/stdlib/.dagger/env/java-maven/.gitignore b/stdlib/.dagger/env/java-maven/.gitignore new file mode 100644 index 00000000..01ec19b0 --- /dev/null +++ b/stdlib/.dagger/env/java-maven/.gitignore @@ -0,0 +1,2 @@ +# dagger state +state/** diff --git a/stdlib/.dagger/env/java-maven/values.yaml b/stdlib/.dagger/env/java-maven/values.yaml new file mode 100644 index 00000000..d2155462 --- /dev/null +++ b/stdlib/.dagger/env/java-maven/values.yaml @@ -0,0 +1,28 @@ +plan: + module: ./java/maven + package: ./tests +name: java-maven +inputs: + TestData: + dir: + path: ./java/maven/tests/testdata +sops: + kms: [] + gcp_kms: [] + azure_kv: [] + hc_vault: [] + age: + - recipient: age1gxwmtwahzwdmrskhf90ppwlnze30lgpm056kuesrxzeuyclrwvpsupwtpk + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB3VURHb25rcVdWRmMyWmVk + c0t4MEZscDdMWEdqMWNPRm0zRG91cnh4cnlvCllCYy9nS2F0ejZFQXBLZzgxU29n + V0tEcEJkQUFzdHczV3MrQjFpUHMzT1kKLS0tIFJvY2QvUjJlRE9hTTJWa1NkK2l4 + UjFhYnZNdUxBNEtzWkVvMUoweUFnREEKbs/IGlNmDk8e3ibJSoIcE95txghXwsso + DL281EMf0V+ARsJY2CiehZsZB+xX7y+YfyQyoWx0xMN7bCgPu2snGg== + -----END AGE ENCRYPTED FILE----- + lastmodified: "2021-06-29T16:06:47Z" + mac: ENC[AES256_GCM,data:DudrYOLr/ymf10B4UzjRfe1+n/hw7KCSSIbzAGcc3kmN/KplkCPYi3n5HCX1XkMOB1mQp9QD+UOQGL5CYPtqnZZKu62JNfbeSqU26BKU97aqL0F2+lPqaYsjSeCAbgUs9O/30A7QErlJiXuzTYC1WcTjpTr0RTeNoHmWKsqZ5ug=,iv:7e1XmOfxyKIOguzDxqQ75nFnV3GZ1vpvz5S5P1O+4Xo=,tag:f6Vb8e721uLyvLfCwE/JEg==,type:str] + pgp: [] + encrypted_suffix: secret + version: 3.7.1 diff --git a/stdlib/.dagger/env/js-yarn/values.yaml b/stdlib/.dagger/env/js-yarn/values.yaml index 485f3c4b..48bbb293 100644 --- a/stdlib/.dagger/env/js-yarn/values.yaml +++ b/stdlib/.dagger/env/js-yarn/values.yaml @@ -1,10 +1,11 @@ plan: - module: .dagger/env/js-yarn/plan + module: ./js/yarn + package: ./tests name: js-yarn inputs: TestData: dir: - path: ./js/yarn/testdata + path: ./js/yarn/tests/testdata sops: kms: [] gcp_kms: [] @@ -20,8 +21,8 @@ sops: S2JsNXRkbWVERHM0WWk0bXBJSXJIK1kK9R3gMDcbeKRRlt0HHM+w2kcs+sGfASmE 0YhxbFF2qQPFwHHR7aPmM+L1ML8cXOrxOOyWmmWhXNgtURCJ9/SO3A== -----END AGE ENCRYPTED FILE----- - lastmodified: "2021-06-15T16:26:00Z" - mac: ENC[AES256_GCM,data:EmSUjMv9vC6/XGTHtVBZSOQP/vrb6rTvM3xJLf0rjZadOYviDQKiBygvQjdrnxR7EqDHntkm8ye1ZWsCEiNF/e/H4lEbZL8hVdeqiWqdpDVkzGw5wQRfKuATy7K48o3lPZAWd6vOzRVRpwCx9YVk9nt8v7OSB1mPYqAtRMvoMg8=,iv:qacGNks0dHawJPTtgrbrJkuyITxiiNyACKgLejPS8ZM=,tag:jv7+/6wmJwLGufLS4ERlbg==,type:str] + lastmodified: "2021-06-24T16:32:39Z" + mac: ENC[AES256_GCM,data:jAgt/buOF8cUAT0bQJ3icGI8qR8cOg0ZQqZFuut1VhggLGZTr92Z7XZcChfBdpfPIE98fVuoemTdddEBWKp9g/LjXHyoK4kJxtgTLiH0CGkynVIE01bQUTCQBwaE3KHoRTYuu8xWFw5RpqEgCvlpZnvCGwwMG08NR+hSJJ5j7oY=,iv:+fkJT11KX3xD8OL7NXj+Rs1nuXK8J1AnfF6ZWGGtTTY=,tag:o9xcgR/nLt7hxvMeH1saoQ==,type:str] pgp: [] encrypted_suffix: secret version: 3.7.1 diff --git a/stdlib/.dagger/env/kubernetes-deployment/values.yaml b/stdlib/.dagger/env/kubernetes-deployment/values.yaml index 59be15cd..1acc9f62 100644 --- a/stdlib/.dagger/env/kubernetes-deployment/values.yaml +++ b/stdlib/.dagger/env/kubernetes-deployment/values.yaml @@ -1,6 +1,29 @@ plan: - module: .dagger/env/kubernetes-deployment/plan + module: ./kubernetes + package: ./tests name: kubernetes-deployment +inputs: + TestKubeconfig: + text: | + apiVersion: v1 + clusters: + - cluster: + certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUM1ekNDQWMrZ0F3SUJBZ0lCQURBTkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0VRWURWUVFERXdwcmRXSmwKY201bGRHVnpNQjRYRFRJeE1EUXdNakUwTlRJME5Wb1hEVE14TURNek1URTBOVEkwTlZvd0ZURVRNQkVHQTFVRQpBeE1LYTNWaVpYSnVaWFJsY3pDQ0FTSXdEUVlKS29aSWh2Y05BUUVCQlFBRGdnRVBBRENDQVFvQ2dnRUJBTkJTCmp4OHZ4YlovRTVDUWw5akdKcWt6NGkxK0xrcjJSQnlsblRvRTV2dnd0VEZMamJudzR6T3RoQlBaV1VGcEZyMG8KNytBNUxaamRnMkRFendRbnpEaUxTc2RuV1plMEg5U3hLNjVMQ0VNdkR5UlFkenc4Wmt4eXNzQ3J3V2tqd3Y0QwpsbjhzYXVvQ0hrd3ZxelhtZjI2bHR1MC9YYUhrNzdwSlZiSTR0NFNpeUNTMjZsNVhyaGhOUlpkSG5La0FOVnQyCitPcWVzUGhQNWJTcDdSdkhLSDJFWXlISkp4azRYdzJhSUl0T1BYSThGcm1LM0NaZEJaN0VVTzRYTE5aa1M1M2UKZWpNRmlXcHNCVlRsR1lhSmYxMXZ6dmlmRE1uemNvV2ZKVGhaZDBMd0dKRVFVeDA0YXpCZ1VrTWJwVGpBL1ErVwoxamx0ZTZzNERuaE5MODFrYUxNQ0F3RUFBYU5DTUVBd0RnWURWUjBQQVFIL0JBUURBZ0trTUE4R0ExVWRFd0VCCi93UUZNQU1CQWY4d0hRWURWUjBPQkJZRUZIT0d3YjJRcG1RVW0wcWhaTlhDK0d3blBDdm9NQTBHQ1NxR1NJYjMKRFFFQkN3VUFBNElCQVFDSjdkQU94ZkJvSlE5OWgyc0RJWVdKT0NXWU9mK0h1MWhMbHpPMHBsODhEUG9WNGE1dwo0WEZVK1pjcW9aU2hVVjZ2RlFGK2s3Q29ldC8zUUppQ2VOZjhMS2pITlh2OUtKcGFoaDhQbElVb3RHMjF3a1NaCmN6MDFRTms1T2pEdmhXQ1BnckNDUEpTQlV6cXQ4cHZTWkhPL3pZckJReUhYM1VSQmhvUDdUeDg5SnBqSEYrTmEKNlBhYzR4SndKWUxPYVJJcWZwWlE4NUdXanBuWXE0c2p2cHdzbXJJZS8vcmFUTHdaSUVQdG5URlFtNFJseW9CeApDbG5mT1c5MjRFbm5nMVBDZUFNK2JyZ1psODB0NW5wK1hrTkVpaisvbFY1NGZFUjhMbTROWkpabGM4eVlOZDZqCnM2ZzgzRmlWN0tvcGZKZk1VT3hSY0hEempTekp1bGFta2pybQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg== + server: https://127.0.0.1:35377 + name: kind-kind + contexts: + - context: + cluster: kind-kind + user: kind-kind + name: kind-kind + current-context: kind-kind + kind: Config + preferences: {} + users: + - name: kind-kind + user: + client-certificate-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURFekNDQWZ1Z0F3SUJBZ0lJU1o0SjMxa0Rsdnd3RFFZSktvWklodmNOQVFFTEJRQXdGVEVUTUJFR0ExVUUKQXhNS2EzVmlaWEp1WlhSbGN6QWVGdzB5TVRBME1ESXhORFV5TkRWYUZ3MHlNakEwTURJeE5EVXlORFphTURReApGekFWQmdOVkJBb1REbk41YzNSbGJUcHRZWE4wWlhKek1Sa3dGd1lEVlFRREV4QnJkV0psY201bGRHVnpMV0ZrCmJXbHVNSUlCSWpBTkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQXo0aGtSb1VSYlZkbEVaUDcKQTdFVGxOOG9iZzRybmY4RkJDeVlJd1dRbDR5d0lMZUV6MWVMajloS1c5Vkx1OW8yemlGQm5GRGhSQXFpc0JlTQpPanlBNzJkZzJibmZKM0kwVERpT05TcWRrS2RDRnU1V2I0TDM0U0NDcVRzeFdUL0JUNjJsZkVFUzIxN3UxV2pSClBWNlcrVjhzSlhwQVJESUxoUmpGS0pNVjE3a2U0RjVUeDE4WDBuOHhXaGhFZFBrR0FzRDdaaDQ3ZFoxbWRQMjAKbWV1M1grREtqUUpydzlVb0hCV3UzZEoyWWtNNmpUR3B1TnlmaVVrYUcrS1lmUThuVFdiM3VvVHJKYXFlL015aApyY3ducGZVNUFzVUJteUJjN1JrZlZsTEpIWDltbU5wYWxkeUpTaFFnRndSZTQ5NFVuVGpjU3lHVzhUUXhMSmVOCkx1NFdBd0lEQVFBQm8wZ3dSakFPQmdOVkhROEJBZjhFQkFNQ0JhQXdFd1lEVlIwbEJBd3dDZ1lJS3dZQkJRVUgKQXdJd0h3WURWUjBqQkJnd0ZvQVVjNGJCdlpDbVpCU2JTcUZrMWNMNGJDYzhLK2d3RFFZSktvWklodmNOQVFFTApCUUFEZ2dFQkFERnFWMUdvby83NVN5ekVMNlNMeVVhbXJicUJGNFNxRVFYdnBzRjdoYnJ2QWhHMEdIc21DR0tFCk11bFhxeXdiYVpmTGo4ZHFRdVVLTlExN1U5ZWIva0ZXcXRrVlNyZG03eGc0ZythOWFHT0J4RE9vUVZTTHJPeUIKb0ErSUF0d0REZlRUTWhHVksxZXVMWnhXdU1qUkJwMDB5ZUFlVEsyYjlBNUV1dFViWC94MGtWZGhlckx1MitmZAo2Um5VSnBjaEpMR3hjWDZNelVzR0RITC9RcCszaTJ2SnAvQm54V3huNjV0Sm01SXZ3UnQybEZFZ05SUHFiR1NxCit6RVpnZzFTVmlvRUU3U2VsdVV5R2NueHMvQyttdCt3QVZGNzErdGxMN1F5NmFGWEppRXlOOVE2Rjhtd1hDNGkKNmFyb1FFM2JjVkZOOTFKczNFN1NOcVJNci8rWjRFQT0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo= + client-key-data: LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlFcEFJQkFBS0NBUUVBejRoa1JvVVJiVmRsRVpQN0E3RVRsTjhvYmc0cm5mOEZCQ3lZSXdXUWw0eXdJTGVFCnoxZUxqOWhLVzlWTHU5bzJ6aUZCbkZEaFJBcWlzQmVNT2p5QTcyZGcyYm5mSjNJMFREaU9OU3Fka0tkQ0Z1NVcKYjRMMzRTQ0NxVHN4V1QvQlQ2MmxmRUVTMjE3dTFXalJQVjZXK1Y4c0pYcEFSRElMaFJqRktKTVYxN2tlNEY1VAp4MThYMG44eFdoaEVkUGtHQXNEN1poNDdkWjFtZFAyMG1ldTNYK0RLalFKcnc5VW9IQld1M2RKMllrTTZqVEdwCnVOeWZpVWthRytLWWZROG5UV2IzdW9UckphcWUvTXlocmN3bnBmVTVBc1VCbXlCYzdSa2ZWbExKSFg5bW1OcGEKbGR5SlNoUWdGd1JlNDk0VW5UamNTeUdXOFRReExKZU5MdTRXQXdJREFRQUJBb0lCQUVlV3BmaUppSVJ1UkVmMwpBdnk0QmFneC9wRlFSQTJCWGVxZHMzRkpSeUp2L29XYXFLNlpaV1FlV1RBcWVMQjVTclI2Vmxha3M4QXo1d0RWCmJxTGNJaUh6U0Q1eTFwNlZ6NktIVTg3VlAzc1pwenVmeGFNN3kyUVdRZHc4dGY0eWR1MlVXZVJ0MGlKb01memQKNW1mRURGSkRXVWdvVHFqM2xtKzRKcktqWWtLQ1V3QnAzSi9NOEdEWG5xck5jYVVjc2lJSFExZnVJRllENXQ5MQpEWDVPaHAvQUkvNUhJc292YVRrS0g1LzlIblpsRllScWhRYUhRS3BMQnA1TkxyS2UybXpOSS9CUnlkNUkxdm1DCkFkeDA1MEtnSXhNRWpDaXp5MnFWSTd3eGNPR1B3Smx2YkU5b2pDakN3dk1tZWlXTkxLNUpFdXdaZitCWVFFbUIKbXA3dmU2a0NnWUVBOHBxMlkybWtLUXA4UXgzN1RPUEYwZGlWM2pDZ0FhSXoyRDJwSkIyWDEzYlRHK01UT3dONwpURUd5M055TEc3R2RvVmVNNitHMFJUSTR6VFZkWmU2T3k3U1NQQXdxS0IrZGJINEE0NU9MT29rUGxUWDRDTmdQCjB1eXFTSCtLWEQ1dkxkbEFhalpqSzkzK3gvbFFaRWhKM3VqYlFZaStkQVJtOGlwam9XWkR4b2NDZ1lFQTJ2M3UKaXc0R3FrWW1FQjlmTEVqN3hUZE11Q1FHdUxLUEZaUUtSNjRZbUR6MGdESnVkWk1XUmVLZFZibEFDSzBrUHdyegpyOTIrdUpzSWkyUzlNYjVabmo0QnR2Y1JqTzJzcUdoTG9YNDVVZHNadTduSDM3dTNSVzVaRi90VnBTYTJ5SkpPCkxHY3FKY3VyWnB5Vk1uZmt3L3dHdHJSdWNCODV5a1hqSEsrUEY2VUNnWUVBMEtpdWZEeU5POXRQMnk0N1NQdVMKMWhUUmVhUWF5cXptcUhNSU9nN1YzVFRQQitvN1RRT0dsYVRnSU1QelJXTnpyeVF0Q1dnNzgxUHB0TjNVTWVxSAptTDc3RTNobS9kR0xSWmZ1VGM1RjdwZVo5bnpQazFPNThIRXJXR1dSN0JxcTV5VTNHT01rVXNPQjhoOEZ2T3JMCjFsUXkyRit6WnZldVQxU1VFbXB4bXBzQ2dZQlBSVG9URmRtdHkwUzk4MDAxTDVvTGNwQVAyK0tlK3V1MmFPY3IKdVVabjNUQzRNd2t2QURaQXg5NGlDTE80TUV4OWtZNVNhOWM4NWNtN0E1VkVxMTJ2WFV5cm1WVytDTTdHQ3pMTgpXMjZPUmR4VHl0VWlGTVlybU4waFJEWmxXTlV6VjFwNjBrRThlelFwS2FjTUpNQW5mVlJFMEoxbGNyZ3Rrd3k1CjlvYTZqUUtCZ1FESGNuNnl5dzhzSThUTlUvazZDMGhyRkhYeHpLc0ZkMWV5Misxa01ZMm5pR0o3UHRGaHBMZWwKaTIzU3NPSFFyM29Da1l0bHpIL2pzR21OS01IOWxyOFdjTkgvTE04eEJ0N2lhZDFESTlrN0RYbjFscjFIbW1wUApsRlhyQjZ3VDV1UDZVRmhxNHY5NWhkQW5CL3YvOWFPdTIyNlBKYXVUV2RtaGxaNElFa3N1M1E9PQotLS0tLUVORCBSU0EgUFJJVkFURSBLRVktLS0tLQo= sops: kms: [] gcp_kms: [] @@ -16,8 +39,8 @@ sops: SVVkOUtuWTJneE45em5iQ3JvbnIwWlkKgdJC5IzvVDxbWSfU41Xg/UGPxuVBSOGY eqenr07uWppNaHuLuo9A+znQa2RQ0L2clcB2d+ka+6z5tQyHOfx1nA== -----END AGE ENCRYPTED FILE----- - lastmodified: "2021-06-18T15:41:02Z" - mac: ENC[AES256_GCM,data:R3DuHLEyfehKe1nCWHdKB9jyOs5TXI+r2BmQDMiwI8v0xfZdOZWfwGw3NAFGDZHbaLNTajQkzviDsMhaXg5bxvmK7P8PiJOOmnm/LnDRfnJirGRGpWA7bmsHH/QZL1lb75+cwUrwRZflkKoPy2bQyoC5Rze6/oNhPIUTCwQWaMo=,iv:73ZjXAcazCND3JhC94TjUOlcMbwfTz8YDFP1BPo8yUw=,tag:wUVcfyjtf4KzpU0jDrxleQ==,type:str] + lastmodified: "2021-06-24T18:18:53Z" + mac: ENC[AES256_GCM,data:S2uG/YGGfCxJ1ClEouwEhFa1Huzk//NFQoZM4SCDp0uK73FVxt1+Hi0rfKl7DrGPqw+HJghlamyAwPGZSi9lFBWO6ASti2kfc2FmhQ9pgY+VOiOE7jd7ajw9wWUILpN19GBiwIpO8JN/nqRX9QYLdigUgKa6IVrBwVwjRRKvmmM=,iv:SpSe+nwvtSHogwwNaMbikDzMKDHbla0BqnsZn42nMTQ=,tag:vxn0bHdbMwfZVLx9cSfB4Q==,type:str] pgp: [] encrypted_suffix: secret version: 3.7.1 diff --git a/stdlib/.dagger/env/kubernetes-helm/values.yaml b/stdlib/.dagger/env/kubernetes-helm/values.yaml index 3f79c0d5..1f8126bc 100644 --- a/stdlib/.dagger/env/kubernetes-helm/values.yaml +++ b/stdlib/.dagger/env/kubernetes-helm/values.yaml @@ -1,10 +1,32 @@ plan: - module: .dagger/env/kubernetes-helm/plan + module: ./kubernetes/helm + package: ./tests name: kubernetes-helm inputs: TestChartSource: dir: - path: ./kubernetes/helm/testdata/mychart + path: ./kubernetes/helm/tests/testdata/mychart + TestKubeconfig: + text: | + apiVersion: v1 + clusters: + - cluster: + certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUM1ekNDQWMrZ0F3SUJBZ0lCQURBTkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0VRWURWUVFERXdwcmRXSmwKY201bGRHVnpNQjRYRFRJeE1EUXdNakUwTlRJME5Wb1hEVE14TURNek1URTBOVEkwTlZvd0ZURVRNQkVHQTFVRQpBeE1LYTNWaVpYSnVaWFJsY3pDQ0FTSXdEUVlKS29aSWh2Y05BUUVCQlFBRGdnRVBBRENDQVFvQ2dnRUJBTkJTCmp4OHZ4YlovRTVDUWw5akdKcWt6NGkxK0xrcjJSQnlsblRvRTV2dnd0VEZMamJudzR6T3RoQlBaV1VGcEZyMG8KNytBNUxaamRnMkRFendRbnpEaUxTc2RuV1plMEg5U3hLNjVMQ0VNdkR5UlFkenc4Wmt4eXNzQ3J3V2tqd3Y0QwpsbjhzYXVvQ0hrd3ZxelhtZjI2bHR1MC9YYUhrNzdwSlZiSTR0NFNpeUNTMjZsNVhyaGhOUlpkSG5La0FOVnQyCitPcWVzUGhQNWJTcDdSdkhLSDJFWXlISkp4azRYdzJhSUl0T1BYSThGcm1LM0NaZEJaN0VVTzRYTE5aa1M1M2UKZWpNRmlXcHNCVlRsR1lhSmYxMXZ6dmlmRE1uemNvV2ZKVGhaZDBMd0dKRVFVeDA0YXpCZ1VrTWJwVGpBL1ErVwoxamx0ZTZzNERuaE5MODFrYUxNQ0F3RUFBYU5DTUVBd0RnWURWUjBQQVFIL0JBUURBZ0trTUE4R0ExVWRFd0VCCi93UUZNQU1CQWY4d0hRWURWUjBPQkJZRUZIT0d3YjJRcG1RVW0wcWhaTlhDK0d3blBDdm9NQTBHQ1NxR1NJYjMKRFFFQkN3VUFBNElCQVFDSjdkQU94ZkJvSlE5OWgyc0RJWVdKT0NXWU9mK0h1MWhMbHpPMHBsODhEUG9WNGE1dwo0WEZVK1pjcW9aU2hVVjZ2RlFGK2s3Q29ldC8zUUppQ2VOZjhMS2pITlh2OUtKcGFoaDhQbElVb3RHMjF3a1NaCmN6MDFRTms1T2pEdmhXQ1BnckNDUEpTQlV6cXQ4cHZTWkhPL3pZckJReUhYM1VSQmhvUDdUeDg5SnBqSEYrTmEKNlBhYzR4SndKWUxPYVJJcWZwWlE4NUdXanBuWXE0c2p2cHdzbXJJZS8vcmFUTHdaSUVQdG5URlFtNFJseW9CeApDbG5mT1c5MjRFbm5nMVBDZUFNK2JyZ1psODB0NW5wK1hrTkVpaisvbFY1NGZFUjhMbTROWkpabGM4eVlOZDZqCnM2ZzgzRmlWN0tvcGZKZk1VT3hSY0hEempTekp1bGFta2pybQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg== + server: https://127.0.0.1:35377 + name: kind-kind + contexts: + - context: + cluster: kind-kind + user: kind-kind + name: kind-kind + current-context: kind-kind + kind: Config + preferences: {} + users: + - name: kind-kind + user: + client-certificate-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURFekNDQWZ1Z0F3SUJBZ0lJU1o0SjMxa0Rsdnd3RFFZSktvWklodmNOQVFFTEJRQXdGVEVUTUJFR0ExVUUKQXhNS2EzVmlaWEp1WlhSbGN6QWVGdzB5TVRBME1ESXhORFV5TkRWYUZ3MHlNakEwTURJeE5EVXlORFphTURReApGekFWQmdOVkJBb1REbk41YzNSbGJUcHRZWE4wWlhKek1Sa3dGd1lEVlFRREV4QnJkV0psY201bGRHVnpMV0ZrCmJXbHVNSUlCSWpBTkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQXo0aGtSb1VSYlZkbEVaUDcKQTdFVGxOOG9iZzRybmY4RkJDeVlJd1dRbDR5d0lMZUV6MWVMajloS1c5Vkx1OW8yemlGQm5GRGhSQXFpc0JlTQpPanlBNzJkZzJibmZKM0kwVERpT05TcWRrS2RDRnU1V2I0TDM0U0NDcVRzeFdUL0JUNjJsZkVFUzIxN3UxV2pSClBWNlcrVjhzSlhwQVJESUxoUmpGS0pNVjE3a2U0RjVUeDE4WDBuOHhXaGhFZFBrR0FzRDdaaDQ3ZFoxbWRQMjAKbWV1M1grREtqUUpydzlVb0hCV3UzZEoyWWtNNmpUR3B1TnlmaVVrYUcrS1lmUThuVFdiM3VvVHJKYXFlL015aApyY3ducGZVNUFzVUJteUJjN1JrZlZsTEpIWDltbU5wYWxkeUpTaFFnRndSZTQ5NFVuVGpjU3lHVzhUUXhMSmVOCkx1NFdBd0lEQVFBQm8wZ3dSakFPQmdOVkhROEJBZjhFQkFNQ0JhQXdFd1lEVlIwbEJBd3dDZ1lJS3dZQkJRVUgKQXdJd0h3WURWUjBqQkJnd0ZvQVVjNGJCdlpDbVpCU2JTcUZrMWNMNGJDYzhLK2d3RFFZSktvWklodmNOQVFFTApCUUFEZ2dFQkFERnFWMUdvby83NVN5ekVMNlNMeVVhbXJicUJGNFNxRVFYdnBzRjdoYnJ2QWhHMEdIc21DR0tFCk11bFhxeXdiYVpmTGo4ZHFRdVVLTlExN1U5ZWIva0ZXcXRrVlNyZG03eGc0ZythOWFHT0J4RE9vUVZTTHJPeUIKb0ErSUF0d0REZlRUTWhHVksxZXVMWnhXdU1qUkJwMDB5ZUFlVEsyYjlBNUV1dFViWC94MGtWZGhlckx1MitmZAo2Um5VSnBjaEpMR3hjWDZNelVzR0RITC9RcCszaTJ2SnAvQm54V3huNjV0Sm01SXZ3UnQybEZFZ05SUHFiR1NxCit6RVpnZzFTVmlvRUU3U2VsdVV5R2NueHMvQyttdCt3QVZGNzErdGxMN1F5NmFGWEppRXlOOVE2Rjhtd1hDNGkKNmFyb1FFM2JjVkZOOTFKczNFN1NOcVJNci8rWjRFQT0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo= + client-key-data: LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlFcEFJQkFBS0NBUUVBejRoa1JvVVJiVmRsRVpQN0E3RVRsTjhvYmc0cm5mOEZCQ3lZSXdXUWw0eXdJTGVFCnoxZUxqOWhLVzlWTHU5bzJ6aUZCbkZEaFJBcWlzQmVNT2p5QTcyZGcyYm5mSjNJMFREaU9OU3Fka0tkQ0Z1NVcKYjRMMzRTQ0NxVHN4V1QvQlQ2MmxmRUVTMjE3dTFXalJQVjZXK1Y4c0pYcEFSRElMaFJqRktKTVYxN2tlNEY1VAp4MThYMG44eFdoaEVkUGtHQXNEN1poNDdkWjFtZFAyMG1ldTNYK0RLalFKcnc5VW9IQld1M2RKMllrTTZqVEdwCnVOeWZpVWthRytLWWZROG5UV2IzdW9UckphcWUvTXlocmN3bnBmVTVBc1VCbXlCYzdSa2ZWbExKSFg5bW1OcGEKbGR5SlNoUWdGd1JlNDk0VW5UamNTeUdXOFRReExKZU5MdTRXQXdJREFRQUJBb0lCQUVlV3BmaUppSVJ1UkVmMwpBdnk0QmFneC9wRlFSQTJCWGVxZHMzRkpSeUp2L29XYXFLNlpaV1FlV1RBcWVMQjVTclI2Vmxha3M4QXo1d0RWCmJxTGNJaUh6U0Q1eTFwNlZ6NktIVTg3VlAzc1pwenVmeGFNN3kyUVdRZHc4dGY0eWR1MlVXZVJ0MGlKb01memQKNW1mRURGSkRXVWdvVHFqM2xtKzRKcktqWWtLQ1V3QnAzSi9NOEdEWG5xck5jYVVjc2lJSFExZnVJRllENXQ5MQpEWDVPaHAvQUkvNUhJc292YVRrS0g1LzlIblpsRllScWhRYUhRS3BMQnA1TkxyS2UybXpOSS9CUnlkNUkxdm1DCkFkeDA1MEtnSXhNRWpDaXp5MnFWSTd3eGNPR1B3Smx2YkU5b2pDakN3dk1tZWlXTkxLNUpFdXdaZitCWVFFbUIKbXA3dmU2a0NnWUVBOHBxMlkybWtLUXA4UXgzN1RPUEYwZGlWM2pDZ0FhSXoyRDJwSkIyWDEzYlRHK01UT3dONwpURUd5M055TEc3R2RvVmVNNitHMFJUSTR6VFZkWmU2T3k3U1NQQXdxS0IrZGJINEE0NU9MT29rUGxUWDRDTmdQCjB1eXFTSCtLWEQ1dkxkbEFhalpqSzkzK3gvbFFaRWhKM3VqYlFZaStkQVJtOGlwam9XWkR4b2NDZ1lFQTJ2M3UKaXc0R3FrWW1FQjlmTEVqN3hUZE11Q1FHdUxLUEZaUUtSNjRZbUR6MGdESnVkWk1XUmVLZFZibEFDSzBrUHdyegpyOTIrdUpzSWkyUzlNYjVabmo0QnR2Y1JqTzJzcUdoTG9YNDVVZHNadTduSDM3dTNSVzVaRi90VnBTYTJ5SkpPCkxHY3FKY3VyWnB5Vk1uZmt3L3dHdHJSdWNCODV5a1hqSEsrUEY2VUNnWUVBMEtpdWZEeU5POXRQMnk0N1NQdVMKMWhUUmVhUWF5cXptcUhNSU9nN1YzVFRQQitvN1RRT0dsYVRnSU1QelJXTnpyeVF0Q1dnNzgxUHB0TjNVTWVxSAptTDc3RTNobS9kR0xSWmZ1VGM1RjdwZVo5bnpQazFPNThIRXJXR1dSN0JxcTV5VTNHT01rVXNPQjhoOEZ2T3JMCjFsUXkyRit6WnZldVQxU1VFbXB4bXBzQ2dZQlBSVG9URmRtdHkwUzk4MDAxTDVvTGNwQVAyK0tlK3V1MmFPY3IKdVVabjNUQzRNd2t2QURaQXg5NGlDTE80TUV4OWtZNVNhOWM4NWNtN0E1VkVxMTJ2WFV5cm1WVytDTTdHQ3pMTgpXMjZPUmR4VHl0VWlGTVlybU4waFJEWmxXTlV6VjFwNjBrRThlelFwS2FjTUpNQW5mVlJFMEoxbGNyZ3Rrd3k1CjlvYTZqUUtCZ1FESGNuNnl5dzhzSThUTlUvazZDMGhyRkhYeHpLc0ZkMWV5Misxa01ZMm5pR0o3UHRGaHBMZWwKaTIzU3NPSFFyM29Da1l0bHpIL2pzR21OS01IOWxyOFdjTkgvTE04eEJ0N2lhZDFESTlrN0RYbjFscjFIbW1wUApsRlhyQjZ3VDV1UDZVRmhxNHY5NWhkQW5CL3YvOWFPdTIyNlBKYXVUV2RtaGxaNElFa3N1M1E9PQotLS0tLUVORCBSU0EgUFJJVkFURSBLRVktLS0tLQo= sops: kms: [] gcp_kms: [] @@ -20,8 +42,8 @@ sops: VHlGUExaMzcwM0pOM2VDY280UWZXSzQKAm7ZV1agxbla3Yrc7vrwJosSjQtWhdac ZFyQ6Gi+9H7qHZM89yVjAaIg1lwr68HcjYgDzpvvhJO9YPfzwoLyHw== -----END AGE ENCRYPTED FILE----- - lastmodified: "2021-06-18T15:42:52Z" - mac: ENC[AES256_GCM,data:SzHFZpgiv+h1vRjq0GP+4nzj9az6pAwQwstxYz10yBGPQXnZv/VtJm071oouiK7pgD4i7cTvTKgIOaX9K74PiWSiTjWI5F9sGHvt9ZoGyU08OHM6zwGMDiYygBN2+5dd5jBvT4Xy6efa0IOMxSqhp69+VoJRWesAFsN6IfDcIEY=,iv:Af2WeB2eVk5hnWFWaQij7hz2wjXgNWDJTWDm13iKNvA=,tag:uvR1ruMc69ZhDJRtYCFQBw==,type:str] + lastmodified: "2021-06-24T18:19:00Z" + mac: ENC[AES256_GCM,data:YOoJzBwg1qxodJ8BZNwUWB5K5GlN+YKkKVjdc0rlG4SS+XhypsdSTwNCZLxXhT9NeGSeqlECNF6OIIBAomDHyv1PVnbbM65Q6gmNWrdXmWbJqUB1wEOg46NY/DxjmkC2miX6WIOz9zZSDNWKITYyLVVRwR9F1Pgh16x2q2x+MAo=,iv:KF4tAnVZXUm8+J5VKfpPIn3ZzdyyCYZfxyDoFyCb8dM=,tag:5UIN4Vb40+RwDcRjIptSkg==,type:str] pgp: [] encrypted_suffix: secret version: 3.7.1 diff --git a/stdlib/.dagger/env/kubernetes-kustomize/values.yaml b/stdlib/.dagger/env/kubernetes-kustomize/values.yaml index a9b6f70e..d1816759 100644 --- a/stdlib/.dagger/env/kubernetes-kustomize/values.yaml +++ b/stdlib/.dagger/env/kubernetes-kustomize/values.yaml @@ -1,10 +1,11 @@ plan: - module: .dagger/env/kubernetes-kustomize/plan + module: ./kubernetes/kustomize + package: ./tests name: kubernetes-kustomize inputs: TestKustomize.testdata: dir: - path: ./kubernetes/kustomize/testdata + path: ./kubernetes/kustomize/tests/testdata sops: kms: [] gcp_kms: [] @@ -20,8 +21,8 @@ sops: OFllMEh3cVJZZnFxbW4xS1RtcFQzcFUKo/1WcYp4nPBXba8wQBe3DMt6pYQJGoSu ja5BiCffN5wOoW9WT0j8Clx21w7BXcl46+T5GYpXDQDcqf6nCv1kYQ== -----END AGE ENCRYPTED FILE----- - lastmodified: "2021-06-17T20:48:00Z" - mac: ENC[AES256_GCM,data:SCWiSiDccPkZApOcc8RsYP7WPZUqUyYVB0UgivLhIsNSY5q3kCdenPLTUp2zLOcwaWzTPGmj++QtZjoNobcIhdVt1aJ9uXLLKRUXaRGIO3Jmhg3wj7kSPNjbDLZEB6uyA9h3edQGVVivNlNGpo91tg35QcFPPSG7UiowFnsD0zM=,iv:44hkujM/ZWjtYHau8BFMdOIeBj5jF/WnW4OOK7oSw1Y=,tag:mtJdUR+sA0tjIyAWDpXQlA==,type:str] + lastmodified: "2021-06-24T18:16:21Z" + mac: ENC[AES256_GCM,data:eq7Eev6taZJnkl2SoqihKo9tfAMA3IOnLO9tBoppUeg1LSLe6vZ8QmN7s1Z0gyWNWttnNTdMOvTQTI2PGrayQpLRGzryChcQsuCL7hnij6bQf16IcGn9jbq7NVQ1EreS8iPZYuyYlR5Z9kSARtfAKFALim8ccF+BmR9+X7yBfZ4=,iv:7kovyOERH0dx0NONhmUwOUI39nK5N1rT9o+gi9ol3f4=,tag:6HrkHbiCwrgO7hukxtsXVA==,type:str] pgp: [] encrypted_suffix: secret version: 3.7.1 diff --git a/stdlib/.dagger/env/netlify/values.yaml b/stdlib/.dagger/env/netlify/values.yaml index db679ad8..571fecfe 100644 --- a/stdlib/.dagger/env/netlify/values.yaml +++ b/stdlib/.dagger/env/netlify/values.yaml @@ -1,5 +1,6 @@ plan: - module: .dagger/env/netlify/plan + module: ./netlify + package: ./tests name: netlify inputs: TestNetlify.deploy.account.name: @@ -21,8 +22,8 @@ sops: SEdUK2RsaUxuVWg2aXUwdVJ0eUtrWWMKWkQDBuL5e4QDx5Wy6+fHiD+J4fp7QdMm lsqgmxRvJMWgEvm1U+hDAo/Pkn8PFUFJf0KxEvkdF4qGuguQePgzFQ== -----END AGE ENCRYPTED FILE----- - lastmodified: "2021-06-15T16:26:12Z" - mac: ENC[AES256_GCM,data:q9xRCwgpgyiVvF3r2mec7vuF3+wwFepWUb9YpGrOLiFfoqsJngap3kn5vIe+Idk5KsdPKLI13vd8So3Fz1tXy5JTSxljp/IvAr5JQGDpKyo4HRYtgstdJnXVtZf8Hg+V9LC+bZVIY07pXeyDLvk6LEBUo7ANexakr/o6bKGyAG0=,iv:NXtvo0HgElQoD3AI97qrf0M08T+9Cn+5gztUMwR6w/M=,tag:CGDqTu/U/snU2AcjSpA25A==,type:str] + lastmodified: "2021-06-24T18:29:56Z" + mac: ENC[AES256_GCM,data:rDg4tHAp9rxUJRPTmnW3R69JnGfVMnYOBraRX84BRbhFNVS2S4MwK5xjZ5E0ZVBGQDyjmr9ApOMzI2bTFsnCO01FmkISo/V0fR/nPPTz6NABkc/JUFzhi4DAONAV7TXLBv1mwhKoAP9JL26MTYaOfnxehDVrvwciANQMdgqnp/E=,iv:7IHISgR50guk6r3etF+A3AWOn6LZxhE96MWgDMHf8IU=,tag:Bs18JGNWKBjAHzrfFJnL2A==,type:str] pgp: [] encrypted_suffix: secret version: 3.7.1 diff --git a/stdlib/.dagger/env/os-container/.gitignore b/stdlib/.dagger/env/os-container/.gitignore new file mode 100644 index 00000000..01ec19b0 --- /dev/null +++ b/stdlib/.dagger/env/os-container/.gitignore @@ -0,0 +1,2 @@ +# dagger state +state/** diff --git a/stdlib/.dagger/env/os-container/values.yaml b/stdlib/.dagger/env/os-container/values.yaml new file mode 100644 index 00000000..4cf06e21 --- /dev/null +++ b/stdlib/.dagger/env/os-container/values.yaml @@ -0,0 +1,29 @@ +plan: + module: ./os + package: ./tests/container +name: os-container +inputs: + SimpleSecret.cleartext: + text: hello, world! + SimpleSecret.encrypted: + secret: ENC[AES256_GCM,data:Ps0VwEr1g2VJAkuyvA==,iv:LWWhr6wjWhpiv46VIehkVK0p8gwd8S1atmiFYqWcdLI=,tag:lridOOyvkUlSa6n+e6rMPw==,type:str] +sops: + kms: [] + gcp_kms: [] + azure_kv: [] + hc_vault: [] + age: + - recipient: age1gxwmtwahzwdmrskhf90ppwlnze30lgpm056kuesrxzeuyclrwvpsupwtpk + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB5SU9NUTRWWTBvZzRWZkNT + Tk5TWFBFcHBWMldNSXA4KzU3TlVwTU9pdEZJCkFXNWpMMmZOZGs3WTYxZ3hDZVpv + L3lYNVh3Ti9UQXZzaTNWRU9IdGh4UncKLS0tIDFxbE1ZTmlUNElWWmRIN2hSRjk4 + azJIU2lIVlF4N1VxT2tVWDBPU2RsOEkKqkfxeT/mnnDxdvv/vhXMj2Zl8ogaAHa6 + xbBUOaCZ8stwj4Zz4/iKdrPspQQKo7/QuxxAcFUfyuK3fULqJHPXPQ== + -----END AGE ENCRYPTED FILE----- + lastmodified: "2021-06-24T18:33:56Z" + mac: ENC[AES256_GCM,data:0uCRRnDFpow8TTkSZFM5Jn8GZp6C1muLrnHvBUb5/rQ54x+G5lbgqS+rOfgFUgU1/qvKVevO0m96jfo4ZetNLnPscvK8p1oSUGBtk6iQ61tLeIQQFJR82gO2mzqVj0g0KYYeX+1QPglePimYuFy6lRGpqGEPNyxjlhq/EGhHOgU=,iv:7Lrph3Cum9H+2UuAIwCHh/wkVft2fadZ+a2F4aoCZLk=,tag:6Q60ujt3o+mvVErih2dLzg==,type:str] + pgp: [] + encrypted_suffix: secret + version: 3.7.1 diff --git a/stdlib/.dagger/env/os/.gitignore b/stdlib/.dagger/env/os/.gitignore new file mode 100644 index 00000000..01ec19b0 --- /dev/null +++ b/stdlib/.dagger/env/os/.gitignore @@ -0,0 +1,2 @@ +# dagger state +state/** diff --git a/stdlib/.dagger/env/os/values.yaml b/stdlib/.dagger/env/os/values.yaml new file mode 100644 index 00000000..78c22ae6 --- /dev/null +++ b/stdlib/.dagger/env/os/values.yaml @@ -0,0 +1,24 @@ +plan: + module: ./os + package: ./tests/os +name: os +sops: + kms: [] + gcp_kms: [] + azure_kv: [] + hc_vault: [] + age: + - recipient: age1gxwmtwahzwdmrskhf90ppwlnze30lgpm056kuesrxzeuyclrwvpsupwtpk + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSA0bDM5blE0cC9LNHkxZmEy + bitYcjhMOHhrWE5pRm90Qyt4S200ZTN0Q1d3Clh2VmdKQjdGUGdKaThmaktwN1F6 + aXZpellwbHpkb3pMb1NMNXVJYnFUMmMKLS0tIFNiZGlBNjE3UjlXWnBjZ3hwSWto + STlrbFNHZGFRUVQ1S1RIaGVyWktNV0kKo9AFURi/BKI+JuGYVuOrsw3eJU3s66Im + FCc5YCzrsjX+Y26Su+XW81fTWkcC910e/g+tlZbEFWKZYa8qu1VkqA== + -----END AGE ENCRYPTED FILE----- + lastmodified: "2021-06-24T18:33:15Z" + mac: ENC[AES256_GCM,data:8/GzJKtH7GONYbtBDqaSj5HdK8csmwoE7fNx2tRAwUs1uYCaZT4n1NBFuxDj/iFtVKB/St2Ba4thEE6+99azLnmMoC1Ss/1v9ZPfINzZuEZBFf3+ufVNSdI49c8DOeRfPNieupPdmPwHFBUN1nPpaK3bYmgr8CaVkdY3+iq4hX8=,iv:lIMOnbJr1gBoCdlbRWTOg2jA57fhZLu970k5QqV+1Yk=,tag:IziUm3K+8IdBJ5XYoeHhjg==,type:str] + pgp: [] + encrypted_suffix: secret + version: 3.7.1 diff --git a/stdlib/.dagger/env/sanity-check/.gitignore b/stdlib/.dagger/env/sanity-check/.gitignore new file mode 100644 index 00000000..01ec19b0 --- /dev/null +++ b/stdlib/.dagger/env/sanity-check/.gitignore @@ -0,0 +1,2 @@ +# dagger state +state/** diff --git a/stdlib/.dagger/env/sanity-check/plan/main.cue b/stdlib/.dagger/env/sanity-check/plan/main.cue new file mode 100644 index 00000000..5d981a78 --- /dev/null +++ b/stdlib/.dagger/env/sanity-check/plan/main.cue @@ -0,0 +1,69 @@ +package main + +import ( + "alpha.dagger.io/dagger" + "alpha.dagger.io/os" + "alpha.dagger.io/alpine" +) + +// Assert that there are no errors +err: "" + +// Directory containing universe packages (./universe/ in dagger repo) +universe: dagger.#Input & dagger.#Artifact + +ctr: #CueCLI & { + ctx: universe + command: """ + ( + find . -name '*.cue' -print0 | xargs -0iX dirname X | sort -u | { + while read -r dir; do + [ "$(basename $dir)" = "cue.mod" ] && continue + echo "--- $dir" + cue eval "$dir" >/dev/null + done + } > /out 2>/err + ) || true + """ +} + +result: (os.#File & { + from: ctr.ctr + path: "/out" +}).contents @dagger(output) + +err: (os.#File & { + from: ctr.ctr + path: "/err" +}).contents @dagger(output) + +#CueCLI: { + command: string + ctx: dagger.#Artifact + vendor: [name=string]: dagger.#Artifact + + ctr: os.#Container & { + image: alpine.#Image & { + package: { + curl: true + tar: true + } + } + setup: [ + """ + set -e + cd $(mktemp -d) + curl -L https://github.com/cuelang/cue/releases/download/v0.4.0/cue_v0.4.0_linux_amd64.tar.gz -o cue.tgz + tar zxvf cue.tgz + cp cue /usr/local/bin/cue + rm -fr ./* + """, + ] + mount: "/ctx": from: ctx + for name, dir in vendor { + mount: "/ctx/cue.mod/pkg/\(name)": from: dir + } + dir: "/ctx" + "command": command + } +} diff --git a/stdlib/.dagger/env/sanity-check/values.yaml b/stdlib/.dagger/env/sanity-check/values.yaml new file mode 100644 index 00000000..4f546458 --- /dev/null +++ b/stdlib/.dagger/env/sanity-check/values.yaml @@ -0,0 +1,27 @@ +plan: + module: .dagger/env/sanity-check/plan +name: sanity-check +inputs: + universe: + dir: + path: . +sops: + kms: [] + gcp_kms: [] + azure_kv: [] + hc_vault: [] + age: + - recipient: age1gxwmtwahzwdmrskhf90ppwlnze30lgpm056kuesrxzeuyclrwvpsupwtpk + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBtMjhYeVhscGxYWVg1RHZ2 + bjlWcnFuQ1hvVGVvZGRDYUlpeWpYYUZnWW5nCndObmdoSkpZZXI4MytwNUtsMkwr + ZkY4a01iN1dSL05KaGExSk0rWFpjNzQKLS0tIGF0eVRXalloUERaU2lhZ2gwcG1G + RE1BR1ZvSlpRWnpZVERFQlB5ckhPYk0KMm8XjFKgcjWaXh9F542NXyv9dBZQdZJC + rn5YittfEOwRkrlqBCVwPtU+nhE5oDxnt9a0n8JMUgvB0Nnd6tgP+A== + -----END AGE ENCRYPTED FILE----- + lastmodified: "2021-06-24T15:27:51Z" + mac: ENC[AES256_GCM,data:SDJPXr1NjGSOcHMLmKrzJ9XkFjfXOg7g5pdgXS3fQ4sSALVBqhHSfHJnH2m4NVSJPyOd35ia2/BivTWTGw1oguovLSfSvlptPUDqbwsXQoB2NEFcAJ6eJeDyz8Bx98OrBliyJaVOVYzF4y5dWwW2BGuevW097PbY/Sv3p6x8fyY=,iv:IftNBSOvEn3nGRQlD47At8pvundsXdk68yz+cWct/tU=,tag:XUPxsP39xSjPgvIZNBV09w==,type:str] + pgp: [] + encrypted_suffix: secret + version: 3.7.1 diff --git a/stdlib/.dagger/env/terraform/values.yaml b/stdlib/.dagger/env/terraform/values.yaml index fb5e132f..16b124ee 100644 --- a/stdlib/.dagger/env/terraform/values.yaml +++ b/stdlib/.dagger/env/terraform/values.yaml @@ -1,5 +1,6 @@ plan: - module: .dagger/env/terraform/plan + module: ./terraform + package: ./tests name: terraform inputs: TestConfig.awsConfig.accessKey: @@ -8,7 +9,7 @@ inputs: secret: ENC[AES256_GCM,data:cBYaVhbeV9D6acJWNU7uL8AsEtpnY0wHM8td9ZAJ9ebGB+BY4iBZLQ==,iv:SDkRKQQKBSz/cRQlW65sIjF0PhHhhKkGUEgZe9CV7Ek=,tag:OCUQmgjP2p57YoLts9Dh4w==,type:str] TestData: dir: - path: ./terraform/testdata + path: ./terraform/tests/testdata sops: kms: [] gcp_kms: [] @@ -24,8 +25,8 @@ sops: cC9LSiswbFRKaTNXUGNIWVZVbGJqV1UK3/wsgPwR5P2fzs80wcz1dM/8sbBWMR+B dmhP99OQisIgcwGATy0nh726pYKtosDpSLIJkLZDAUq9qRKm9bch1w== -----END AGE ENCRYPTED FILE----- - lastmodified: "2021-06-18T16:01:11Z" - mac: ENC[AES256_GCM,data:XznDGqfZkC6vsv696qWVxbBCUgsyU/zPZg0NCULCXAfO08Hsteb0c93Y8DA3CV8flQW3cgn5XLugNnQADJ6luTXHbqIVMVMUSe1q41Kxl7exr/dn0robqaRm5MnloG823s9X3sAOcPzyTSxy1YVZfYaYbG23w9IeNmVTyaUttkU=,iv:kEQs7+bx+7j2v5b6Bx0r+ZVtp7rj/8mgX4oRUP7cruc=,tag:oQEfCPO/0V11rmkc0yaz3Q==,type:str] + lastmodified: "2021-06-24T18:37:04Z" + mac: ENC[AES256_GCM,data:yKkQ3Vf3O3881P5+i9CFLKHIB9gWPonutIsVihhH+m852T4lNB7tZMpwvDqG8+tsjnGakpaYrTmt2f1SegJrSQYN6nr3kGCagx3GEwcz5m9MtzlPeMfI8kqEJW99Bmv5JiABQpro5FK+S7uyAO9WEN17tMaqYh+BhNaOarcEjyo=,iv:uendThnoUOGzLsdycG069OQ4U0jtHz2kQCXPP3A3dQU=,tag:7LhJruk/cgOCLnMA7BhWCQ==,type:str] pgp: [] encrypted_suffix: secret version: 3.7.1 diff --git a/stdlib/alpine/alpine.cue b/stdlib/alpine/alpine.cue index 4e9735ac..b7b76a30 100644 --- a/stdlib/alpine/alpine.cue +++ b/stdlib/alpine/alpine.cue @@ -2,7 +2,7 @@ package alpine import ( - "dagger.io/dagger/op" + "alpha.dagger.io/dagger/op" ) // Default Alpine version diff --git a/stdlib/.dagger/env/alpine/plan/alpine.cue b/stdlib/alpine/tests/alpine.cue similarity index 84% rename from stdlib/.dagger/env/alpine/plan/alpine.cue rename to stdlib/alpine/tests/alpine.cue index b5dc0b9d..71329ca9 100644 --- a/stdlib/.dagger/env/alpine/plan/alpine.cue +++ b/stdlib/alpine/tests/alpine.cue @@ -1,12 +1,11 @@ package alpine import ( - "dagger.io/alpine" - "dagger.io/dagger/op" + "alpha.dagger.io/dagger/op" ) TestImageVersion: { - image: alpine.#Image & { + image: #Image & { // install an old version on purpose version: "3.10.9" } @@ -26,7 +25,7 @@ TestImageVersion: { } TestPackageInstall: { - image: alpine.#Image & { + image: #Image & { package: jq: true package: curl: true version: "3.13" diff --git a/stdlib/aws/aws.cue b/stdlib/aws/aws.cue index 91648e54..2e0a3ba5 100644 --- a/stdlib/aws/aws.cue +++ b/stdlib/aws/aws.cue @@ -2,9 +2,9 @@ package aws import ( - "dagger.io/dagger" - "dagger.io/dagger/op" - "dagger.io/alpine" + "alpha.dagger.io/dagger" + "alpha.dagger.io/dagger/op" + "alpha.dagger.io/alpine" ) // AWS Config shared by all AWS packages diff --git a/stdlib/aws/cloudformation/cloudformation.cue b/stdlib/aws/cloudformation/cloudformation.cue index 9cbb4909..50dad7f8 100644 --- a/stdlib/aws/cloudformation/cloudformation.cue +++ b/stdlib/aws/cloudformation/cloudformation.cue @@ -4,8 +4,8 @@ package cloudformation import ( "encoding/json" - "dagger.io/dagger/op" - "dagger.io/aws" + "alpha.dagger.io/dagger/op" + "alpha.dagger.io/aws" ) // AWS CloudFormation Stack @@ -48,8 +48,8 @@ import ( } outputs: { - [string]: string - } @dagger(output) + [string]: string @dagger(output) + } outputs: #up: [ op.#Load & { diff --git a/stdlib/aws/ecr/ecr.cue b/stdlib/aws/ecr/ecr.cue index 2ee4d7cc..b6f77594 100644 --- a/stdlib/aws/ecr/ecr.cue +++ b/stdlib/aws/ecr/ecr.cue @@ -2,8 +2,8 @@ package ecr import ( - "dagger.io/aws" - "dagger.io/os" + "alpha.dagger.io/aws" + "alpha.dagger.io/os" ) // Convert ECR credentials to Docker Login format @@ -28,5 +28,5 @@ import ( from: ctr path: "/out" } - }.read.data @dagger(output) + }.contents @dagger(output) } diff --git a/stdlib/.dagger/env/aws-ecr/plan/ecr.cue b/stdlib/aws/ecr/tests/ecr.cue similarity index 90% rename from stdlib/.dagger/env/aws-ecr/plan/ecr.cue rename to stdlib/aws/ecr/tests/ecr.cue index 2e094048..c78a68eb 100644 --- a/stdlib/.dagger/env/aws-ecr/plan/ecr.cue +++ b/stdlib/aws/ecr/tests/ecr.cue @@ -1,10 +1,9 @@ -package main +package ecr import ( - "dagger.io/aws" - "dagger.io/aws/ecr" - "dagger.io/dagger/op" - "dagger.io/random" + "alpha.dagger.io/aws" + "alpha.dagger.io/dagger/op" + "alpha.dagger.io/random" ) TestConfig: awsConfig: aws.#Config & { @@ -19,7 +18,7 @@ TestECR: { repository: "125635003186.dkr.ecr.\(TestConfig.awsConfig.region).amazonaws.com/dagger-ci" tag: "test-ecr-\(suffix.out)" - creds: ecr.#Credentials & { + creds: #Credentials & { config: TestConfig.awsConfig } diff --git a/stdlib/aws/ecs/run-task.cue b/stdlib/aws/ecs/run-task.cue index 06b848de..33ac7159 100644 --- a/stdlib/aws/ecs/run-task.cue +++ b/stdlib/aws/ecs/run-task.cue @@ -2,7 +2,7 @@ package ecs import ( - "dagger.io/aws" + "alpha.dagger.io/aws" ) // Task implements ecs run-task for running a single container on ECS diff --git a/stdlib/aws/eks/eks.cue b/stdlib/aws/eks/eks.cue index 0ac2e0b1..db13fb7c 100644 --- a/stdlib/aws/eks/eks.cue +++ b/stdlib/aws/eks/eks.cue @@ -2,8 +2,8 @@ package eks import ( - "dagger.io/dagger/op" - "dagger.io/aws" + "alpha.dagger.io/dagger/op" + "alpha.dagger.io/aws" ) // KubeConfig config outputs a valid kube-auth-config for kubectl client diff --git a/stdlib/.dagger/env/aws-eks/plan/eks.cue b/stdlib/aws/eks/tests/eks.cue similarity index 84% rename from stdlib/.dagger/env/aws-eks/plan/eks.cue rename to stdlib/aws/eks/tests/eks.cue index d0a92e9d..bbaef4f1 100644 --- a/stdlib/.dagger/env/aws-eks/plan/eks.cue +++ b/stdlib/aws/eks/tests/eks.cue @@ -1,17 +1,16 @@ package eks import ( - "dagger.io/aws" - "dagger.io/aws/eks" - "dagger.io/kubernetes" - "dagger.io/dagger/op" + "alpha.dagger.io/aws" + "alpha.dagger.io/kubernetes" + "alpha.dagger.io/dagger/op" ) TestConfig: awsConfig: aws.#Config & { region: "us-east-2" } -TestCluster: eks.#KubeConfig & { +TestCluster: #KubeConfig & { config: TestConfig.awsConfig clusterName: *"dagger-example-eks-cluster" | string } diff --git a/stdlib/aws/elb/elb.cue b/stdlib/aws/elb/elb.cue index 5923e75e..8d38c87e 100644 --- a/stdlib/aws/elb/elb.cue +++ b/stdlib/aws/elb/elb.cue @@ -2,8 +2,8 @@ package elb import ( - "dagger.io/dagger/op" - "dagger.io/aws" + "alpha.dagger.io/dagger/op" + "alpha.dagger.io/aws" ) // Returns an unused rule priority (randomized in available range) diff --git a/stdlib/aws/rds/rds.cue b/stdlib/aws/rds/rds.cue index 31b429aa..02cedf31 100644 --- a/stdlib/aws/rds/rds.cue +++ b/stdlib/aws/rds/rds.cue @@ -2,9 +2,9 @@ package rds import ( - "dagger.io/dagger/op" + "alpha.dagger.io/dagger/op" "encoding/json" - "dagger.io/aws" + "alpha.dagger.io/aws" ) // Creates a new Database on an existing RDS Instance diff --git a/stdlib/aws/s3/s3.cue b/stdlib/aws/s3/s3.cue index 5749aff5..06772388 100644 --- a/stdlib/aws/s3/s3.cue +++ b/stdlib/aws/s3/s3.cue @@ -2,9 +2,9 @@ package s3 import ( - "dagger.io/dagger" - "dagger.io/dagger/op" - "dagger.io/aws" + "alpha.dagger.io/dagger" + "alpha.dagger.io/dagger/op" + "alpha.dagger.io/aws" ) // S3 Bucket object(s) sync diff --git a/stdlib/.dagger/env/aws-s3/plan/s3.cue b/stdlib/aws/s3/tests/s3.cue similarity index 56% rename from stdlib/.dagger/env/aws-s3/plan/s3.cue rename to stdlib/aws/s3/tests/s3.cue index dfe20f5a..ebb788c0 100644 --- a/stdlib/.dagger/env/aws-s3/plan/s3.cue +++ b/stdlib/aws/s3/tests/s3.cue @@ -1,9 +1,9 @@ package s3 import ( - "dagger.io/dagger" - "dagger.io/aws" - "dagger.io/aws/s3" + "alpha.dagger.io/dagger" + "alpha.dagger.io/aws" + "alpha.dagger.io/random" ) TestConfig: awsConfig: aws.#Config & { @@ -17,22 +17,30 @@ content: "A simple test sentence" TestDirectory: dagger.#Artifact TestS3Object: { - deploy: s3.#Object & { - always: true - config: TestConfig.awsConfig - source: TestDirectory - target: "s3://\(bucket)/" + suffix: random.#String & { + seed: "s3" + } + + target: "s3://\(bucket)/\(suffix.out)/" + + deploy: #Object & { + always: true + config: TestConfig.awsConfig + source: TestDirectory + "target": target } verifyFile: #VerifyS3 & { config: TestConfig.awsConfig target: deploy.target + url: deploy.url file: "dirFile.txt" } verifyDir: #VerifyS3 & { config: TestConfig.awsConfig target: deploy.target + url: deploy.url file: "foo.txt" } } diff --git a/stdlib/aws/s3/testdata/bar/foo.txt b/stdlib/aws/s3/tests/testdata/bar/foo.txt similarity index 100% rename from stdlib/aws/s3/testdata/bar/foo.txt rename to stdlib/aws/s3/tests/testdata/bar/foo.txt diff --git a/stdlib/aws/s3/testdata/dirFile.txt b/stdlib/aws/s3/tests/testdata/dirFile.txt similarity index 100% rename from stdlib/aws/s3/testdata/dirFile.txt rename to stdlib/aws/s3/tests/testdata/dirFile.txt diff --git a/stdlib/.dagger/env/aws-s3/plan/verify.cue b/stdlib/aws/s3/tests/verify.cue similarity index 82% rename from stdlib/.dagger/env/aws-s3/plan/verify.cue rename to stdlib/aws/s3/tests/verify.cue index d1fb596b..1356a8b0 100644 --- a/stdlib/.dagger/env/aws-s3/plan/verify.cue +++ b/stdlib/aws/s3/tests/verify.cue @@ -1,9 +1,9 @@ package s3 import ( - "dagger.io/aws" - "dagger.io/alpine" - "dagger.io/dagger/op" + "alpha.dagger.io/aws" + "alpha.dagger.io/alpine" + "alpha.dagger.io/dagger/op" ) #List: { @@ -11,7 +11,10 @@ import ( config: aws.#Config // Target S3 URL (e.g. s3:////) - target?: string + target: string + + // URL: dummy URL, used to force a dependency + url: string contents: { string @@ -35,6 +38,7 @@ import ( aws s3 ls --recursive \#(target) > /contents """#, ] + env: URL: url }, op.#Export & { @@ -49,10 +53,12 @@ import ( file: string config: aws.#Config target: string + url: string lists: #List & { "config": config "target": target + "url": url } test: #up: [ diff --git a/stdlib/cue.mod/module.cue b/stdlib/cue.mod/module.cue new file mode 100644 index 00000000..45cdb689 --- /dev/null +++ b/stdlib/cue.mod/module.cue @@ -0,0 +1 @@ +module: "alpha.dagger.io" diff --git a/stdlib/dagger/dagger.cue b/stdlib/dagger/dagger.cue index f0463135..9731bfb1 100644 --- a/stdlib/dagger/dagger.cue +++ b/stdlib/dagger/dagger.cue @@ -1,7 +1,8 @@ +// Dagger core types package dagger import ( - "dagger.io/dagger/op" + "alpha.dagger.io/dagger/op" ) // An artifact such as source code checkout, container image, binary archive... diff --git a/stdlib/dagger/op/op.cue b/stdlib/dagger/op/op.cue index abcb023e..8fff9c31 100644 --- a/stdlib/dagger/op/op.cue +++ b/stdlib/dagger/op/op.cue @@ -107,7 +107,8 @@ package op } #WriteFile: { - do: "write-file" + do: "write-file" + // FIXME: "contents" to follow english convention content: string | bytes dest: string mode: int | *0o644 diff --git a/stdlib/docker/command.cue b/stdlib/docker/command.cue index d9352e6b..e51f1aec 100644 --- a/stdlib/docker/command.cue +++ b/stdlib/docker/command.cue @@ -3,9 +3,9 @@ package docker import ( "strconv" - "dagger.io/alpine" - "dagger.io/dagger" - "dagger.io/dagger/op" + "alpha.dagger.io/alpine" + "alpha.dagger.io/dagger" + "alpha.dagger.io/dagger/op" ) // A container image that can run any docker command @@ -62,6 +62,19 @@ import ( [string]: true | false | string @dagger(input) } + // Image registries + registries: [...{ + target?: string + username: string + secret: dagger.#Secret + }] @dagger(input) + + // Copy contents from other artifacts + copy: [string]: from: dagger.#Artifact + + // Write file in the container + files: [string]: string + // Setup docker client and then execute the user command #code: #""" # Setup ssh @@ -103,7 +116,8 @@ import ( #up: [ op.#Load & { from: alpine.#Image & { - package: { + "package": { + package bash: true "openssh-client": true "docker-cli": true @@ -111,6 +125,34 @@ import ( } }, + for registry in registries { + op.#Exec & { + args: ["/bin/bash", "-c", #""" + echo "$TARGER_HOST" | docker login --username "$DOCKER_USERNAME" --password-stdin "$(cat /password)" + """#, + ] + env: { + TARGET_HOST: registry.target + DOCKER_USERNAME: registry.username + } + mount: "/password": secret: registry.password + } + }, + + for dest, content in files { + op.#WriteFile & { + "content": content + "dest": dest + } + }, + + for dest, src in copy { + op.#Copy & { + from: src.from + "dest": dest + } + }, + if ssh.keyPassphrase != _|_ { op.#WriteFile & { content: #""" @@ -137,7 +179,7 @@ import ( op.#Exec & { always: true args: [ - "/bin/sh", + "/bin/bash", "--noprofile", "--norc", "-eo", @@ -146,7 +188,6 @@ import ( ] "env": { env - if ssh != _|_ { DOCKER_HOSTNAME: ssh.host DOCKER_USERNAME: ssh.user @@ -161,6 +202,9 @@ import ( } } "mount": { + if ssh == _|_ { + "/var/run/docker.sock": from: "docker.sock" + } if ssh != _|_ { if ssh.key != _|_ { "/key": secret: ssh.key diff --git a/stdlib/docker/compose/client.cue b/stdlib/docker/compose/client.cue new file mode 100644 index 00000000..504462cf --- /dev/null +++ b/stdlib/docker/compose/client.cue @@ -0,0 +1,16 @@ +package compose + +import ( + "alpha.dagger.io/alpine" +) + +// A container image to run the docker-compose client +#Client: alpine.#Image & { + package: { + bash: true + jq: true + curl: true + "openssh-client": true + "docker-compose": true + } +} diff --git a/stdlib/docker/compose/compose.cue b/stdlib/docker/compose/compose.cue new file mode 100644 index 00000000..77067ec2 --- /dev/null +++ b/stdlib/docker/compose/compose.cue @@ -0,0 +1,86 @@ +// Docker-compose operations +package compose + +import ( + "strconv" + "alpha.dagger.io/dagger" + "alpha.dagger.io/docker" +) + +#App: { + ssh?: { + // ssh host + host: string @dagger(input) + + // ssh user + user: string @dagger(input) + + // ssh port + port: *22 | int @dagger(input) + + // private key + key: dagger.#Secret @dagger(input) + + // fingerprint + fingerprint?: string @dagger(input) + + // ssh key passphrase + keyPassphrase?: dagger.#Secret @dagger(input) + } + + // Accept either a contaxt, a docker-compose or both together + source?: dagger.#Artifact @dagger(input) + composeFile?: string @dagger(input) + + // App name (use as COMPOSE_PROJECT_NAME) + name: *"source" | string @dagger(input) + + // Image registries + registries: [...{ + target?: string + username: string + secret: dagger.#Secret + }] @dagger(input) + + #code: #""" + if [ -n "$DOCKER_HOSTNAME" ]; then + ssh -i /key -fNT -o "StreamLocalBindUnlink=yes" -L "$(pwd)"/docker.sock:/var/run/docker.sock -p "$DOCKER_PORT" "$DOCKER_USERNAME"@"$DOCKER_HOSTNAME" + export DOCKER_HOST="unix://$(pwd)/docker.sock" + fi + + # Extend session duration + echo "Host *\nServerAliveInterval 240" >> "$HOME"/.ssh/config + chmod 600 "$HOME"/.ssh/config + + # Move compose + if [ -d "$SOURCE_DIR" ]; then + if [ -f docker-compose.yaml ]; then + cp docker-compose.yaml "$SOURCE_DIR"/docker-compose.yaml + fi + cd "$SOURCE_DIR" + fi + + docker-compose build + docker-compose up -d + """# + + run: docker.#Command & { + "ssh": ssh + command: #code + package: "docker-compose": true + "registries": registries + if source != _|_ { + copy: "/source": from: source + } + if composeFile != _|_ { + files: "/docker-compose.yaml": composeFile + } + env: { + COMPOSE_HTTP_TIMEOUT: strconv.FormatInt(200, 10) + COMPOSE_PROJECT_NAME: name + if source != _|_ { + SOURCE_DIR: "source" + } + } + } +} diff --git a/stdlib/docker/compose/tests/cleanup.cue b/stdlib/docker/compose/tests/cleanup.cue new file mode 100644 index 00000000..938abc88 --- /dev/null +++ b/stdlib/docker/compose/tests/cleanup.cue @@ -0,0 +1,93 @@ +package compose + +import ( + "strconv" + + "alpha.dagger.io/dagger" + "alpha.dagger.io/dagger/op" +) + +#CleanupCompose: { + // docker-compose up context + context: dagger.#Artifact + + // App name (use as COMPOSE_PROJECT_NAME) + name: *"source" | string + + ssh: { + // ssh host + host: string @dagger(input) + + // ssh user + user: string @dagger(input) + + // ssh port + port: *22 | int @dagger(input) + + // private key + key: dagger.#Secret @dagger(input) + + // fingerprint + fingerprint?: string @dagger(input) + + // ssh key passphrase + keyPassphrase?: dagger.#Secret @dagger(input) + } + + #code: #""" + # Export host + export DOCKER_HOST="unix://$(pwd)/docker.sock" + + # Start ssh agent + eval $(ssh-agent) > /dev/null + ssh-add /key > /dev/null + + ssh -i /key -o "StreamLocalBindUnlink=yes" -fNT -L "$(pwd)"/docker.sock:/var/run/docker.sock -p "$DOCKER_PORT" "$DOCKER_USERNAME"@"$DOCKER_HOSTNAME" || true + + # Down + if [ -d /source ]; then + cd /source + fi + + docker-compose down -v + """# + + #up: [ + op.#Load & {from: context}, + + op.#WriteFile & { + content: #code + dest: "/entrypoint.sh" + }, + + op.#Exec & { + always: true + args: [ + "/bin/sh", + "--noprofile", + "--norc", + "-eo", + "pipefail", + "/entrypoint.sh", + ] + env: { + DOCKER_HOSTNAME: ssh.host + DOCKER_USERNAME: ssh.user + DOCKER_PORT: strconv.FormatInt(ssh.port, 10) + COMPOSE_PROJECT_NAME: name + if ssh.keyPassphrase != _|_ { + SSH_ASKPASS: "/get_passphrase" + DISPLAY: "1" + } + } + mount: { + if ssh.key != _|_ { + "/key": secret: ssh.key + } + if ssh.keyPassphrase != _|_ { + "/passphrase": secret: ssh.keyPassphrase + } + } + }, + ] +} diff --git a/stdlib/docker/compose/tests/compose.cue b/stdlib/docker/compose/tests/compose.cue new file mode 100644 index 00000000..dffa83f8 --- /dev/null +++ b/stdlib/docker/compose/tests/compose.cue @@ -0,0 +1,88 @@ +package compose + +import ( + "alpha.dagger.io/dagger" + "alpha.dagger.io/docker" + "alpha.dagger.io/random" +) + +repo: dagger.#Artifact @dagger(input) + +TestSSH: { + key: dagger.#Secret @dagger(input) + host: string @dagger(input) + user: string @dagger(input) +} + +TestCompose: { + // Generate a random string. + // Seed is used to force buildkit execution and not simply use a previous generated string. + suffix: random.#String & {seed: "cmp"} + + name: "compose_test_\(suffix.out)" + + up: #App & { + ssh: { + key: TestSSH.key + host: TestSSH.host + user: TestSSH.user + } + source: repo + "name": name + } + + verify: docker.#Command & { + ssh: up.run.ssh + command: #""" + docker container ls | grep "\#(name)_api" | grep "Up" + """# + } + + cleanup: #CleanupCompose & { + context: up.run + "name": name + ssh: verify.ssh + } +} + +TestInlineCompose: { + // Generate a random string. + // Seed is used to force buildkit execution and not simply use a previous generated string. + suffix: random.#String & {seed: "cmp-inline"} + + name: "inline_test_\(suffix.out)" + + up: #App & { + ssh: { + key: TestSSH.key + host: TestSSH.host + user: TestSSH.user + } + source: repo + "name": name + composeFile: #""" + version: "3" + + services: + api-mix: + build: . + environment: + PORT: 7000 + ports: + - 7000 + """# + } + + verify: docker.#Command & { + ssh: up.run.ssh + command: #""" + docker container ls | grep "\#(name)_api-mix" | grep "Up" + """# + } + + cleanup: #CleanupCompose & { + context: up.run + "name": name + ssh: verify.ssh + } +} diff --git a/stdlib/docker/compose/tests/testdata/Dockerfile b/stdlib/docker/compose/tests/testdata/Dockerfile new file mode 100644 index 00000000..25d4c068 --- /dev/null +++ b/stdlib/docker/compose/tests/testdata/Dockerfile @@ -0,0 +1,15 @@ +FROM node:12-alpine + +WORKDIR /app + +COPY package.json package.json + +RUN npm install + +COPY . . + +ENV PORT=8080 + +EXPOSE 8080 + +CMD ["npm", "start"] \ No newline at end of file diff --git a/stdlib/docker/compose/tests/testdata/docker-compose.yaml b/stdlib/docker/compose/tests/testdata/docker-compose.yaml new file mode 100644 index 00000000..9f110ad6 --- /dev/null +++ b/stdlib/docker/compose/tests/testdata/docker-compose.yaml @@ -0,0 +1,7 @@ +version: "3" + +services: + api: + build: "" + ports: + - 8080 \ No newline at end of file diff --git a/stdlib/docker/compose/tests/testdata/index.ts b/stdlib/docker/compose/tests/testdata/index.ts new file mode 100644 index 00000000..d37fe572 --- /dev/null +++ b/stdlib/docker/compose/tests/testdata/index.ts @@ -0,0 +1,13 @@ +import express from "express"; +import { get } from "env-var"; + + +const app = express(); + +const port: number = get('PORT').required().asPortNumber(); + +app.get('/ping', (req, res) => { + res.status(200).send('pong') +}); + +app.listen(port, '0.0.0.0', () => console.log("Server listen on http://localhost:" + port)); \ No newline at end of file diff --git a/stdlib/docker/compose/tests/testdata/package.json b/stdlib/docker/compose/tests/testdata/package.json new file mode 100644 index 00000000..c2be41f2 --- /dev/null +++ b/stdlib/docker/compose/tests/testdata/package.json @@ -0,0 +1,22 @@ +{ + "name": "test", + "version": "1.0.0", + "description": "A simple api", + "main": "index.ts", + "scripts": { + "build": "tsc", + "start": "ts-node index.ts", + "test": "test" + }, + "author": "Tom Chauveau", + "license": "ISC", + "devDependencies": { + "ts-node": "^8.9.1", + "typescript": "^3.8.3" + }, + "dependencies": { + "@types/express": "^4.17.6", + "env-var": "^6.1.1", + "express": "^4.17.1" + } +} diff --git a/stdlib/docker/compose/tests/testdata/tsconfig.json b/stdlib/docker/compose/tests/testdata/tsconfig.json new file mode 100644 index 00000000..98907427 --- /dev/null +++ b/stdlib/docker/compose/tests/testdata/tsconfig.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "sourceMap": true, + "outDir": "dist", + "strict": true, + "lib": [ + "esnext", + "dom" + ], + "esModuleInterop": true + } +} diff --git a/stdlib/docker/docker.cue b/stdlib/docker/docker.cue index 642d1a59..4ddc4475 100644 --- a/stdlib/docker/docker.cue +++ b/stdlib/docker/docker.cue @@ -2,8 +2,8 @@ package docker import ( - "dagger.io/dagger" - "dagger.io/dagger/op" + "alpha.dagger.io/dagger" + "alpha.dagger.io/dagger/op" ) // Build a Docker image from source, using included Dockerfile diff --git a/stdlib/.dagger/env/docker-build/plan/dockerfile.cue b/stdlib/docker/tests/build/dockerfile.cue similarity index 83% rename from stdlib/.dagger/env/docker-build/plan/dockerfile.cue rename to stdlib/docker/tests/build/dockerfile.cue index 70b021f2..894f2b66 100644 --- a/stdlib/.dagger/env/docker-build/plan/dockerfile.cue +++ b/stdlib/docker/tests/build/dockerfile.cue @@ -1,15 +1,14 @@ package docker import ( - "dagger.io/dagger" - "dagger.io/dagger/op" - "dagger.io/docker" + "alpha.dagger.io/dagger" + "alpha.dagger.io/dagger/op" ) TestSourceBuild: dagger.#Artifact @dagger(input) TestBuild: { - image: docker.#Build & { + image: #Build & { source: TestSourceBuild } @@ -32,7 +31,7 @@ TestBuild: { TestSourceImageFromDockerfile: dagger.#Artifact @dagger(input) TestImageFromDockerfile: { - image: docker.#ImageFromDockerfile & { + image: #ImageFromDockerfile & { dockerfile: """ FROM alpine COPY test.txt /test.txt diff --git a/stdlib/docker/testdata/build/Dockerfile b/stdlib/docker/tests/build/testdata/build/Dockerfile similarity index 100% rename from stdlib/docker/testdata/build/Dockerfile rename to stdlib/docker/tests/build/testdata/build/Dockerfile diff --git a/stdlib/docker/testdata/dockerfile/test.txt b/stdlib/docker/tests/build/testdata/dockerfile/test.txt similarity index 100% rename from stdlib/docker/testdata/dockerfile/test.txt rename to stdlib/docker/tests/build/testdata/dockerfile/test.txt diff --git a/stdlib/.dagger/env/docker-command-ssh-key-passphrase/plan/command.cue b/stdlib/docker/tests/command-ssh-key-passphrase/command.cue similarity index 85% rename from stdlib/.dagger/env/docker-command-ssh-key-passphrase/plan/command.cue rename to stdlib/docker/tests/command-ssh-key-passphrase/command.cue index a4532607..dab3694f 100644 --- a/stdlib/.dagger/env/docker-command-ssh-key-passphrase/plan/command.cue +++ b/stdlib/docker/tests/command-ssh-key-passphrase/command.cue @@ -1,8 +1,7 @@ package docker import ( - "dagger.io/dagger" - "dagger.io/docker" + "alpha.dagger.io/dagger" ) TestConfig: { @@ -12,7 +11,7 @@ TestConfig: { keyPassphrase: dagger.#Secret @dagger(input) } -TestSSH: client: docker.#Command & { +TestSSH: client: #Command & { command: #""" docker $CMD """# diff --git a/stdlib/.dagger/env/docker-command-ssh-wrong-key-passphrase/plan/command.cue b/stdlib/docker/tests/command-ssh-wrong-key-passphrase/command.cue similarity index 84% rename from stdlib/.dagger/env/docker-command-ssh-wrong-key-passphrase/plan/command.cue rename to stdlib/docker/tests/command-ssh-wrong-key-passphrase/command.cue index 91f82ea4..096ee42e 100644 --- a/stdlib/.dagger/env/docker-command-ssh-wrong-key-passphrase/plan/command.cue +++ b/stdlib/docker/tests/command-ssh-wrong-key-passphrase/command.cue @@ -1,8 +1,7 @@ package docker import ( - "dagger.io/dagger" - "dagger.io/docker" + "alpha.dagger.io/dagger" ) TestConfig: { @@ -12,7 +11,7 @@ TestConfig: { keyPassphrase: dagger.#Secret @dagger(input) } -TestSSH: client: docker.#Command & { +TestSSH: client: #Command & { command: #""" docker version """# diff --git a/stdlib/.dagger/env/docker-command-ssh/plan/command.cue b/stdlib/docker/tests/command-ssh/command.cue similarity index 79% rename from stdlib/.dagger/env/docker-command-ssh/plan/command.cue rename to stdlib/docker/tests/command-ssh/command.cue index 1767faac..830c2416 100644 --- a/stdlib/.dagger/env/docker-command-ssh/plan/command.cue +++ b/stdlib/docker/tests/command-ssh/command.cue @@ -1,8 +1,7 @@ package docker import ( - "dagger.io/dagger" - "dagger.io/docker" + "alpha.dagger.io/dagger" ) TestConfig: { @@ -11,7 +10,7 @@ TestConfig: { key: dagger.#Secret @dagger(input) } -TestSSH: client: docker.#Command & { +TestSSH: client: #Command & { command: #""" docker $CMD """# diff --git a/stdlib/.dagger/env/docker-run-local/plan/local.cue b/stdlib/docker/tests/run-local/local.cue similarity index 61% rename from stdlib/.dagger/env/docker-run-local/plan/local.cue rename to stdlib/docker/tests/run-local/local.cue index 2c3505f4..36e4f95f 100644 --- a/stdlib/.dagger/env/docker-run-local/plan/local.cue +++ b/stdlib/docker/tests/run-local/local.cue @@ -1,15 +1,14 @@ -package main +package docker import ( - "dagger.io/docker" - "dagger.io/random" + "alpha.dagger.io/random" ) suffix: random.#String & { seed: "" } -run: docker.#Run & { +run: #Run & { name: "daggerci-test-local-\(suffix.out)" ref: "hello-world" } diff --git a/stdlib/.dagger/env/docker-run-ssh/plan/simple.cue b/stdlib/docker/tests/run-ssh/simple.cue similarity index 78% rename from stdlib/.dagger/env/docker-run-ssh/plan/simple.cue rename to stdlib/docker/tests/run-ssh/simple.cue index 17b7499f..386cf930 100644 --- a/stdlib/.dagger/env/docker-run-ssh/plan/simple.cue +++ b/stdlib/docker/tests/run-ssh/simple.cue @@ -1,9 +1,8 @@ -package main +package docker import ( - "dagger.io/docker" - "dagger.io/dagger" - "dagger.io/random" + "alpha.dagger.io/dagger" + "alpha.dagger.io/random" ) TestConfig: { @@ -17,7 +16,7 @@ TestSSH: { seed: "" } - run: docker.#Run & { + run: #Run & { name: "daggerci-test-ssh-\(suffix.out)" ref: "hello-world" diff --git a/stdlib/gcp/gcloud.cue b/stdlib/gcp/gcloud.cue index c8792ba2..9b8831f4 100644 --- a/stdlib/gcp/gcloud.cue +++ b/stdlib/gcp/gcloud.cue @@ -1,8 +1,8 @@ package gcp import ( - "dagger.io/dagger/op" - "dagger.io/alpine" + "alpha.dagger.io/dagger/op" + "alpha.dagger.io/alpine" ) // Re-usable gcloud component @@ -28,6 +28,7 @@ import ( #""" curl -sfL https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-\#(version)-linux-x86_64.tar.gz | tar -C /usr/local -zx ln -s /usr/local/google-cloud-sdk/bin/gcloud /usr/local/bin + ln -s /usr/local/google-cloud-sdk/bin/gsutil /usr/local/bin """#, ] }, diff --git a/stdlib/gcp/gcp.cue b/stdlib/gcp/gcp.cue index ea0e055e..18e71dff 100644 --- a/stdlib/gcp/gcp.cue +++ b/stdlib/gcp/gcp.cue @@ -2,7 +2,7 @@ package gcp import ( - "dagger.io/dagger" + "alpha.dagger.io/dagger" ) // Base Google Cloud Config diff --git a/stdlib/gcp/gcr/gcr.cue b/stdlib/gcp/gcr/gcr.cue index 5d32fa72..deafcfaf 100644 --- a/stdlib/gcp/gcr/gcr.cue +++ b/stdlib/gcp/gcr/gcr.cue @@ -2,8 +2,8 @@ package gcr import ( - "dagger.io/dagger/op" - "dagger.io/gcp" + "alpha.dagger.io/dagger/op" + "alpha.dagger.io/gcp" ) // Credentials retriever for GCR diff --git a/stdlib/.dagger/env/google-gcr/plan/gcr.cue b/stdlib/gcp/gcr/tests/gcr.cue similarity index 91% rename from stdlib/.dagger/env/google-gcr/plan/gcr.cue rename to stdlib/gcp/gcr/tests/gcr.cue index e5adc2b6..9c2f3add 100644 --- a/stdlib/.dagger/env/google-gcr/plan/gcr.cue +++ b/stdlib/gcp/gcr/tests/gcr.cue @@ -1,10 +1,10 @@ package main import ( - "dagger.io/gcp" - "dagger.io/gcp/gcr" - "dagger.io/dagger/op" - "dagger.io/random" + "alpha.dagger.io/gcp" + "alpha.dagger.io/gcp/gcr" + "alpha.dagger.io/dagger/op" + "alpha.dagger.io/random" ) TestConfig: gcpConfig: gcp.#Config diff --git a/stdlib/gcp/gcs/gcs.cue b/stdlib/gcp/gcs/gcs.cue new file mode 100644 index 00000000..cbe2f3f4 --- /dev/null +++ b/stdlib/gcp/gcs/gcs.cue @@ -0,0 +1,82 @@ +// Google Cloud Storage +package gcs + +import ( + "alpha.dagger.io/dagger" + "alpha.dagger.io/dagger/op" + "alpha.dagger.io/gcp" +) + +// GCS Bucket object(s) sync +#Object: { + + // GCP Config + config: gcp.#Config + + // Source Artifact to upload to GCS + source: dagger.#Artifact @dagger(input) + + // Target GCS URL (eg. gs:////) + target: string @dagger(input) + + // Delete files that already exist on remote destination + delete: *false | true @dagger(input) + + // Object content type + contentType: string | *"" @dagger(input) + + // Always write the object to GCS + always: *true | false @dagger(input) + + // URL of the uploaded GCS object + url: { + string + + #up: [ + op.#Load & { + from: gcp.#GCloud & { + "config": config + } + }, + + op.#Exec & { + if always { + always: true + } + env: { + TARGET: target + OPT_CONTENT_TYPE: contentType + if delete { + OPT_DELETE: "1" + } + } + + mount: "/source": from: source + + args: [ + "/bin/bash", + "--noprofile", + "--norc", + "-eo", + "pipefail", + "-c", + #""" + opts=("-r") + [ -n "$OPT_CONTENT_TYPE" ] && opts+="-h Content-Type:$OPT_CONTENT_TYPE" + [ -n "$OPT_DELETE" ] && opts+="-d" + gsutil rsync ${opts[@]} /source "$TARGET" + echo -n "$TARGET" \ + | sed -E 's=^gs://([^/]*)/=https://storage.cloud.google.com/\1/=' \ + > /url + """#, + + ] + }, + + op.#Export & { + source: "/url" + format: "string" + }, + ] + } @dagger(output) +} diff --git a/stdlib/gcp/gcs/tests/gcs.cue b/stdlib/gcp/gcs/tests/gcs.cue new file mode 100644 index 00000000..22530ce2 --- /dev/null +++ b/stdlib/gcp/gcs/tests/gcs.cue @@ -0,0 +1,43 @@ +package gcs + +import ( + "alpha.dagger.io/dagger" + "alpha.dagger.io/gcp" + "alpha.dagger.io/random" +) + +TestConfig: { + gcpConfig: gcp.#Config + bucket: string @dagger(input) +} + +TestDirectory: dagger.#Artifact + +TestGCSObject: { + suffix: random.#String & { + seed: "gcs" + } + + target: "gs://\(TestConfig.bucket)/\(suffix.out)/" + + deploy: #Object & { + always: true + config: TestConfig.gcpConfig + source: TestDirectory + "target": target + } + + verifyFile: #VerifyGCS & { + config: TestConfig.gcpConfig + target: deploy.target + url: deploy.url + file: "dirFile.txt" + } + + verifyDir: #VerifyGCS & { + config: TestConfig.gcpConfig + target: deploy.target + url: deploy.url + file: "foo.txt" + } +} diff --git a/stdlib/gcp/gcs/tests/testdata/bar/foo.txt b/stdlib/gcp/gcs/tests/testdata/bar/foo.txt new file mode 100644 index 00000000..616e65a3 --- /dev/null +++ b/stdlib/gcp/gcs/tests/testdata/bar/foo.txt @@ -0,0 +1 @@ +Test recursivity \ No newline at end of file diff --git a/stdlib/gcp/gcs/tests/testdata/dirFile.txt b/stdlib/gcp/gcs/tests/testdata/dirFile.txt new file mode 100644 index 00000000..590f5066 --- /dev/null +++ b/stdlib/gcp/gcs/tests/testdata/dirFile.txt @@ -0,0 +1 @@ +Test directory \ No newline at end of file diff --git a/stdlib/gcp/gcs/tests/verify.cue b/stdlib/gcp/gcs/tests/verify.cue new file mode 100644 index 00000000..4ad06e84 --- /dev/null +++ b/stdlib/gcp/gcs/tests/verify.cue @@ -0,0 +1,89 @@ +package gcs + +import ( + "alpha.dagger.io/alpine" + "alpha.dagger.io/dagger/op" + "alpha.dagger.io/gcp" +) + +#List: { + // GCP Config + config: gcp.#Config + + // Target GCP URL (e.g. gs:////) + target: string + + // URL: dummy URL, used to force a dependency + url: string + + contents: { + string + + #up: [ + op.#Load & { + from: gcp.#GCloud & { + "config": config + } + }, + + op.#Exec & { + args: [ + "/bin/bash", + "--noprofile", + "--norc", + "-eo", + "pipefail", + "-c", + #""" + gsutil ls -r \#(target) > /contents + """#, + ] + env: URL: url + }, + + op.#Export & { + source: "/contents" + format: "string" + }, + ] + } +} + +#VerifyGCS: { + file: string + config: gcp.#Config + target: string + url: string + + lists: #List & { + "config": config + "target": target + "url": url + } + + test: #up: [ + op.#Load & { + from: alpine.#Image & { + package: bash: "~5.1" + } + }, + + op.#WriteFile & { + dest: "/test" + content: lists.contents + }, + + op.#Exec & { + always: true + args: [ + "/bin/bash", + "--noprofile", + "--norc", + "-eo", + "pipefail", + "-c", + "grep -q \(file) /test", + ] + }, + ] +} diff --git a/stdlib/gcp/gke/gke.cue b/stdlib/gcp/gke/gke.cue index 6ded54f0..640fd62e 100644 --- a/stdlib/gcp/gke/gke.cue +++ b/stdlib/gcp/gke/gke.cue @@ -2,8 +2,8 @@ package gke import ( - "dagger.io/dagger/op" - "dagger.io/gcp" + "alpha.dagger.io/dagger/op" + "alpha.dagger.io/gcp" ) // KubeConfig config outputs a valid kube-auth-config for kubectl client diff --git a/stdlib/.dagger/env/google-gke/plan/gke.cue b/stdlib/gcp/gke/tests/gke.cue similarity index 79% rename from stdlib/.dagger/env/google-gke/plan/gke.cue rename to stdlib/gcp/gke/tests/gke.cue index 450f72d0..2f1c6a9e 100644 --- a/stdlib/.dagger/env/google-gke/plan/gke.cue +++ b/stdlib/gcp/gke/tests/gke.cue @@ -1,10 +1,10 @@ package gke import ( - "dagger.io/gcp" - "dagger.io/gcp/gke" - "dagger.io/kubernetes" - "dagger.io/dagger/op" + "alpha.dagger.io/gcp" + "alpha.dagger.io/gcp/gke" + "alpha.dagger.io/kubernetes" + "alpha.dagger.io/dagger/op" ) TestConfig: gcpConfig: gcp.#Config diff --git a/stdlib/git/git.cue b/stdlib/git/git.cue index 8148e144..82d58b5e 100644 --- a/stdlib/git/git.cue +++ b/stdlib/git/git.cue @@ -2,9 +2,9 @@ package git import ( - "dagger.io/dagger" - "dagger.io/dagger/op" - "dagger.io/alpine" + "alpha.dagger.io/dagger" + "alpha.dagger.io/dagger/op" + "alpha.dagger.io/alpine" ) // A git repository diff --git a/stdlib/.dagger/env/git/plan/git.cue b/stdlib/git/tests/git.cue similarity index 90% rename from stdlib/.dagger/env/git/plan/git.cue rename to stdlib/git/tests/git.cue index 67ae3cff..59e65d47 100644 --- a/stdlib/.dagger/env/git/plan/git.cue +++ b/stdlib/git/tests/git.cue @@ -3,10 +3,10 @@ package git import ( "strings" - "dagger.io/git" - "dagger.io/alpine" - "dagger.io/os" - "dagger.io/dagger/op" + "alpha.dagger.io/git" + "alpha.dagger.io/alpine" + "alpha.dagger.io/os" + "alpha.dagger.io/dagger/op" ) repo: git.#Repository & { diff --git a/stdlib/go/go.cue b/stdlib/go/go.cue index f0de9b20..423dd947 100644 --- a/stdlib/go/go.cue +++ b/stdlib/go/go.cue @@ -2,11 +2,11 @@ package go import ( - "dagger.io/dagger" - "dagger.io/dagger/op" - "dagger.io/docker" + "alpha.dagger.io/dagger" + "alpha.dagger.io/dagger/op" + "alpha.dagger.io/docker" - "dagger.io/os" + "alpha.dagger.io/os" ) // A standalone go environment diff --git a/stdlib/.dagger/env/go/plan/go.cue b/stdlib/go/tests/go.cue similarity index 78% rename from stdlib/.dagger/env/go/plan/go.cue rename to stdlib/go/tests/go.cue index dc7ecc0d..705e40b7 100644 --- a/stdlib/.dagger/env/go/plan/go.cue +++ b/stdlib/go/tests/go.cue @@ -1,16 +1,15 @@ package go import ( - "dagger.io/dagger" - "dagger.io/go" - "dagger.io/alpine" - "dagger.io/dagger/op" + "alpha.dagger.io/dagger" + "alpha.dagger.io/alpine" + "alpha.dagger.io/dagger/op" ) TestData: dagger.#Artifact @dagger(input) TestGoBuild: { - build: go.#Build & { + build: #Build & { source: TestData output: "/bin/testbin" } diff --git a/stdlib/go/testdata/go.mod b/stdlib/go/tests/testdata/go.mod similarity index 100% rename from stdlib/go/testdata/go.mod rename to stdlib/go/tests/testdata/go.mod diff --git a/stdlib/go/testdata/main.go b/stdlib/go/tests/testdata/main.go similarity index 100% rename from stdlib/go/testdata/main.go rename to stdlib/go/tests/testdata/main.go diff --git a/stdlib/java/maven/maven.cue b/stdlib/java/maven/maven.cue new file mode 100644 index 00000000..0cdf3cab --- /dev/null +++ b/stdlib/java/maven/maven.cue @@ -0,0 +1,69 @@ +// Maven is a build automation tool for Java +package maven + +import ( + "strings" + + "alpha.dagger.io/dagger" + "alpha.dagger.io/alpine" + "alpha.dagger.io/os" +) + +// A Maven project +#Project: { + + // Application source code + source: dagger.#Artifact @dagger(input) + + // Extra alpine packages to install + package: { + [string]: true | false | string + } @dagger(input) + + // Environment variables + env: { + [string]: string + } @dagger(input) + + phases: [...string] | *["package"] @dagger(input) + goals: [...string] | *[] @dagger(input) + + // Optional arguments for the script + args: [...string] | *[] @dagger(input) + + // Build output directory + build: os.#Dir & { + from: ctr + path: "/build" + } @dagger(output) + + ctr: os.#Container & { + image: alpine.#Image & { + "package": package & { + bash: "=~5.1" + openjdk11: "=~11.0.9" + maven: "=~3.6.3" + } + } + shell: path: "/bin/bash" + command: """ + opts=( $(echo $MAVEN_ARGS) ) + mvn $MAVEN_GOALS $MAVEN_PHASES ${opts[@]} + result=$? + modules=$(mvn -Dexec.executable='pwd' -Dexec.args='${project.artifactId}' exec:exec -q) + for module in $modules;do + source=$(echo "$module/target" | tr -s /) + target=$(echo "/build/$module" | tr -s /) + mkdir -p $target;cp -a $source $target 2>/dev/null || : + done + exit $result + """ + "env": env & { + MAVEN_ARGS: strings.Join(args, "\n") + MAVEN_PHASES: strings.Join(phases, "\n") + MAVEN_GOALS: strings.Join(goals, "\n") + } + dir: "/" + copy: "/": from: source + } +} diff --git a/stdlib/java/maven/tests/maven.cue b/stdlib/java/maven/tests/maven.cue new file mode 100644 index 00000000..39bbb411 --- /dev/null +++ b/stdlib/java/maven/tests/maven.cue @@ -0,0 +1,43 @@ +package maven + +import ( + "strings" + + "alpha.dagger.io/dagger" + "alpha.dagger.io/alpine" + "alpha.dagger.io/os" +) + +TestData: dagger.#Artifact + +TestConfig: mavenOpts: strings.Join([ + "-client", + "-XX:+TieredCompilation", + "-XX:TieredStopAtLevel=1", + "-Xverify:none", + "-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -Dorg.slf4j.simpleLogger.showDateTime=true", + "-Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss", +], " ") + +TestSpringBoot: { + project: #Project & { + source: TestData + + phases: ["install"] + + env: MAVEN_OPTS: TestConfig.mavenOpts + + args: ["--batch-mode"] + } + + test: os.#Container & { + image: alpine.#Image & { + package: bash: "=5.1.0-r0" + } + copy: "/build": from: project.build + command: """ + count=$(ls -1 /build/**/*.jar 2>/dev/null | wc -l) + test "$count" != "0" + """ + } +} diff --git a/stdlib/java/maven/tests/testdata/.gitignore b/stdlib/java/maven/tests/testdata/.gitignore new file mode 100644 index 00000000..549e00a2 --- /dev/null +++ b/stdlib/java/maven/tests/testdata/.gitignore @@ -0,0 +1,33 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ diff --git a/stdlib/java/maven/tests/testdata/pom.xml b/stdlib/java/maven/tests/testdata/pom.xml new file mode 100644 index 00000000..a4516bed --- /dev/null +++ b/stdlib/java/maven/tests/testdata/pom.xml @@ -0,0 +1,41 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 2.5.2 + + + io.dagger.maven + spring-boot-test + 0.0.1-SNAPSHOT + spring-boot-test + Dagger maven spring boot test + + 11 + + + + org.springframework.boot + spring-boot-starter + + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + diff --git a/stdlib/java/maven/tests/testdata/src/main/java/io/dagger/maven/springboottest/SpringBootTestApplication.java b/stdlib/java/maven/tests/testdata/src/main/java/io/dagger/maven/springboottest/SpringBootTestApplication.java new file mode 100644 index 00000000..68b09e3e --- /dev/null +++ b/stdlib/java/maven/tests/testdata/src/main/java/io/dagger/maven/springboottest/SpringBootTestApplication.java @@ -0,0 +1,13 @@ +package io.dagger.maven.springboottest; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class SpringBootTestApplication { + + public static void main(String[] args) { + SpringApplication.run(SpringBootTestApplication.class, args); + } + +} diff --git a/stdlib/java/maven/tests/testdata/src/main/resources/application.properties b/stdlib/java/maven/tests/testdata/src/main/resources/application.properties new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/stdlib/java/maven/tests/testdata/src/main/resources/application.properties @@ -0,0 +1 @@ + diff --git a/stdlib/java/maven/tests/testdata/src/test/java/io/dagger/maven/springboottest/SpringBootTestApplicationTests.java b/stdlib/java/maven/tests/testdata/src/test/java/io/dagger/maven/springboottest/SpringBootTestApplicationTests.java new file mode 100644 index 00000000..6419b115 --- /dev/null +++ b/stdlib/java/maven/tests/testdata/src/test/java/io/dagger/maven/springboottest/SpringBootTestApplicationTests.java @@ -0,0 +1,13 @@ +package io.dagger.maven.springboottest; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class SpringBootTestApplicationTests { + + @Test + void contextLoads() { + } + +} diff --git a/stdlib/js/yarn/testdata/package.json b/stdlib/js/yarn/tests/testdata/package.json similarity index 100% rename from stdlib/js/yarn/testdata/package.json rename to stdlib/js/yarn/tests/testdata/package.json diff --git a/stdlib/.dagger/env/js-yarn/plan/yarn.cue b/stdlib/js/yarn/tests/yarn.cue similarity index 69% rename from stdlib/.dagger/env/js-yarn/plan/yarn.cue rename to stdlib/js/yarn/tests/yarn.cue index 15539e9e..6f52cb8b 100644 --- a/stdlib/.dagger/env/js-yarn/plan/yarn.cue +++ b/stdlib/js/yarn/tests/yarn.cue @@ -1,16 +1,15 @@ -package react +package yarn import ( - "dagger.io/dagger" - "dagger.io/js/yarn" - "dagger.io/alpine" - "dagger.io/os" + "alpha.dagger.io/dagger" + "alpha.dagger.io/alpine" + "alpha.dagger.io/os" ) TestData: dagger.#Artifact TestReact: { - pkg: yarn.#Package & { + pkg: #Package & { source: TestData } diff --git a/stdlib/js/yarn/yarn.cue b/stdlib/js/yarn/yarn.cue index f9471215..7f90dbd3 100644 --- a/stdlib/js/yarn/yarn.cue +++ b/stdlib/js/yarn/yarn.cue @@ -4,9 +4,9 @@ package yarn import ( "strings" - "dagger.io/dagger" - "dagger.io/alpine" - "dagger.io/os" + "alpha.dagger.io/dagger" + "alpha.dagger.io/alpine" + "alpha.dagger.io/os" ) // A Yarn package diff --git a/stdlib/kubernetes/helm/helm.cue b/stdlib/kubernetes/helm/helm.cue index 0544ef92..bf0bca88 100644 --- a/stdlib/kubernetes/helm/helm.cue +++ b/stdlib/kubernetes/helm/helm.cue @@ -4,9 +4,9 @@ package helm import ( "strconv" - "dagger.io/dagger" - "dagger.io/dagger/op" - "dagger.io/kubernetes" + "alpha.dagger.io/dagger" + "alpha.dagger.io/dagger/op" + "alpha.dagger.io/kubernetes" ) // Install a Helm chart diff --git a/stdlib/.dagger/env/kubernetes-helm/plan/helm.cue b/stdlib/kubernetes/helm/tests/helm.cue similarity index 81% rename from stdlib/.dagger/env/kubernetes-helm/plan/helm.cue rename to stdlib/kubernetes/helm/tests/helm.cue index ab06eb13..b72dc007 100644 --- a/stdlib/.dagger/env/kubernetes-helm/plan/helm.cue +++ b/stdlib/kubernetes/helm/tests/helm.cue @@ -1,9 +1,8 @@ -package main +package helm import ( - "dagger.io/kubernetes/helm" - "dagger.io/random" - "dagger.io/dagger" + "alpha.dagger.io/random" + "alpha.dagger.io/dagger" ) // We assume that a kinD cluster is running locally @@ -15,12 +14,13 @@ TestChartSource: dagger.#Artifact @dagger(input) // Deploy user local chart TestHelmSimpleChart: { suffix: random.#String & { - seed: "simple" + seed: "simple" + length: 5 } // Deploy chart - deploy: helm.#Chart & { - name: "dagger-test-inline-chart-\(suffix.out)" + deploy: #Chart & { + name: "dagger-test-inline-\(suffix.out)" namespace: "dagger-test" kubeconfig: TestKubeconfig chartSource: TestChartSource @@ -36,11 +36,12 @@ TestHelmSimpleChart: { // Deploy remote chart TestHelmRepoChart: { suffix: random.#String & { - seed: "repo" + seed: "repo" + length: 5 } // Deploy remote chart - deploy: helm.#Chart & { + deploy: #Chart & { name: "dagger-test-repository-\(suffix.out)" namespace: "dagger-test" kubeconfig: TestKubeconfig diff --git a/stdlib/kubernetes/helm/testdata/mychart/.helmignore b/stdlib/kubernetes/helm/tests/testdata/mychart/.helmignore similarity index 100% rename from stdlib/kubernetes/helm/testdata/mychart/.helmignore rename to stdlib/kubernetes/helm/tests/testdata/mychart/.helmignore diff --git a/stdlib/kubernetes/helm/testdata/mychart/Chart.yaml b/stdlib/kubernetes/helm/tests/testdata/mychart/Chart.yaml similarity index 100% rename from stdlib/kubernetes/helm/testdata/mychart/Chart.yaml rename to stdlib/kubernetes/helm/tests/testdata/mychart/Chart.yaml diff --git a/stdlib/kubernetes/helm/testdata/mychart/templates/NOTES.txt b/stdlib/kubernetes/helm/tests/testdata/mychart/templates/NOTES.txt similarity index 100% rename from stdlib/kubernetes/helm/testdata/mychart/templates/NOTES.txt rename to stdlib/kubernetes/helm/tests/testdata/mychart/templates/NOTES.txt diff --git a/stdlib/kubernetes/helm/testdata/mychart/templates/_helpers.tpl b/stdlib/kubernetes/helm/tests/testdata/mychart/templates/_helpers.tpl similarity index 100% rename from stdlib/kubernetes/helm/testdata/mychart/templates/_helpers.tpl rename to stdlib/kubernetes/helm/tests/testdata/mychart/templates/_helpers.tpl diff --git a/stdlib/kubernetes/helm/testdata/mychart/templates/deployment.yaml b/stdlib/kubernetes/helm/tests/testdata/mychart/templates/deployment.yaml similarity index 100% rename from stdlib/kubernetes/helm/testdata/mychart/templates/deployment.yaml rename to stdlib/kubernetes/helm/tests/testdata/mychart/templates/deployment.yaml diff --git a/stdlib/kubernetes/helm/testdata/mychart/templates/ingress.yaml b/stdlib/kubernetes/helm/tests/testdata/mychart/templates/ingress.yaml similarity index 100% rename from stdlib/kubernetes/helm/testdata/mychart/templates/ingress.yaml rename to stdlib/kubernetes/helm/tests/testdata/mychart/templates/ingress.yaml diff --git a/stdlib/kubernetes/helm/testdata/mychart/templates/service.yaml b/stdlib/kubernetes/helm/tests/testdata/mychart/templates/service.yaml similarity index 100% rename from stdlib/kubernetes/helm/testdata/mychart/templates/service.yaml rename to stdlib/kubernetes/helm/tests/testdata/mychart/templates/service.yaml diff --git a/stdlib/kubernetes/helm/testdata/mychart/templates/serviceaccount.yaml b/stdlib/kubernetes/helm/tests/testdata/mychart/templates/serviceaccount.yaml similarity index 100% rename from stdlib/kubernetes/helm/testdata/mychart/templates/serviceaccount.yaml rename to stdlib/kubernetes/helm/tests/testdata/mychart/templates/serviceaccount.yaml diff --git a/stdlib/kubernetes/helm/testdata/mychart/templates/tests/test-connection.yaml b/stdlib/kubernetes/helm/tests/testdata/mychart/templates/tests/test-connection.yaml similarity index 100% rename from stdlib/kubernetes/helm/testdata/mychart/templates/tests/test-connection.yaml rename to stdlib/kubernetes/helm/tests/testdata/mychart/templates/tests/test-connection.yaml diff --git a/stdlib/kubernetes/helm/testdata/mychart/values.yaml b/stdlib/kubernetes/helm/tests/testdata/mychart/values.yaml similarity index 100% rename from stdlib/kubernetes/helm/testdata/mychart/values.yaml rename to stdlib/kubernetes/helm/tests/testdata/mychart/values.yaml diff --git a/stdlib/.dagger/env/kubernetes-helm/plan/verify.cue b/stdlib/kubernetes/helm/tests/verify.cue similarity index 90% rename from stdlib/.dagger/env/kubernetes-helm/plan/verify.cue rename to stdlib/kubernetes/helm/tests/verify.cue index 581c1121..f932dbff 100644 --- a/stdlib/.dagger/env/kubernetes-helm/plan/verify.cue +++ b/stdlib/kubernetes/helm/tests/verify.cue @@ -1,8 +1,8 @@ -package main +package helm import ( - "dagger.io/dagger/op" - "dagger.io/kubernetes" + "alpha.dagger.io/dagger/op" + "alpha.dagger.io/kubernetes" ) #VerifyHelm: { diff --git a/stdlib/kubernetes/kubernetes.cue b/stdlib/kubernetes/kubernetes.cue index 1a6a902c..f98838ab 100644 --- a/stdlib/kubernetes/kubernetes.cue +++ b/stdlib/kubernetes/kubernetes.cue @@ -2,9 +2,9 @@ package kubernetes import ( - "dagger.io/dagger/op" - "dagger.io/dagger" - "dagger.io/alpine" + "alpha.dagger.io/dagger/op" + "alpha.dagger.io/dagger" + "alpha.dagger.io/alpine" ) // Kubectl client diff --git a/stdlib/kubernetes/kustomize/kustomization.cue b/stdlib/kubernetes/kustomize/kustomization.cue index 4a8b323d..60cf3dd7 100644 --- a/stdlib/kubernetes/kustomize/kustomization.cue +++ b/stdlib/kubernetes/kustomize/kustomization.cue @@ -2,9 +2,9 @@ package kustomize import ( - "dagger.io/dagger/op" - "dagger.io/dagger" - "dagger.io/alpine" + "alpha.dagger.io/dagger/op" + "alpha.dagger.io/dagger" + "alpha.dagger.io/alpine" ) #Kustomization: { diff --git a/stdlib/.dagger/env/kubernetes-kustomize/plan/kustomize.cue b/stdlib/kubernetes/kustomize/tests/kustomize.cue similarity index 80% rename from stdlib/.dagger/env/kubernetes-kustomize/plan/kustomize.cue rename to stdlib/kubernetes/kustomize/tests/kustomize.cue index 2ebe0682..f1f204be 100644 --- a/stdlib/.dagger/env/kubernetes-kustomize/plan/kustomize.cue +++ b/stdlib/kubernetes/kustomize/tests/kustomize.cue @@ -1,16 +1,15 @@ -package main +package kustomize import ( "encoding/yaml" - "dagger.io/dagger" - "dagger.io/kubernetes/kustomize" + "alpha.dagger.io/dagger" ) TestKustomize: { testdata: dagger.#Artifact // Run Kustomize - kustom: kustomize.#Kustomize & { + kustom: #Kustomize & { source: testdata kustomization: yaml.Marshal({ resources: ["deployment.yaml", "pod.yaml"] diff --git a/stdlib/kubernetes/kustomize/testdata/deployment.yaml b/stdlib/kubernetes/kustomize/tests/testdata/deployment.yaml similarity index 100% rename from stdlib/kubernetes/kustomize/testdata/deployment.yaml rename to stdlib/kubernetes/kustomize/tests/testdata/deployment.yaml diff --git a/stdlib/kubernetes/kustomize/testdata/pod.yaml b/stdlib/kubernetes/kustomize/tests/testdata/pod.yaml similarity index 100% rename from stdlib/kubernetes/kustomize/testdata/pod.yaml rename to stdlib/kubernetes/kustomize/tests/testdata/pod.yaml diff --git a/stdlib/.dagger/env/kubernetes-kustomize/plan/verify.cue b/stdlib/kubernetes/kustomize/tests/verify.cue similarity index 91% rename from stdlib/.dagger/env/kubernetes-kustomize/plan/verify.cue rename to stdlib/kubernetes/kustomize/tests/verify.cue index 48075413..3ef6f8db 100644 --- a/stdlib/.dagger/env/kubernetes-kustomize/plan/verify.cue +++ b/stdlib/kubernetes/kustomize/tests/verify.cue @@ -1,9 +1,9 @@ -package main +package kustomize import ( - "dagger.io/dagger/op" - "dagger.io/dagger" - "dagger.io/alpine" + "alpha.dagger.io/dagger/op" + "alpha.dagger.io/dagger" + "alpha.dagger.io/alpine" ) #VerifyKustomize: { diff --git a/stdlib/.dagger/env/kubernetes-deployment/plan/kubernetes.cue b/stdlib/kubernetes/tests/kubernetes.cue similarity index 89% rename from stdlib/.dagger/env/kubernetes-deployment/plan/kubernetes.cue rename to stdlib/kubernetes/tests/kubernetes.cue index 35f7caee..ac6bf8ff 100644 --- a/stdlib/.dagger/env/kubernetes-deployment/plan/kubernetes.cue +++ b/stdlib/kubernetes/tests/kubernetes.cue @@ -1,9 +1,8 @@ -package main +package kubernetes import ( "encoding/yaml" - "dagger.io/kubernetes" - "dagger.io/random" + "alpha.dagger.io/random" ) // We assume that a kinD cluster is running locally @@ -30,7 +29,7 @@ TestKubeApply: { } // Apply deployment - apply: kubernetes.#Resources & { + apply: #Resources & { kubeconfig: TestKubeconfig namespace: "dagger-test" manifest: yaml.Marshal(kubeSrc) diff --git a/stdlib/.dagger/env/kubernetes-deployment/plan/verify.cue b/stdlib/kubernetes/tests/verify.cue similarity index 92% rename from stdlib/.dagger/env/kubernetes-deployment/plan/verify.cue rename to stdlib/kubernetes/tests/verify.cue index 0150b5f3..c0cd3bd4 100644 --- a/stdlib/.dagger/env/kubernetes-deployment/plan/verify.cue +++ b/stdlib/kubernetes/tests/verify.cue @@ -1,8 +1,7 @@ -package main +package kubernetes import ( - "dagger.io/dagger/op" - "dagger.io/kubernetes" + "alpha.dagger.io/dagger/op" ) #VerifyApply: { @@ -24,7 +23,7 @@ import ( #up: [ op.#Load & { - from: kubernetes.#Kubectl + from: #Kubectl }, op.#WriteFile & { diff --git a/stdlib/netlify/netlify.cue b/stdlib/netlify/netlify.cue index 3710a225..7abeff03 100644 --- a/stdlib/netlify/netlify.cue +++ b/stdlib/netlify/netlify.cue @@ -2,9 +2,9 @@ package netlify import ( - "dagger.io/dagger" - "dagger.io/alpine" - "dagger.io/os" + "alpha.dagger.io/dagger" + "alpha.dagger.io/alpine" + "alpha.dagger.io/os" ) // Netlify account credentials @@ -40,7 +40,7 @@ import ( from: ctr path: "/netlify/url" } - }.read.data @dagger(output) + }.contents @dagger(output) // Unique Deploy URL deployUrl: { @@ -48,7 +48,7 @@ import ( from: ctr path: "/netlify/deployUrl" } - }.read.data @dagger(output) + }.contents @dagger(output) // Logs URL for this deployment logsUrl: { @@ -56,7 +56,7 @@ import ( from: ctr path: "/netlify/logsUrl" } - }.read.data @dagger(output) + }.contents @dagger(output) ctr: os.#Container & { image: alpine.#Image & { @@ -68,7 +68,7 @@ import ( } } setup: [ - "yarn global add netlify-cli@2.47.0", + "yarn global add netlify-cli@3.38.10", ] // set in netlify.sh.cue // FIXME: use embedding once cue supports it @@ -84,7 +84,7 @@ import ( NETLIFY_ACCOUNT: account.name } dir: "/src" - mount: "/src": from: contents - mount: "/run/secrets/token": secret: account.token + mount: "/src": from: contents + secret: "/run/secrets/token": account.token } } diff --git a/stdlib/netlify/netlify.sh.cue b/stdlib/netlify/netlify.sh.cue index 932bdc67..428a60fd 100644 --- a/stdlib/netlify/netlify.sh.cue +++ b/stdlib/netlify/netlify.sh.cue @@ -6,16 +6,17 @@ package netlify create_site() { url="https://api.netlify.com/api/v1/${NETLIFY_ACCOUNT:-}/sites" - response=$(curl -s -S -f -H "Authorization: Bearer $NETLIFY_AUTH_TOKEN" \ + response=$(curl -s -S --fail-with-body -H "Authorization: Bearer $NETLIFY_AUTH_TOKEN" \ -X POST -H "Content-Type: application/json" \ $url \ - -d "{\"name\": \"${NETLIFY_SITE_NAME}\", \"custom_domain\": \"${NETLIFY_DOMAIN}\"}" + -d "{\"name\": \"${NETLIFY_SITE_NAME}\", \"custom_domain\": \"${NETLIFY_DOMAIN}\"}" -o body ) if [ $? -ne 0 ]; then + cat body >&2 exit 1 fi - echo $response | jq -r '.site_id' + cat body | jq -r '.site_id' } site_id=$(curl -s -S -f -H "Authorization: Bearer $NETLIFY_AUTH_TOKEN" \ @@ -33,6 +34,10 @@ package netlify exit 1 fi fi + + netlify link --id "$site_id" + netlify build + netlify deploy \ --dir="$(pwd)" \ --site="$site_id" \ @@ -48,5 +53,4 @@ package netlify printf "$url" > /netlify/url printf "$deployUrl" > /netlify/deployUrl printf "$logsUrl" > /netlify/logsUrl - """# diff --git a/stdlib/.dagger/env/netlify/plan/netlify.cue b/stdlib/netlify/tests/netlify.cue similarity index 84% rename from stdlib/.dagger/env/netlify/plan/netlify.cue rename to stdlib/netlify/tests/netlify.cue index 68b35b9c..5a0f3187 100644 --- a/stdlib/.dagger/env/netlify/plan/netlify.cue +++ b/stdlib/netlify/tests/netlify.cue @@ -1,10 +1,9 @@ -package main +package netlify import ( - "dagger.io/dagger/op" - "dagger.io/alpine" - "dagger.io/netlify" - "dagger.io/random" + "alpha.dagger.io/dagger/op" + "alpha.dagger.io/alpine" + "alpha.dagger.io/random" ) TestNetlify: { @@ -21,7 +20,7 @@ TestNetlify: { ] // Deploy to netlify - deploy: netlify.#Site & { + deploy: #Site & { contents: html name: "dagger-test" } diff --git a/stdlib/os/container.cue b/stdlib/os/container.cue index 2f06aff0..ede2ccbc 100644 --- a/stdlib/os/container.cue +++ b/stdlib/os/container.cue @@ -3,10 +3,10 @@ package os import ( "strings" - "dagger.io/dagger" - "dagger.io/dagger/op" + "alpha.dagger.io/dagger" + "alpha.dagger.io/dagger/op" - "dagger.io/alpine" + "alpha.dagger.io/alpine" ) // Default image for basic use cases @@ -48,14 +48,14 @@ import ( // Mount contents from other artifacts. // Mount is active when executing `command`, but not `setup`. - mount: [string]: { from: dagger.#Artifact // FIXME: support source path - } | { - secret: dagger.#Secret } + // Safely mount secrets (in cleartext) as non-persistent files + secret: [string]: dagger.#Secret + // Mount persistent cache directories cache: [string]: true @@ -113,6 +113,9 @@ import ( "\(dest)": o // FIXME: support source path } + for dest, s in secret { + "\(dest)": secret: s + } for dest, _ in cache { "\(dest)": "cache" } diff --git a/stdlib/os/dir.cue b/stdlib/os/dir.cue index ed47aaa4..c5afe16b 100644 --- a/stdlib/os/dir.cue +++ b/stdlib/os/dir.cue @@ -1,8 +1,8 @@ package os import ( - "dagger.io/dagger" - "dagger.io/dagger/op" + "alpha.dagger.io/dagger" + "alpha.dagger.io/dagger/op" ) #Dir: { diff --git a/stdlib/os/file.cue b/stdlib/os/file.cue index b484374f..6a4fb49e 100644 --- a/stdlib/os/file.cue +++ b/stdlib/os/file.cue @@ -1,35 +1,42 @@ +// OS operations package os import ( - "dagger.io/dagger" - "dagger.io/dagger/op" + "alpha.dagger.io/dagger" + "alpha.dagger.io/dagger/op" ) // Built-in file implementation, using buildkit +// A single file #File: { - from: dagger.#Artifact + from: dagger.#Artifact | *[op.#Mkdir & {dir: "/", path: "/"}] path: string - read: { - // FIXME: support different data schemas for different formats - format: "string" - data: { - string - #up: [ - op.#Load & {"from": from}, - op.#Export & {source: path, "format": format}, - ] - } + // Optionally write data to the file + write: *null | { + data: string + // FIXME: append + // FIXME: create + mode } - write: *null | { - // FIXME: support encoding in different formats - data: string + // The contents of the file + // If a write operation is specified, it is applied first. + contents: { + string + #up: [ - op.#Load & {"from": from}, - op.#WriteFile & { - dest: path - contents: data + op.#Load & { + "from": from + }, + if write != null { + op.#WriteFile & { + dest: path + content: write.data + } + }, + op.#Export & { + source: path + format: "string" }, ] } diff --git a/stdlib/os/tests/container/container.cue b/stdlib/os/tests/container/container.cue new file mode 100644 index 00000000..df837179 --- /dev/null +++ b/stdlib/os/tests/container/container.cue @@ -0,0 +1,26 @@ +package os + +import ( + "alpha.dagger.io/dagger" +) + +// Test secret mount +SimpleSecret: { + // 'encrypted' and 'cleartext' must be set from identical values + encrypted: dagger.#Secret @dagger(input) + cleartext: string @dagger(input) + + ctr: #Container & { + secret: "/secret-in": encrypted + command: "cat /secret-in > /secret-out" + } + + // Decrypted secret + decrypted: (#File & { + from: ctr + path: "/secret-out" + }).contents @dagger(output) + + // Assertion: decrypted value must match original cleartext + decrypted: cleartext +} diff --git a/stdlib/os/tests/os/os.cue b/stdlib/os/tests/os/os.cue new file mode 100644 index 00000000..8cf5713f --- /dev/null +++ b/stdlib/os/tests/os/os.cue @@ -0,0 +1,25 @@ +package os + +import ( + "alpha.dagger.io/alpine" +) + +// Write a file to an empty dir +EmptyDir: { + f: #File & { + path: "/foo.txt" + write: data: "hello world!" + } + f: contents: "hello world!" +} + +// Read from a pre-existing file +Read: { + f: #File & { + from: alpine.#Image & { + version: "3.13.4" + } + path: "/etc/alpine-release" + } + f: contents: "3.13.4\n" +} diff --git a/stdlib/random/string.cue b/stdlib/random/string.cue index a15891e1..e84d809f 100644 --- a/stdlib/random/string.cue +++ b/stdlib/random/string.cue @@ -4,8 +4,8 @@ package random import ( "strconv" - "dagger.io/alpine" - "dagger.io/dagger/op" + "alpha.dagger.io/alpine" + "alpha.dagger.io/dagger/op" ) // Generate a random string diff --git a/stdlib/stdlib.go b/stdlib/stdlib.go index 48aa9907..b2ac9019 100644 --- a/stdlib/stdlib.go +++ b/stdlib/stdlib.go @@ -10,6 +10,6 @@ var ( //go:embed **/*.cue **/*/*.cue FS embed.FS - PackageName = "dagger.io" + PackageName = "alpha.dagger.io" Path = path.Join("cue.mod", "pkg", PackageName) ) diff --git a/stdlib/terraform/terraform.cue b/stdlib/terraform/terraform.cue index 703a7113..1e6ab939 100644 --- a/stdlib/terraform/terraform.cue +++ b/stdlib/terraform/terraform.cue @@ -4,8 +4,8 @@ package terraform import ( "encoding/json" - "dagger.io/dagger" - "dagger.io/dagger/op" + "alpha.dagger.io/dagger" + "alpha.dagger.io/dagger/op" ) // Terraform configuration diff --git a/stdlib/.dagger/env/terraform/plan/terraform.cue b/stdlib/terraform/tests/terraform.cue similarity index 91% rename from stdlib/.dagger/env/terraform/plan/terraform.cue rename to stdlib/terraform/tests/terraform.cue index e34ea405..c67c9527 100644 --- a/stdlib/.dagger/env/terraform/plan/terraform.cue +++ b/stdlib/terraform/tests/terraform.cue @@ -1,10 +1,9 @@ package terraform import ( - "dagger.io/dagger" - "dagger.io/dagger/op" - "dagger.io/alpine" - "dagger.io/terraform" + "alpha.dagger.io/dagger" + "alpha.dagger.io/dagger/op" + "alpha.dagger.io/alpine" ) TestData: dagger.#Artifact @dagger(input) @@ -62,7 +61,7 @@ TestTerraform: { secretKey: TestConfig.awsConfig.secretKey } - apply: terraform.#Configuration & { + apply: #Configuration & { source: TestData env: { AWS_ACCESS_KEY_ID: config.visibleAccessKey diff --git a/stdlib/terraform/testdata/test.tf b/stdlib/terraform/tests/testdata/test.tf similarity index 100% rename from stdlib/terraform/testdata/test.tf rename to stdlib/terraform/tests/testdata/test.tf diff --git a/stdlib/universe.bats b/stdlib/universe.bats index 24397938..dc47f641 100644 --- a/stdlib/universe.bats +++ b/stdlib/universe.bats @@ -4,6 +4,15 @@ setup() { common_setup } +@test "cue-sanity-check" { + dagger -e sanity-check up +} + + +@test "os" { + dagger -e os up +} + @test "go" { dagger -e go up } @@ -12,6 +21,10 @@ setup() { dagger -e js-yarn up } +@test "java/maven" { + dagger -e java-maven up +} + @test "alpine" { dagger -e alpine up } @@ -24,6 +37,10 @@ setup() { dagger -e git up } +@test "os.#Container" { + dagger -e os-container up +} + @test "aws: ecr" { dagger -e aws-ecr up } @@ -37,7 +54,8 @@ setup() { } @test "docker run: local" { - dagger -e docker-run-local up + skip "Not implemented yet + missing inputs leading to failure" + # dagger -e docker-run-local up } @test "docker build" { @@ -57,6 +75,10 @@ setup() { assert_failure } +@test "docker compose" { + dagger -e docker-compose up +} + @test "docker run: ssh" { dagger -e docker-run-ssh up } @@ -65,7 +87,7 @@ setup() { skip_unless_local_kube # Copy deployment to sandbox - copy_to_sandbox kubernetes-deployment + copy_to_sandbox kubernetes-deployment kubernetes # Set kubeconfig dagger -w "$DAGGER_SANDBOX" -e kubernetes-deployment input text TestKubeconfig -f "$HOME"/.kube/config @@ -99,6 +121,10 @@ setup() { dagger -e google-gcr up } +@test "google cloud: gcs" { + dagger -e google-gcs up +} + @test "google cloud: gke" { dagger -e google-gke up } diff --git a/tests/cli.bats b/tests/cli.bats index 8fcc086e..044377fa 100644 --- a/tests/cli.bats +++ b/tests/cli.bats @@ -69,8 +69,8 @@ setup() { ln -s "$TESTDIR"/cli/packages "$DAGGER_WORKSPACE"/plan - "$DAGGER" new "a" --module "$DAGGER_WORKSPACE"/plan --package dagger.io/test/a - "$DAGGER" new "b" --module "$DAGGER_WORKSPACE"/plan --package dagger.io/test/b + "$DAGGER" new "a" --module "$DAGGER_WORKSPACE"/plan --package alpha.dagger.io/test/a + "$DAGGER" new "b" --module "$DAGGER_WORKSPACE"/plan --package alpha.dagger.io/test/b "$DAGGER" up -e "a" "$DAGGER" up -e "b" diff --git a/tests/cli/input/artifact/main.cue b/tests/cli/input/artifact/main.cue index aa8f8737..e9423a0a 100644 --- a/tests/cli/input/artifact/main.cue +++ b/tests/cli/input/artifact/main.cue @@ -1,8 +1,8 @@ package testing import ( - "dagger.io/dagger/op" - "dagger.io/dagger" + "alpha.dagger.io/dagger/op" + "alpha.dagger.io/dagger" ) source: dagger.#Artifact diff --git a/tests/cli/input/ignore/main.cue b/tests/cli/input/ignore/main.cue index 8cd23563..f08eb7d7 100644 --- a/tests/cli/input/ignore/main.cue +++ b/tests/cli/input/ignore/main.cue @@ -1,8 +1,8 @@ package testing import ( - "dagger.io/dagger/op" - "dagger.io/dagger" + "alpha.dagger.io/dagger/op" + "alpha.dagger.io/dagger" ) source: dagger.#Artifact diff --git a/tests/cli/input/list/main.cue b/tests/cli/input/list/main.cue index 794c07be..01ec455c 100644 --- a/tests/cli/input/list/main.cue +++ b/tests/cli/input/list/main.cue @@ -1,8 +1,8 @@ package main import ( - "dagger.io/dagger" - "dagger.io/aws" + "alpha.dagger.io/dagger" + "alpha.dagger.io/aws" ) awsConfig: aws.#Config & { diff --git a/tests/cli/output/list/main.cue b/tests/cli/output/list/main.cue index a19ae14d..95cabedc 100644 --- a/tests/cli/output/list/main.cue +++ b/tests/cli/output/list/main.cue @@ -1,7 +1,7 @@ package main import ( - "dagger.io/dagger" + "alpha.dagger.io/dagger" ) #A: { diff --git a/tests/cli/packages/a/main.cue b/tests/cli/packages/a/main.cue index 665d2d5e..01440d18 100644 --- a/tests/cli/packages/a/main.cue +++ b/tests/cli/packages/a/main.cue @@ -1,6 +1,6 @@ package a -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" exp: { string diff --git a/tests/cli/packages/b/main.cue b/tests/cli/packages/b/main.cue index a0e5806b..a8c337ff 100644 --- a/tests/cli/packages/b/main.cue +++ b/tests/cli/packages/b/main.cue @@ -1,6 +1,6 @@ package b -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" exp: { string diff --git a/tests/cli/packages/cue.mod/module.cue b/tests/cli/packages/cue.mod/module.cue index 8f2d4fdb..c0728a77 100644 --- a/tests/cli/packages/cue.mod/module.cue +++ b/tests/cli/packages/cue.mod/module.cue @@ -1 +1 @@ -module: "dagger.io/test" +module: "alpha.dagger.io/test" diff --git a/tests/cli/simple/main.cue b/tests/cli/simple/main.cue index 42621fef..672beced 100644 --- a/tests/cli/simple/main.cue +++ b/tests/cli/simple/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" foo: "value" bar: "another value" diff --git a/tests/compute.bats b/tests/compute.bats deleted file mode 100644 index e5e70826..00000000 --- a/tests/compute.bats +++ /dev/null @@ -1,116 +0,0 @@ -setup() { - load 'helpers' - - common_setup -} - -@test "compute: simple" { - run "$DAGGER" compute "$TESTDIR"/compute/invalid/string - assert_failure - - run "$DAGGER" compute "$TESTDIR"/compute/invalid/bool - assert_failure - - run "$DAGGER" compute "$TESTDIR"/compute/invalid/int - assert_failure - - run "$DAGGER" compute "$TESTDIR"/compute/invalid/struct - assert_failure - - run "$DAGGER" compute "$TESTDIR"/compute/success/noop - assert_success - assert_line '{"empty":{}}' - - run "$DAGGER" compute "$TESTDIR"/compute/success/simple - assert_success - assert_line '{}' - - run "$DAGGER" compute "$TESTDIR"/compute/success/overload/flat - assert_success - - run "$DAGGER" compute "$TESTDIR"/compute/success/overload/wrapped - assert_success - - run "$DAGGER" compute "$TESTDIR"/compute/success/exec-nocache - assert_success -} - -@test "compute: dependencies" { - run "$DAGGER" compute "$TESTDIR"/compute/dependencies/simple - assert_success - assert_line '{"A":{"result":"from A"},"B":{"result":"dependency from A"}}' - - run "$DAGGER" compute "$TESTDIR"/compute/dependencies/interpolation - assert_success - assert_line '{"A":{"result":"from A"},"B":{"result":"dependency from A"}}' - - run "$DAGGER" compute "$TESTDIR"/compute/dependencies/unmarshal - assert_success - assert_line '{"A":"{\"hello\": \"world\"}\n","B":{"result":"unmarshalled.hello=world"},"unmarshalled":{"hello":"world"}}' -} - -@test "compute: inputs" { - run "$DAGGER" compute "$TESTDIR"/compute/input/simple - assert_success - assert_line '{}' - - run "$DAGGER" compute --input-string 'in=foobar' "$TESTDIR"/compute/input/simple - assert_success - assert_line '{"in":"foobar","test":"received: foobar"}' - - run "$DAGGER" compute "$TESTDIR"/compute/input/default - assert_success - assert_line '{"in":"default input","test":"received: default input"}' - - run "$DAGGER" compute --input-string 'in=foobar' "$TESTDIR"/compute/input/default - assert_success - assert_line '{"in":"foobar","test":"received: foobar"}' - - run "$DAGGER" compute --input-string=foobar "$TESTDIR"/compute/input/default - assert_failure - assert_output --partial 'failed to parse input: input-string' - - run "$DAGGER" compute --input-dir=foobar "$TESTDIR"/compute/input/default - assert_failure - assert_output --partial 'failed to parse input: input-dir' - - run "$DAGGER" compute --input-git=foobar "$TESTDIR"/compute/input/default - assert_failure - assert_output --partial 'failed to parse input: input-git' -} - -@test "compute: secrets" { - # secrets used as environment variables must fail - run "$DAGGER" compute "$TESTDIR"/compute/secrets/invalid/env - assert_failure - assert_line --partial "conflicting values" - - # strings passed as secrets must fail - run "$DAGGER" compute "$TESTDIR"/compute/secrets/invalid/string - assert_failure - - # Setting a text input for a secret value should fail - run "$DAGGER" compute --input-string 'mySecret=SecretValue' "$TESTDIR"/compute/secrets/simple - assert_failure - - # Now test with an actual secret and make sure it works - "$DAGGER" init - dagger_new_with_plan secrets "$TESTDIR"/compute/secrets/simple - "$DAGGER" input secret mySecret SecretValue - run "$DAGGER" up - assert_success - - # Make sure the secret doesn't show in dagger query - run "$DAGGER" query mySecret.id -f text - assert_success - assert_output "secret=mySecret" -} - -@test "compute: docker socket" { - skip "docker socket support disabled" - run "$DAGGER" compute "$TESTDIR"/compute/dockersocket -} - -@test "compute: exclude" { - "$DAGGER" up -w "$TESTDIR"/compute/exclude -} diff --git a/tests/compute/dockersocket/main.cue b/tests/compute/dockersocket/main.cue index 7b97f7b2..a554623c 100644 --- a/tests/compute/dockersocket/main.cue +++ b/tests/compute/dockersocket/main.cue @@ -1,8 +1,8 @@ package main import ( - "dagger.io/dagger/op" - "dagger.io/docker" + "alpha.dagger.io/dagger/op" + "alpha.dagger.io/docker" ) TestDockerSocket: #up: [ diff --git a/tests/compute/exclude/.dagger/env/default/plan/main.cue b/tests/compute/exclude/.dagger/env/default/plan/main.cue index b86eecb5..682e4316 100644 --- a/tests/compute/exclude/.dagger/env/default/plan/main.cue +++ b/tests/compute/exclude/.dagger/env/default/plan/main.cue @@ -1,9 +1,9 @@ package testing import ( - "dagger.io/alpine" - "dagger.io/dagger" - "dagger.io/dagger/op" + "alpha.dagger.io/alpine" + "alpha.dagger.io/dagger" + "alpha.dagger.io/dagger/op" ) TestData: dagger.#Artifact diff --git a/tests/compute/secrets/invalid/env/env.cue b/tests/compute/secrets/invalid/env/env.cue index bfded599..bfe94379 100644 --- a/tests/compute/secrets/invalid/env/env.cue +++ b/tests/compute/secrets/invalid/env/env.cue @@ -1,9 +1,9 @@ package testing import ( - "dagger.io/dagger" - "dagger.io/dagger/op" - "dagger.io/alpine" + "alpha.dagger.io/dagger" + "alpha.dagger.io/dagger/op" + "alpha.dagger.io/alpine" ) mySecret: dagger.#Secret diff --git a/tests/compute/secrets/invalid/string/string.cue b/tests/compute/secrets/invalid/string/string.cue index 2015a1d7..aa194dee 100644 --- a/tests/compute/secrets/invalid/string/string.cue +++ b/tests/compute/secrets/invalid/string/string.cue @@ -1,8 +1,8 @@ package testing import ( - "dagger.io/dagger/op" - "dagger.io/alpine" + "alpha.dagger.io/dagger/op" + "alpha.dagger.io/alpine" ) mySecret: dagger.#Secret diff --git a/tests/compute/secrets/simple/simple.cue b/tests/compute/secrets/simple/simple.cue index 4d1f5ca6..0b8d3d7f 100644 --- a/tests/compute/secrets/simple/simple.cue +++ b/tests/compute/secrets/simple/simple.cue @@ -1,9 +1,9 @@ package testing import ( - "dagger.io/dagger" - "dagger.io/dagger/op" - "dagger.io/alpine" + "alpha.dagger.io/dagger" + "alpha.dagger.io/dagger/op" + "alpha.dagger.io/alpine" ) mySecret: dagger.#Secret diff --git a/tests/compute/success/exec-nocache/main.cue b/tests/compute/success/exec-nocache/main.cue index fb9eef6b..6609cdbd 100644 --- a/tests/compute/success/exec-nocache/main.cue +++ b/tests/compute/success/exec-nocache/main.cue @@ -1,8 +1,8 @@ package main import ( - "dagger.io/alpine" - "dagger.io/dagger/op" + "alpha.dagger.io/alpine" + "alpha.dagger.io/dagger/op" ) rand: { diff --git a/tests/core.bats b/tests/core.bats index ee600509..4a636c4d 100644 --- a/tests/core.bats +++ b/tests/core.bats @@ -4,12 +4,20 @@ setup() { load 'helpers' common_setup - - # Use native Dagger environment here - unset DAGGER_WORKSPACE } +# This file combines 2 types of tests: +# old-style tests: use 'dagger compute' +# new-style tests: use 'dagger up' +# +# For new tests, please adopt new-style. +# NOTE: you will need to 'unset DAGGER_WORKSPACE' +# at the beginning of each new-style test. + @test "core: inputs & outputs" { + # Use native Dagger environment here + unset DAGGER_WORKSPACE + # List available inputs run dagger -e test-core input list assert_success @@ -33,3 +41,114 @@ setup() { assert_output --partial 'Hello, world!' } + +@test "compute: simple" { + run "$DAGGER" compute "$TESTDIR"/compute/invalid/string + assert_failure + + run "$DAGGER" compute "$TESTDIR"/compute/invalid/bool + assert_failure + + run "$DAGGER" compute "$TESTDIR"/compute/invalid/int + assert_failure + + run "$DAGGER" compute "$TESTDIR"/compute/invalid/struct + assert_failure + + run "$DAGGER" compute "$TESTDIR"/compute/success/noop + assert_success + assert_line '{"empty":{}}' + + run "$DAGGER" compute "$TESTDIR"/compute/success/simple + assert_success + assert_line '{}' + + run "$DAGGER" compute "$TESTDIR"/compute/success/overload/flat + assert_success + + run "$DAGGER" compute "$TESTDIR"/compute/success/overload/wrapped + assert_success + + run "$DAGGER" compute "$TESTDIR"/compute/success/exec-nocache + assert_success +} + +@test "compute: dependencies" { + run "$DAGGER" compute "$TESTDIR"/compute/dependencies/simple + assert_success + assert_line '{"A":{"result":"from A"},"B":{"result":"dependency from A"}}' + + run "$DAGGER" compute "$TESTDIR"/compute/dependencies/interpolation + assert_success + assert_line '{"A":{"result":"from A"},"B":{"result":"dependency from A"}}' + + run "$DAGGER" compute "$TESTDIR"/compute/dependencies/unmarshal + assert_success + assert_line '{"A":"{\"hello\": \"world\"}\n","B":{"result":"unmarshalled.hello=world"},"unmarshalled":{"hello":"world"}}' +} + +@test "compute: inputs" { + run "$DAGGER" compute "$TESTDIR"/compute/input/simple + assert_success + assert_line '{}' + + run "$DAGGER" compute --input-string 'in=foobar' "$TESTDIR"/compute/input/simple + assert_success + assert_line '{"in":"foobar","test":"received: foobar"}' + + run "$DAGGER" compute "$TESTDIR"/compute/input/default + assert_success + assert_line '{"in":"default input","test":"received: default input"}' + + run "$DAGGER" compute --input-string 'in=foobar' "$TESTDIR"/compute/input/default + assert_success + assert_line '{"in":"foobar","test":"received: foobar"}' + + run "$DAGGER" compute --input-string=foobar "$TESTDIR"/compute/input/default + assert_failure + assert_output --partial 'failed to parse input: input-string' + + run "$DAGGER" compute --input-dir=foobar "$TESTDIR"/compute/input/default + assert_failure + assert_output --partial 'failed to parse input: input-dir' + + run "$DAGGER" compute --input-git=foobar "$TESTDIR"/compute/input/default + assert_failure + assert_output --partial 'failed to parse input: input-git' +} + +@test "compute: secrets" { + # secrets used as environment variables must fail + run "$DAGGER" compute "$TESTDIR"/compute/secrets/invalid/env + assert_failure + assert_line --partial "conflicting values" + + # strings passed as secrets must fail + run "$DAGGER" compute "$TESTDIR"/compute/secrets/invalid/string + assert_failure + + # Setting a text input for a secret value should fail + run "$DAGGER" compute --input-string 'mySecret=SecretValue' "$TESTDIR"/compute/secrets/simple + assert_failure + + # Now test with an actual secret and make sure it works + "$DAGGER" init + dagger_new_with_plan secrets "$TESTDIR"/compute/secrets/simple + "$DAGGER" input secret mySecret SecretValue + run "$DAGGER" up + assert_success + + # Make sure the secret doesn't show in dagger query + run "$DAGGER" query mySecret.id -f text + assert_success + assert_output "secret=mySecret" +} + +@test "compute: docker socket" { + skip "docker socket support disabled" + run "$DAGGER" compute "$TESTDIR"/compute/dockersocket +} + +@test "compute: exclude" { + "$DAGGER" up -w "$TESTDIR"/compute/exclude +} diff --git a/tests/ops/copy/invalid/cache/main.cue b/tests/ops/copy/invalid/cache/main.cue index 266abddb..8fef0a56 100644 --- a/tests/ops/copy/invalid/cache/main.cue +++ b/tests/ops/copy/invalid/cache/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" TestCacheCopyLoadAlpine: { string diff --git a/tests/ops/copy/valid/component/main.cue b/tests/ops/copy/valid/component/main.cue index 239233fd..6af0f5d6 100644 --- a/tests/ops/copy/valid/component/main.cue +++ b/tests/ops/copy/valid/component/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" TestComponent: #up: [ op.#FetchContainer & { diff --git a/tests/ops/copy/valid/script/main.cue b/tests/ops/copy/valid/script/main.cue index e51539e2..fe85ac53 100644 --- a/tests/ops/copy/valid/script/main.cue +++ b/tests/ops/copy/valid/script/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" TestScriptCopy: { string diff --git a/tests/ops/dockerbuild/main.cue b/tests/ops/dockerbuild/main.cue index 4e966f72..3f1fb7f0 100644 --- a/tests/ops/dockerbuild/main.cue +++ b/tests/ops/dockerbuild/main.cue @@ -1,8 +1,8 @@ package testing import ( - "dagger.io/dagger" - "dagger.io/dagger/op" + "alpha.dagger.io/dagger" + "alpha.dagger.io/dagger/op" ) // Set to `--input-dir=./tests/dockerbuild/testdata` diff --git a/tests/ops/exec/always/main.cue b/tests/ops/exec/always/main.cue index dad2f1b4..6305ee94 100644 --- a/tests/ops/exec/always/main.cue +++ b/tests/ops/exec/always/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" #up: [ op.#FetchContainer & { diff --git a/tests/ops/exec/dir/doesnotexist/main.cue b/tests/ops/exec/dir/doesnotexist/main.cue index adcb9f80..d96a40be 100644 --- a/tests/ops/exec/dir/doesnotexist/main.cue +++ b/tests/ops/exec/dir/doesnotexist/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" #up: [ op.#FetchContainer & { diff --git a/tests/ops/exec/dir/exist/main.cue b/tests/ops/exec/dir/exist/main.cue index 28e74fa2..26bed476 100644 --- a/tests/ops/exec/dir/exist/main.cue +++ b/tests/ops/exec/dir/exist/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" #up: [ op.#FetchContainer & { diff --git a/tests/ops/exec/env/invalid/main.cue b/tests/ops/exec/env/invalid/main.cue index e9c5a331..6b79d5e4 100644 --- a/tests/ops/exec/env/invalid/main.cue +++ b/tests/ops/exec/env/invalid/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" #up: [ op.#FetchContainer & { diff --git a/tests/ops/exec/env/overlay/main.cue b/tests/ops/exec/env/overlay/main.cue index 35e8bfc3..92367318 100644 --- a/tests/ops/exec/env/overlay/main.cue +++ b/tests/ops/exec/env/overlay/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" bar: string diff --git a/tests/ops/exec/env/valid/main.cue b/tests/ops/exec/env/valid/main.cue index b378e4c1..a6af1699 100644 --- a/tests/ops/exec/env/valid/main.cue +++ b/tests/ops/exec/env/valid/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" #up: [ op.#FetchContainer & { diff --git a/tests/ops/exec/error/main.cue b/tests/ops/exec/error/main.cue index 8347c5ae..4fa7b8ee 100644 --- a/tests/ops/exec/error/main.cue +++ b/tests/ops/exec/error/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" #up: [ op.#FetchContainer & { diff --git a/tests/ops/exec/exit_code/main.cue b/tests/ops/exec/exit_code/main.cue index d83a1e77..23a6a8a0 100644 --- a/tests/ops/exec/exit_code/main.cue +++ b/tests/ops/exec/exit_code/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" #up: [ op.#FetchContainer & { diff --git a/tests/ops/exec/invalid/main.cue b/tests/ops/exec/invalid/main.cue index e1feea27..8a271fcd 100644 --- a/tests/ops/exec/invalid/main.cue +++ b/tests/ops/exec/invalid/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" #up: [ op.#FetchContainer & { diff --git a/tests/ops/exec/simple/main.cue b/tests/ops/exec/simple/main.cue index 4ec86863..bf9c9400 100644 --- a/tests/ops/exec/simple/main.cue +++ b/tests/ops/exec/simple/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" #up: [ op.#FetchContainer & { diff --git a/tests/ops/exec/undefined/non_concrete_not_referenced/main.cue b/tests/ops/exec/undefined/non_concrete_not_referenced/main.cue index 85b6a817..ad4952b8 100644 --- a/tests/ops/exec/undefined/non_concrete_not_referenced/main.cue +++ b/tests/ops/exec/undefined/non_concrete_not_referenced/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" hello: "world" bar: string diff --git a/tests/ops/exec/undefined/non_concrete_referenced/main.cue b/tests/ops/exec/undefined/non_concrete_referenced/main.cue index 3a1e8796..62c9a255 100644 --- a/tests/ops/exec/undefined/non_concrete_referenced/main.cue +++ b/tests/ops/exec/undefined/non_concrete_referenced/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" hello: "world" bar: string diff --git a/tests/ops/exec/undefined/with_pkg_def/cue.mod/module.cue b/tests/ops/exec/undefined/with_pkg_def/cue.mod/module.cue index 38b913a1..7e830608 100644 --- a/tests/ops/exec/undefined/with_pkg_def/cue.mod/module.cue +++ b/tests/ops/exec/undefined/with_pkg_def/cue.mod/module.cue @@ -1 +1 @@ -module: "dagger.io/testing" +module: "alpha.dagger.io/testing" diff --git a/tests/ops/exec/undefined/with_pkg_def/cue.mod/pkg/dagger.io/def/main.cue b/tests/ops/exec/undefined/with_pkg_def/cue.mod/pkg/alpha.dagger.io/def/main.cue similarity index 100% rename from tests/ops/exec/undefined/with_pkg_def/cue.mod/pkg/dagger.io/def/main.cue rename to tests/ops/exec/undefined/with_pkg_def/cue.mod/pkg/alpha.dagger.io/def/main.cue diff --git a/tests/ops/exec/undefined/with_pkg_def/main.cue b/tests/ops/exec/undefined/with_pkg_def/main.cue index cd8a98b5..50d175a9 100644 --- a/tests/ops/exec/undefined/with_pkg_def/main.cue +++ b/tests/ops/exec/undefined/with_pkg_def/main.cue @@ -1,8 +1,8 @@ package testing import ( - "dagger.io/dagger/op" - "dagger.io/def" + "alpha.dagger.io/dagger/op" + "alpha.dagger.io/def" ) #up: [ diff --git a/tests/ops/exec/undefined/with_pkg_mandatory/cue.mod/module.cue b/tests/ops/exec/undefined/with_pkg_mandatory/cue.mod/module.cue index 38b913a1..7e830608 100644 --- a/tests/ops/exec/undefined/with_pkg_mandatory/cue.mod/module.cue +++ b/tests/ops/exec/undefined/with_pkg_mandatory/cue.mod/module.cue @@ -1 +1 @@ -module: "dagger.io/testing" +module: "alpha.dagger.io/testing" diff --git a/tests/ops/exec/undefined/with_pkg_mandatory/cue.mod/pkg/dagger.io/nonoptional/main.cue b/tests/ops/exec/undefined/with_pkg_mandatory/cue.mod/pkg/alpha.dagger.io/nonoptional/main.cue similarity index 100% rename from tests/ops/exec/undefined/with_pkg_mandatory/cue.mod/pkg/dagger.io/nonoptional/main.cue rename to tests/ops/exec/undefined/with_pkg_mandatory/cue.mod/pkg/alpha.dagger.io/nonoptional/main.cue diff --git a/tests/ops/exec/undefined/with_pkg_mandatory/main.cue b/tests/ops/exec/undefined/with_pkg_mandatory/main.cue index e6673db4..e2421bd1 100644 --- a/tests/ops/exec/undefined/with_pkg_mandatory/main.cue +++ b/tests/ops/exec/undefined/with_pkg_mandatory/main.cue @@ -1,8 +1,8 @@ package testing import ( - "dagger.io/nonoptional" - "dagger.io/dagger/op" + "alpha.dagger.io/nonoptional" + "alpha.dagger.io/dagger/op" ) #up: [ diff --git a/tests/ops/exec/undefined/with_pkg_optional/cue.mod/module.cue b/tests/ops/exec/undefined/with_pkg_optional/cue.mod/module.cue index 38b913a1..7e830608 100644 --- a/tests/ops/exec/undefined/with_pkg_optional/cue.mod/module.cue +++ b/tests/ops/exec/undefined/with_pkg_optional/cue.mod/module.cue @@ -1 +1 @@ -module: "dagger.io/testing" +module: "alpha.dagger.io/testing" diff --git a/tests/ops/exec/undefined/with_pkg_optional/cue.mod/pkg/dagger.io/optional/main.cue b/tests/ops/exec/undefined/with_pkg_optional/cue.mod/pkg/alpha.dagger.io/optional/main.cue similarity index 100% rename from tests/ops/exec/undefined/with_pkg_optional/cue.mod/pkg/dagger.io/optional/main.cue rename to tests/ops/exec/undefined/with_pkg_optional/cue.mod/pkg/alpha.dagger.io/optional/main.cue diff --git a/tests/ops/exec/undefined/with_pkg_optional/main.cue b/tests/ops/exec/undefined/with_pkg_optional/main.cue index 59569918..1dbc5f88 100644 --- a/tests/ops/exec/undefined/with_pkg_optional/main.cue +++ b/tests/ops/exec/undefined/with_pkg_optional/main.cue @@ -1,8 +1,8 @@ package testing import ( - "dagger.io/optional" - "dagger.io/dagger/op" + "alpha.dagger.io/optional" + "alpha.dagger.io/dagger/op" ) #up: [ diff --git a/tests/ops/export/bool/main.cue b/tests/ops/export/bool/main.cue index 604b033a..51327ec1 100644 --- a/tests/ops/export/bool/main.cue +++ b/tests/ops/export/bool/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" TestExportBool: { bool diff --git a/tests/ops/export/concurrency/main.cue b/tests/ops/export/concurrency/main.cue index 36832bec..1711b810 100644 --- a/tests/ops/export/concurrency/main.cue +++ b/tests/ops/export/concurrency/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" TestExportConcurrency1: { string diff --git a/tests/ops/export/float/main.cue b/tests/ops/export/float/main.cue index 5382a1eb..701700d2 100644 --- a/tests/ops/export/float/main.cue +++ b/tests/ops/export/float/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" TestExportFloat: { float diff --git a/tests/ops/export/invalid/format/main.cue b/tests/ops/export/invalid/format/main.cue index d74428d7..0f61829e 100644 --- a/tests/ops/export/invalid/format/main.cue +++ b/tests/ops/export/invalid/format/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" TestExportInvalidFormat: { string diff --git a/tests/ops/export/invalid/validation/main.cue b/tests/ops/export/invalid/validation/main.cue index 931bd291..f1ce3ee3 100644 --- a/tests/ops/export/invalid/validation/main.cue +++ b/tests/ops/export/invalid/validation/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" TestExportInvalidValidation: { string diff --git a/tests/ops/export/json/main.cue b/tests/ops/export/json/main.cue index df3341d6..5ee735d8 100644 --- a/tests/ops/export/json/main.cue +++ b/tests/ops/export/json/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" TestExportScalar: { bool diff --git a/tests/ops/export/number/main.cue b/tests/ops/export/number/main.cue index 5fa8c376..5aa6d567 100644 --- a/tests/ops/export/number/main.cue +++ b/tests/ops/export/number/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" TestExportNumber: { number diff --git a/tests/ops/export/string/main.cue b/tests/ops/export/string/main.cue index b5bc85e8..a1ab778a 100644 --- a/tests/ops/export/string/main.cue +++ b/tests/ops/export/string/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" TestExportString: { string diff --git a/tests/ops/export/withvalidation/main.cue b/tests/ops/export/withvalidation/main.cue index 6e604137..e1d6f935 100644 --- a/tests/ops/export/withvalidation/main.cue +++ b/tests/ops/export/withvalidation/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" TestExportStringValidation: { string diff --git a/tests/ops/export/yaml/main.cue b/tests/ops/export/yaml/main.cue index 35e6b07c..fca9b8e5 100644 --- a/tests/ops/export/yaml/main.cue +++ b/tests/ops/export/yaml/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" TestExportScalar: { bool diff --git a/tests/ops/fetch-container/exist/main.cue b/tests/ops/fetch-container/exist/main.cue index 58c592fd..f024ce12 100644 --- a/tests/ops/fetch-container/exist/main.cue +++ b/tests/ops/fetch-container/exist/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" TestBusybox1: #up: [ op.#FetchContainer & { diff --git a/tests/ops/fetch-container/invalid/main.cue b/tests/ops/fetch-container/invalid/main.cue index 0de73875..0bec0af0 100644 --- a/tests/ops/fetch-container/invalid/main.cue +++ b/tests/ops/fetch-container/invalid/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" #up: [ op.#FetchContainer & { diff --git a/tests/ops/fetch-container/nonexistent/digest/main.cue b/tests/ops/fetch-container/nonexistent/digest/main.cue index e41a0af6..ce559e4b 100644 --- a/tests/ops/fetch-container/nonexistent/digest/main.cue +++ b/tests/ops/fetch-container/nonexistent/digest/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" #up: [ op.#FetchContainer & { diff --git a/tests/ops/fetch-container/nonexistent/image-with-valid-digest/main.cue b/tests/ops/fetch-container/nonexistent/image-with-valid-digest/main.cue index 7eaa1468..8adf89a3 100644 --- a/tests/ops/fetch-container/nonexistent/image-with-valid-digest/main.cue +++ b/tests/ops/fetch-container/nonexistent/image-with-valid-digest/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" // XXX WATCHOUT // Once buildkit has pulled that digest, it will stay cached and happily succeed WHATEVER the image name then is diff --git a/tests/ops/fetch-container/nonexistent/image/main.cue b/tests/ops/fetch-container/nonexistent/image/main.cue index d32c238a..7216d7db 100644 --- a/tests/ops/fetch-container/nonexistent/image/main.cue +++ b/tests/ops/fetch-container/nonexistent/image/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" #up: [ op.#FetchContainer & { diff --git a/tests/ops/fetch-container/nonexistent/tag/main.cue b/tests/ops/fetch-container/nonexistent/tag/main.cue index cc24916a..f8a670b0 100644 --- a/tests/ops/fetch-container/nonexistent/tag/main.cue +++ b/tests/ops/fetch-container/nonexistent/tag/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" #up: [ op.#FetchContainer & { diff --git a/tests/ops/fetch-git/exist/main.cue b/tests/ops/fetch-git/exist/main.cue index dc8cf641..fc54f838 100644 --- a/tests/ops/fetch-git/exist/main.cue +++ b/tests/ops/fetch-git/exist/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" #up: [ op.#FetchGit & { diff --git a/tests/ops/fetch-git/gitdir/main.cue b/tests/ops/fetch-git/gitdir/main.cue index 61fc0607..0f58dcc9 100644 --- a/tests/ops/fetch-git/gitdir/main.cue +++ b/tests/ops/fetch-git/gitdir/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" repo1: #up: [ op.#FetchGit & { diff --git a/tests/ops/fetch-git/invalid/main.cue b/tests/ops/fetch-git/invalid/main.cue index dac913c6..8e653fbd 100644 --- a/tests/ops/fetch-git/invalid/main.cue +++ b/tests/ops/fetch-git/invalid/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" #up: [ op.#FetchGit & { diff --git a/tests/ops/fetch-git/nonexistent/bork/main.cue b/tests/ops/fetch-git/nonexistent/bork/main.cue index 9d8cab55..9d3d67d1 100644 --- a/tests/ops/fetch-git/nonexistent/bork/main.cue +++ b/tests/ops/fetch-git/nonexistent/bork/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" #up: [ op.#FetchGit & { diff --git a/tests/ops/fetch-git/nonexistent/ref/main.cue b/tests/ops/fetch-git/nonexistent/ref/main.cue index 618075ac..1f9b2d60 100644 --- a/tests/ops/fetch-git/nonexistent/ref/main.cue +++ b/tests/ops/fetch-git/nonexistent/ref/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" #up: [ op.#FetchGit & { diff --git a/tests/ops/fetch-git/nonexistent/remote/main.cue b/tests/ops/fetch-git/nonexistent/remote/main.cue index 4193c76f..4a18f303 100644 --- a/tests/ops/fetch-git/nonexistent/remote/main.cue +++ b/tests/ops/fetch-git/nonexistent/remote/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" #up: [ op.#FetchGit & { diff --git a/tests/ops/load/invalid/cache/main.cue b/tests/ops/load/invalid/cache/main.cue index 5191fa53..2b0873d4 100644 --- a/tests/ops/load/invalid/cache/main.cue +++ b/tests/ops/load/invalid/cache/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" test1: { string diff --git a/tests/ops/load/valid/component/main.cue b/tests/ops/load/valid/component/main.cue index 05e9d75e..574c0abd 100644 --- a/tests/ops/load/valid/component/main.cue +++ b/tests/ops/load/valid/component/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" TestComponent: #up: [ op.#FetchContainer & { diff --git a/tests/ops/load/valid/script/main.cue b/tests/ops/load/valid/script/main.cue index d4184b09..d74567ed 100644 --- a/tests/ops/load/valid/script/main.cue +++ b/tests/ops/load/valid/script/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" test: { string diff --git a/tests/ops/mounts/valid/cache/main.cue b/tests/ops/mounts/valid/cache/main.cue index 69b9d603..4159723b 100644 --- a/tests/ops/mounts/valid/cache/main.cue +++ b/tests/ops/mounts/valid/cache/main.cue @@ -1,7 +1,7 @@ package testing import ( - "dagger.io/dagger/op" + "alpha.dagger.io/dagger/op" ) TestMountCache: { diff --git a/tests/ops/mounts/valid/component/main.cue b/tests/ops/mounts/valid/component/main.cue index 836673aa..2c9b5f47 100644 --- a/tests/ops/mounts/valid/component/main.cue +++ b/tests/ops/mounts/valid/component/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" test: { string diff --git a/tests/ops/mounts/valid/script/main.cue b/tests/ops/mounts/valid/script/main.cue index 2ccc40bb..afde31f5 100644 --- a/tests/ops/mounts/valid/script/main.cue +++ b/tests/ops/mounts/valid/script/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" TestInvalidMountPath: { string diff --git a/tests/ops/mounts/valid/tmpfs/main.cue b/tests/ops/mounts/valid/tmpfs/main.cue index 7980a56d..71699d83 100644 --- a/tests/ops/mounts/valid/tmpfs/main.cue +++ b/tests/ops/mounts/valid/tmpfs/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" TestMountTmpfs: { string diff --git a/tests/ops/push-container/main.cue b/tests/ops/push-container/main.cue index 13e3827a..7761c0a7 100644 --- a/tests/ops/push-container/main.cue +++ b/tests/ops/push-container/main.cue @@ -1,9 +1,9 @@ package main import ( - "dagger.io/dagger/op" - "dagger.io/alpine" - "dagger.io/random" + "alpha.dagger.io/dagger/op" + "alpha.dagger.io/alpine" + "alpha.dagger.io/random" ) registry: { diff --git a/tests/ops/subdir/invalid/exec/main.cue b/tests/ops/subdir/invalid/exec/main.cue index 19442466..8c42c368 100644 --- a/tests/ops/subdir/invalid/exec/main.cue +++ b/tests/ops/subdir/invalid/exec/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" TestInvalidExecSubdir: { string diff --git a/tests/ops/subdir/invalid/path/main.cue b/tests/ops/subdir/invalid/path/main.cue index 4b61a118..cbfd9ed1 100644 --- a/tests/ops/subdir/invalid/path/main.cue +++ b/tests/ops/subdir/invalid/path/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" TestInvalidPathSubdir: { string diff --git a/tests/ops/subdir/valid/container/main.cue b/tests/ops/subdir/valid/container/main.cue index 13219f2d..26311b10 100644 --- a/tests/ops/subdir/valid/container/main.cue +++ b/tests/ops/subdir/valid/container/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" #TestContainer: #up: [ op.#FetchContainer & { diff --git a/tests/ops/subdir/valid/simple/main.cue b/tests/ops/subdir/valid/simple/main.cue index 639eed63..384c3f38 100644 --- a/tests/ops/subdir/valid/simple/main.cue +++ b/tests/ops/subdir/valid/simple/main.cue @@ -1,6 +1,6 @@ package testing -import "dagger.io/dagger/op" +import "alpha.dagger.io/dagger/op" TestSimpleSubdir: { string diff --git a/tests/stdlib/docker/push-pull/push-pull.cue b/tests/stdlib/docker/push-pull/push-pull.cue index edaad5b3..5ca34cf8 100644 --- a/tests/stdlib/docker/push-pull/push-pull.cue +++ b/tests/stdlib/docker/push-pull/push-pull.cue @@ -1,11 +1,11 @@ package main import ( - "dagger.io/dagger" - "dagger.io/dagger/op" - "dagger.io/alpine" - "dagger.io/docker" - "dagger.io/random" + "alpha.dagger.io/dagger" + "alpha.dagger.io/dagger/op" + "alpha.dagger.io/alpine" + "alpha.dagger.io/docker" + "alpha.dagger.io/random" ) source: dagger.#Artifact diff --git a/website/netlify.toml b/website/netlify.toml index 703a4e4a..6fccec8d 100644 --- a/website/netlify.toml +++ b/website/netlify.toml @@ -32,6 +32,11 @@ from = "/docs-access/*" to = "https://j20f3pfq11.execute-api.us-east-1.amazonaws.com/Prod/u/:splat" status = 200 +[[redirects]] +from = "/t" +to = "https://api.amplitude.com" +status = 200 + [[redirects]] from = "/reference" to = "/reference/universe/alpine" diff --git a/website/package.json b/website/package.json index e8ef3030..618e9351 100644 --- a/website/package.json +++ b/website/package.json @@ -20,8 +20,9 @@ "@docusaurus/preset-classic": "2.0.0-beta.0", "@mdx-js/react": "^1.6.21", "@svgr/webpack": "^5.5.0", + "amplitude-js": "^8.3.1", "clsx": "^1.1.1", - "docusaurus-plugin-sass": "^0.2.0", + "docusaurus-plugin-sass": "^0.2.1", "docusaurus2-dotenv": "^1.4.0", "file-loader": "^6.2.0", "react": "^17.0.1", diff --git a/website/sidebars.js b/website/sidebars.js index 2b6ea111..2a96878a 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -26,7 +26,7 @@ module.exports = { { type: 'link', label: 'Discord', - href: 'https://discord.gg/Rmffpmc' + href: 'https://discord.gg/ufnyBtc8uY' }, ], }, diff --git a/website/src/api/github.js b/website/src/api/github.js index 439c975d..ea39bc49 100644 --- a/website/src/api/github.js +++ b/website/src/api/github.js @@ -61,6 +61,7 @@ export async function checkUserCollaboratorStatus(code) { }) return { - userPermission: isUserCollaborator.data + permission: isUserCollaborator.data, + login } } \ No newline at end of file diff --git a/website/src/theme/DocPage/index.js b/website/src/theme/DocPage/index.js index 9be128a0..f0f4037a 100644 --- a/website/src/theme/DocPage/index.js +++ b/website/src/theme/DocPage/index.js @@ -26,6 +26,7 @@ import { GithubLoginButton } from 'react-social-login-buttons'; import Spinner from '../../components/Spinner'; import DocPageAuthentication from '../../components/DocPageAuthentication'; import DocPageRedirect from '../../components/DocPageRedirect'; +import ExecutionEnvironment from '@docusaurus/ExecutionEnvironment'; function DocPageContent({ currentDocRoute, versionMetadata, children }) { const { siteConfig, isClient } = useDocusaurusContext(); @@ -41,6 +42,7 @@ function DocPageContent({ currentDocRoute, versionMetadata, children }) { setHiddenSidebarContainer(!hiddenSidebarContainer); }, [hiddenSidebar]); + return ( matchPath(location.pathname, docRoute), ); + const userAgent = ExecutionEnvironment.canUseDOM ? navigator.userAgent : null; // CUSTOM DOCPAGE - if (process.env.OAUTH_ENABLE == 'true') { + if (process.env.OAUTH_ENABLE == 'true' && userAgent !== 'Algolia DocSearch Crawler') { const [isLoading, setIsLoading] = useState(true) const [redirectState, setRedirectState] = useState() const authQuery = qs.parse(location.search); const [userAccessStatus, setUserAccessStatus] = useState((() => { - if (typeof window !== "undefined") return window.localStorage.getItem('user-github-isAllowed') + if (typeof window !== "undefined") return JSON.parse(window.localStorage.getItem('user')) })()) useEffect(async () => { if (!isEmpty(authQuery) && userAccessStatus === null) { //callback after successful auth with github - const isUserCollaborator = await checkUserCollaboratorStatus(authQuery.code); - setUserAccessStatus(isUserCollaborator?.userPermission) - if (isUserCollaborator?.userPermission) { - if (typeof window !== "undefined") window.localStorage.setItem('user-github-isAllowed', isUserCollaborator?.userPermission); + const user = await checkUserCollaboratorStatus(authQuery.code); + setUserAccessStatus(user) + if (user?.permission) { + if (typeof window !== "undefined") window.localStorage.setItem('user', JSON.stringify(user)); } } setIsLoading(false) - }, [userAccessStatus]) + }, []) + useEffect(() => { + import('amplitude-js').then(amplitude => { + if (userAccessStatus?.login) { + var amplitudeInstance = amplitude.getInstance().init(process.env.REACT_APP_AMPLITUDE_ID, userAccessStatus?.login.toLowerCase(), { + apiEndpoint: `${window.location.hostname}/t` + }); + amplitude.getInstance().logEvent('Docs Viewed', { "hostname": window.location.hostname, "path": location.pathname }); + } + }) + }, [location.pathname, userAccessStatus]) if (isLoading) return - if (userAccessStatus === false) { + if (userAccessStatus?.permission === false) { return } diff --git a/website/yarn.lock b/website/yarn.lock index 74f26e22..eef8e303 100644 --- a/website/yarn.lock +++ b/website/yarn.lock @@ -125,6 +125,24 @@ "@algolia/logger-common" "4.9.1" "@algolia/requester-common" "4.9.1" +"@amplitude/types@^1.6.1": + version "1.6.1" + resolved "https://registry.yarnpkg.com/@amplitude/types/-/types-1.6.1.tgz#ed15be42746526d6f7087bedc916734e13be56fd" + integrity sha512-GSaNbROpG5gaoLQPo9crpCkB+BgfN7ZtK6SPJaQC2IX2xNqvfq/RZwYLhMZyNfZw/Nce0Z6lKYXCoNPyhdL26Q== + +"@amplitude/ua-parser-js@0.7.24": + version "0.7.24" + resolved "https://registry.yarnpkg.com/@amplitude/ua-parser-js/-/ua-parser-js-0.7.24.tgz#2ce605af7d2c38d4a01313fb2385df55fbbd69aa" + integrity sha512-VbQuJymJ20WEw0HtI2np7EdC3NJGUWi8+Xdbc7uk8WfMIF308T0howpzkQ3JFMN7ejnrcSM/OyNGveeE3TP3TA== + +"@amplitude/utils@^1.0.5": + version "1.6.1" + resolved "https://registry.yarnpkg.com/@amplitude/utils/-/utils-1.6.1.tgz#fb6833bca5a35af01468e0317363520ff2377259" + integrity sha512-lzmjvKOkg2tbr5YvLuxBAOoCvnmAJ5mvuLYy9hth5j4dzeVfE8aoZp9PYpxOGAuonVEPJas3BH0XGTVBDn1zNA== + dependencies: + "@amplitude/types" "^1.6.1" + tslib "^1.9.3" + "@babel/code-frame@7.10.4": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.10.4.tgz#168da1a36e90da68ae8d49c0f1b48c7c6249213a" @@ -2028,6 +2046,16 @@ alphanum-sort@^1.0.2: resolved "https://registry.yarnpkg.com/alphanum-sort/-/alphanum-sort-1.0.2.tgz#97a1119649b211ad33691d9f9f486a8ec9fbe0a3" integrity sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM= +amplitude-js@^8.3.1: + version "8.3.1" + resolved "https://registry.yarnpkg.com/amplitude-js/-/amplitude-js-8.3.1.tgz#8ce73aa0e5bf327eae571b93602b25cc82d3a1f4" + integrity sha512-mo1qm3h5vkKkSNJQqvcg/2d06ay348BBi0ma94nx239iMlzlL3XQJ16xgg4a2z62cOsoqn91CRJDmjD39dx9aQ== + dependencies: + "@amplitude/ua-parser-js" "0.7.24" + "@amplitude/utils" "^1.0.5" + blueimp-md5 "^2.10.0" + query-string "5" + ansi-align@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-3.0.0.tgz#b536b371cf687caaef236c18d3e21fe3797467cb" @@ -2340,6 +2368,11 @@ bluebird@^3.7.1: resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== +blueimp-md5@^2.10.0: + version "2.18.0" + resolved "https://registry.yarnpkg.com/blueimp-md5/-/blueimp-md5-2.18.0.tgz#1152be1335f0c6b3911ed9e36db54f3e6ac52935" + integrity sha512-vE52okJvzsVWhcgUHOv+69OG3Mdg151xyn41aVQN/5W5S+S43qZhxECtYLAEHMSFWX6Mv5IZrzj3T5+JqXfj5Q== + body-parser@1.19.0: version "1.19.0" resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a" @@ -3375,10 +3408,10 @@ dns-txt@^2.0.2: dependencies: buffer-indexof "^1.0.0" -docusaurus-plugin-sass@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/docusaurus-plugin-sass/-/docusaurus-plugin-sass-0.2.0.tgz#9582a0e66a65b0a8886fe55f1fa42d1576de37d8" - integrity sha512-aH7OpvjY9BplN9bcfrDhPlkHYuMvlf0USoeDjBNoEC3AIn8CwKtpN1YfxXU+M5nGz/ummeTxyEAFY0VzchJW6w== +docusaurus-plugin-sass@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/docusaurus-plugin-sass/-/docusaurus-plugin-sass-0.2.1.tgz#673c6b6ac00b581e8fb0baab22f2b3766735aafc" + integrity sha512-cRugbRWnKLjFPQTo1k2cyn/AANYkXAPHv+DaLs7bkOfOofEgTSrMdpNidt3oZ0ltQcjUUbvmSRRjH9R1ifdRMA== dependencies: sass-loader "^10.1.1" @@ -6721,6 +6754,15 @@ qs@6.7.0: resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== +query-string@5: + version "5.1.1" + resolved "https://registry.yarnpkg.com/query-string/-/query-string-5.1.1.tgz#a78c012b71c17e05f2e3fa2319dd330682efb3cb" + integrity sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw== + dependencies: + decode-uri-component "^0.2.0" + object-assign "^4.1.0" + strict-uri-encode "^1.0.0" + querystring@0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" @@ -7792,6 +7834,11 @@ std-env@^2.2.1: dependencies: ci-info "^3.0.0" +strict-uri-encode@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" + integrity sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM= + string-width@^3.0.0, string-width@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" @@ -8117,7 +8164,7 @@ ts-essentials@^2.0.3: resolved "https://registry.yarnpkg.com/ts-essentials/-/ts-essentials-2.0.12.tgz#c9303f3d74f75fa7528c3d49b80e089ab09d8745" integrity sha512-3IVX4nI6B5cc31/GFFE+i8ey/N2eA0CZDbo6n0yrz0zDX8ZJ8djmU1p+XRz7G3is0F3bB3pu2pAroFdAWQKU3w== -tslib@^1.9.0: +tslib@^1.9.0, tslib@^1.9.3: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==