Commit Graph

191 Commits

Author SHA1 Message Date
Andrea Luzzardi
e86cb7be6d
Merge pull request #535 from aluzzardi/dagger-homedir
use ~/.config/dagger rather than ~/.dagger
2021-06-01 13:23:43 -07:00
Andrea Luzzardi
c5c586ff71 use ~/.config/dagger rather than ~/.dagger
since `.dagger` directories have a special meaning now because of gitflow,
it's better not to have a `~/.dagger` since it's not a workspace and
it confuses dagger (e.g. `dagger new` from $HOME).

We don't store state there anymore, just keys and the last version
check, so it's okay to be in ~/.config IMO

Looking at my system, in ~/.config there's `gcloud`, `gatsby`, `gh`,
`yarn`, and others so it seems like a pretty common location.

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-06-01 12:38:14 -07:00
Sam Alba
2bd4679646 fixed ci
Signed-off-by: Sam Alba <sam.alba@gmail.com>
2021-06-01 15:12:08 +02:00
Sam Alba
3d1e37e1ab test: updates output list tests
Signed-off-by: Sam Alba <sam.alba@gmail.com>
2021-06-01 14:15:02 +02:00
Sam Alba
ec4730708d cue fmt
Signed-off-by: Sam Alba <sam.alba@gmail.com>
2021-05-31 16:42:01 +02:00
Sam Alba
44a919e7f8 test: implemented tests for output list
Signed-off-by: Sam Alba <sam.alba@gmail.com>
2021-05-31 15:56:58 +02:00
Guillaume de Rouville
d74efa2420 Fix index out of bound for Dagger compute inputs + add tests ["input-dir", "input-git", input-string"]
Signed-off-by: Guillaume de Rouville <guillaume.derouville@gmail.com>
2021-05-31 12:11:54 +02:00
Tom Chauveau
242b61972c Update sops version to fix CI
Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
2021-05-29 19:40:01 +02:00
Tom Chauveau
4b6315e2fc Handle fingerprint option for auth
Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
2021-05-29 18:29:39 +02:00
Andrea Luzzardi
b627b4bc88 add support for excludes in input dir
This adds support for `--include` and `--exclude` for directory inputs.

For instance, this is what you would want to use when passing dagger
repository as an input:

```
inputs:
    repository:
        dir:
            path: .
            exclude:
                - '**/node_modules'
                - cmd/dagger/dagger
                - cmd/dagger/dagger-debug
```

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-05-28 16:22:32 -07:00
Andrea Luzzardi
868fd018f4 tests: fix remaining tests due to secrets
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-05-28 14:00:27 -07:00
Andrea Luzzardi
1e1b28e1de tests: examples/react tests to use native secrets
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-05-28 13:33:59 -07:00
Andrea Luzzardi
28fd9c341f stdlib: update gcp to use secrets
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-05-27 19:18:17 -07:00
Tom Chauveau
5fb7ded2d5 update stdlib tests that use secrets
Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
2021-05-27 19:18:17 -07:00
Andrea Luzzardi
40d4c95bff aws: use secrets
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-05-27 19:14:08 -07:00
Andrea Luzzardi
9c0e2d1d95 buildkit secrets support
- Secrets are never exposed in plaintext in the Cue tree. `dagger query`
  won't dump secrets anymore, Cue errors won't contain them either.
- BuildKit-native secrets support through a new `mount` type. This
  ensures secrets will never be part of containerd layers, buildkit
  cache and generally speaking will never be saved to disk in plaintext.
- Updated netlify as an example
- Added tests
- Changed the Cue definition of a secret to:

```
	@dagger(secret)

	id: string
}
```

This is to ensure both that setting the wrong input type on a secret
(e.g. `dagger input text`) will fail, and attempting to misuse the
secret (e.g. interpolating, passing as an env variable, etc) will also
fail properly.

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-05-27 19:14:08 -07:00
Tom Chauveau
27a60d3cdf Add tests for docker.#Run
Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
2021-05-27 18:15:36 +02:00
Sam Alba
f6aea7e529 curl: do not hardcode version requirement
Signed-off-by: Sam Alba <sam.alba@gmail.com>
2021-05-27 14:31:57 +02:00
Sam Alba
dd17c48922 increased curl dependency, 7.76 was removed from alpine pkg repo
Signed-off-by: Sam Alba <sam.alba@gmail.com>
2021-05-27 13:59:47 +02:00
Andrea Luzzardi
af32e60b37 fix cue fmt
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-05-26 18:46:13 -07:00
Sam Alba
06ed139080 tests: moved cli input test to new syntax
Signed-off-by: Sam Alba <sam.alba@gmail.com>
2021-05-26 13:45:10 +02:00
Sam Alba
3ae6b6f01b test: cue fmt
Signed-off-by: Sam Alba <sam.alba@gmail.com>
2021-05-26 12:34:22 +02:00
Sam Alba
42e91c0a30 test: implemented tests for input list
Signed-off-by: Sam Alba <sam.alba@gmail.com>
2021-05-26 12:03:24 +02:00
Sam Alba
6568c4e6d1 test: removed unused test
Signed-off-by: Sam Alba <sam.alba@gmail.com>
2021-05-26 12:03:24 +02:00
Andrea Luzzardi
c7c8c5fa8d tests: fix integration tests
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-05-25 15:17:32 -07:00
Tom Chauveau
ebe26a90ca Move random string generation to his own file to avoid replication in tests.
Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
2021-05-22 16:49:57 +02:00
Andrea Luzzardi
0f69f3a8af stdlib: gcr support
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-05-19 17:54:30 -07:00
Andrea Luzzardi
5bd3349a27 stdlib: add GKE support
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-05-19 16:44:52 -07:00
Tom Chauveau
0383c6b52a remove unused test helper
Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
2021-05-15 16:05:09 +02:00
Andrea Luzzardi
c85b25cc6c
Merge pull request #426 from TomChv/tests-examples-docker
Add tests for docker example
2021-05-14 12:23:12 -07:00
Sam Alba
0dc63bb30e tests: fixed test result
Signed-off-by: Sam Alba <sam.alba@gmail.com>
2021-05-13 14:22:35 -07:00
Tom Chauveau
8ce8e8e01f Add #Push definition and tests
Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
2021-05-13 21:38:15 +02:00
Sam Alba
637c980c20 tests: added missing test in ops.bats
Signed-off-by: Sam Alba <sam.alba@gmail.com>
2021-05-13 12:36:13 -07:00
Sam Alba
2d2c5a8fed tests: added tests for keepgitdir
Signed-off-by: Sam Alba <sam.alba@gmail.com>
2021-05-13 10:39:32 -07:00
Tom Chauveau
24aee99ba9 Add test for docker example
Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
2021-05-13 16:34:51 +02:00
Solomon Hykes
16edfc4fec stdlib: rename js/react.#App to js/yarn.#Package
Signed-off-by: Solomon Hykes <solomon@dagger.io>
2021-05-12 17:24:10 -07:00
Solomon Hykes
56ef4c1928 tests: remove outdated skip message
Signed-off-by: Solomon Hykes <solomon@dagger.io>
2021-05-12 16:43:14 -07:00
Andrea Luzzardi
2d067c19b4
Merge pull request #443 from dubo-dubon-duponey/sop
Proposal to fix #442
2021-05-12 11:29:16 -07:00
Solomon Hykes
98b3951c73 stdlib: os package
Signed-off-by: Solomon Hykes <solomon@dagger.io>
2021-05-11 17:32:50 -07:00
dubo-dubon-duponey
c5c15c2e1a
Proposal to fix #442
Signed-off-by: dubo-dubon-duponey <dubodubonduponey+github@pm.me>
2021-05-11 15:03:15 -07:00
Andrea Luzzardi
42cf2c18d4
Merge pull request #390 from aluzzardi/terraform
stdlib: terraform support
2021-05-10 11:26:48 -07:00
Andrea Luzzardi
b979e2e994 stdlib: terraform support
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-05-07 12:00:45 -07:00
Andrea Luzzardi
d8a1f35f68 fix pipeline caching when using cache mounts
Force the Pipeline to resolve the canonical Cue value before computing.
This ensures that `.Path()` gives a constant result even on references.

Fixes #399

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-05-07 11:54:45 -07:00
Andrea Luzzardi
3cbdd1fc2a
Merge pull request #384 from TomChv/test-aws-ecr
Add tests for AWS ecr
2021-05-04 12:46:09 -07:00
Andrea Luzzardi
a7d2106486
Merge pull request #339 from TomChv/kubernetes-kustomize
Add kustomize to Kubernetes stdlib
2021-05-04 12:42:40 -07:00
Tom Chauveau
15d1eca41e Add tests for AWS ecr
Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
2021-05-04 12:40:57 -07:00
Tom Chauveau
13b0debbd0 dagger: unset input tests
Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
2021-04-30 20:02:29 +02:00
Tom Chauveau
253c1ce3f7 feat(kubernetes): add kustomize generation to kubernetes stdlib package
test(kubernetes): add test for kustomize

Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
2021-04-30 19:46:32 +02:00
Solomon Hykes
d7391fe948 Rename "deployment" to "environment": tests
Signed-off-by: Solomon Hykes <sh.github.6811@hykes.org>
2021-04-27 13:59:27 -07:00
Sam Alba
520030d4ee fixed tests creds + added authprovider to client solver
Signed-off-by: Sam Alba <sam.alba@gmail.com>
2021-04-26 18:00:31 -07:00
Sam Alba
df4f4b293c cue fmt
Signed-off-by: Sam Alba <sam.alba@gmail.com>
2021-04-26 17:45:14 -07:00
Sam Alba
aa74b8fb7b added tests for push-container with login
Signed-off-by: Sam Alba <sam.alba@gmail.com>
2021-04-26 17:42:48 -07:00
Andrea Luzzardi
1f9e8fb34f tests: run bats tests in parallel
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-04-26 10:42:56 -07:00
Andrea Luzzardi
c8dbbaa1c6
Merge pull request #371 from TomChv/test-naming-convention 2021-04-24 14:04:36 -07:00
Andrea Luzzardi
7bcd28582f
Merge pull request #350 from TomChv/tests-aws-eks 2021-04-24 14:04:11 -07:00
Tom Chauveau
7995594a12 Add more tests on Subdir operation
Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
2021-04-24 22:34:14 +02:00
Tom Chauveau
e366773dc0 Rename tests with new naming convention and update tests lists
Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
2021-04-24 22:33:52 +02:00
Tom Chauveau
57256eb8c4 Add tests for Subdir operation
Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
2021-04-24 19:32:02 +02:00
Andrea Luzzardi
2b7dfcae29 Revert "support registry auth"
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-04-23 16:59:22 -07:00
Tom Chauveau
9fc247848f Add test on AWS eks
Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
2021-04-23 13:51:50 +02:00
Andrea Luzzardi
d77c6f46ff
Merge pull request #342 from verdverm/scan-for-inputs
add cmd/input/list to scan a plan for inputs
2021-04-22 18:41:23 -07:00
Tony Worm
6488d41603 add cmd/input/list to scan a plan for inputs
Signed-off-by: Tony Worm <tony@hofstadter.io>
2021-04-22 17:39:36 -04:00
Andrea Luzzardi
3dba19d9a0
Merge pull request #352 from TomChv/tests-aws-s3
Test AWS S3
2021-04-22 12:29:31 -07:00
Andrea Luzzardi
8cadd97c60
Merge pull request #344 from aluzzardi/registry-auth
support registry auth
2021-04-22 12:14:59 -07:00
Tom Chauveau
b3c29acb34 Add tests on AWS s3 upload directory
Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
2021-04-22 20:57:00 +02:00
Tom Chauveau
d5aa68fe2b Add test on AWS s3
Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
2021-04-22 19:18:26 +02:00
Andrea Luzzardi
d8193e55f1 tests: add test AWS config
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-04-21 11:03:32 -07:00
Andrea Luzzardi
692bd72095 support registry auth
HACK: the way buildkit works, we can only supply an Auth Provider for the entirety of the build session (`dagger up`). Therefore, we start by scanning all auth in the entire Cue tree and supply an auth provider for all of them.

Drawbacks:
- As soon as you add `auth` in a Pipeline for a registry, all other Pipelines have access to the same registry
- You can't use different credentials for the same registry

Fixes #301

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-04-20 15:28:33 -07:00
Tom Chauveau
46b8b92002 misc(README): update README.md to use bats tests
Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
2021-04-16 22:27:26 +02:00
Tom Chauveau
b691c95f2c fix(tests): Improve the verification of local kubernetes cluster to ignore "kind: Config" field of kubeconfig
fix(tests): Update documentation
fix(tests): Enable kubernetes tests

Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
2021-04-16 16:10:58 +02:00
Andrea Luzzardi
feda737d71 tests: convert stdlib to bats
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-04-15 16:09:19 -07:00
Andrea Luzzardi
ce2e00cfa2 tests: migrate compute tests to bats
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-04-15 15:55:51 -07:00
Andrea Luzzardi
1ac0041c53 test: react example: use dagger up instead of compute
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-04-15 15:09:39 -07:00
Andrea Luzzardi
14ca028918
Merge pull request #332 from dagger/dagger-inputs
support yaml and json inputs
2021-04-15 14:59:43 -07:00
Andrea Luzzardi
46ab44a69f input: support file/stdin source for text/json/yaml
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-04-15 13:04:52 -07:00
Andrea Luzzardi
6f57ed1b9d input: support yaml and json inputs
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-04-15 13:04:52 -07:00
Sam Alba
468ac1220a added comment about always flag + cue fmt
Signed-off-by: Sam Alba <sam.alba@gmail.com>
2021-04-15 12:34:15 -07:00
Sam Alba
cfa9f08bc9 tests: added test to ensure an op.#Exec with no cache will not execute twice
Signed-off-by: Sam Alba <sam.alba@gmail.com>
2021-04-15 12:10:14 -07:00
Tom Chauveau
32d523aa71 tests(stdlib/k8s/helm): test basic helm chart
tests(stdlib/k8s/helm): add verification
style(tests/): rename helper into verify to confirm that deployments works

Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
2021-04-15 14:24:42 +02:00
Tom Chauveau
e19a71e67c tests(stdlib): add kubernetes in testing suite
tests(stdlib/kubernetes): add kubernetes basic Apply test

Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
2021-04-15 12:37:32 +02:00
Andrea Luzzardi
d46be324e5 tests: improve bats/gh integration
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-04-15 00:48:49 -07:00
Andrea Luzzardi
fb2e140b91 tests: convert react example test to bats
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-04-14 17:19:53 -07:00
Andrea Luzzardi
1f640d3e25 tests: ops: use proper imports
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-04-14 16:44:34 -07:00
Andrea Luzzardi
381db37ca3 tests: migrate ops test to bats
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-04-14 16:15:04 -07:00
Andrea Luzzardi
e7458e9ca2 tests: use bats for integration tests
Converted the CLI tests to using bats to get started

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-04-14 15:18:34 -07:00
Sam Alba
5d22e9ed43 stdlib: updated alpine base image and fixed pkg dependencies in sub libs
Signed-off-by: Sam Alba <sam.alba@gmail.com>
2021-04-14 14:06:51 -07:00
Sam Alba
8e5024db37 fix alpine test + only select major versions for aws pkgs
Signed-off-by: Sam Alba <sam.alba@gmail.com>
2021-04-14 13:54:21 -07:00
Andrea Luzzardi
bb5542e26e Proper support for Docker Image metadata
- Both FetchContainer and DockerBuild read the image metadata and
  convert to LLB (e.g. `ENV foo bar` in Dockerfile shows up in
  `op.#Exec`)
- Image metadata is "sticky" between Pipelines (e.g. `op.#Load` will
  re-use the same metadata)
- Image metadata is injected back to #PushContainer, so that
  DockerBuild+PushContainer and FetchContainer+PushContainer do not lose
  any metadata.
- Tests for all the above

Fixes #142

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-04-12 17:47:58 -07:00
Andrea Luzzardi
a92423f186 tests: fix react example test
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-04-08 18:48:23 -07:00
Andrea Luzzardi
65ebbc8ecb tests: add query tests
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-04-08 18:38:18 -07:00
Andrea Luzzardi
43a34f0b04 tests: re-enable CLI tests, use the brand new query
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-04-08 18:11:15 -07:00
Solomon Hykes
ee621590ff stdlib: dagger.io/js/react
Signed-off-by: Solomon Hykes <sh.github.6811@hykes.org>
2021-04-07 16:28:39 -07:00
Solomon Hykes
6673ae69b3 stdlib: rename dagger.io/llb to dagger.io/dagger/op
Signed-off-by: Solomon Hykes <sh.github.6811@hykes.org>
2021-04-06 10:28:40 -07:00
Sam Alba
21e0ac21de fixed tests
Signed-off-by: Sam Alba <sam.alba@gmail.com>
2021-04-02 17:16:57 -07:00
Sam Alba
e6b0ca5109 cue fmt
Signed-off-by: Sam Alba <sam.alba@gmail.com>
2021-04-02 16:47:49 -07:00
Sam Alba
b12a3bf45f test: implemented cli tests for input git,dir
Signed-off-by: Sam Alba <sam.alba@gmail.com>
2021-04-02 16:47:49 -07:00
Sam Alba
f5afb97d03 test: implemented cli test for plan *
Signed-off-by: Sam Alba <sam.alba@gmail.com>
2021-04-02 16:47:22 -07:00
Sam Alba
8bb2cfbb21 test: added cli test for new --plan-git
Signed-off-by: Sam Alba <sam.alba@gmail.com>
2021-04-02 16:47:22 -07:00
Sam Alba
540f373993
Merge pull request #265 from dagger/query-formats
dagger query [--format cue|json|text|yaml] (default is json)
2021-04-02 16:20:39 -07:00
Andrea Luzzardi
c16455249e cue files: #compute -> #up
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-04-02 16:08:15 -07:00