From a903f917c42d103283b4d4426a86cd69d9099d84 Mon Sep 17 00:00:00 2001 From: Tihomir Jovicic Date: Tue, 31 Aug 2021 06:22:49 +0200 Subject: [PATCH 1/2] update package manager docs with new dagger/packages repo Signed-off-by: Tihomir Jovicic --- docs/learn/1011-package-manager.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/learn/1011-package-manager.md b/docs/learn/1011-package-manager.md index c0679930..6b32e6f2 100644 --- a/docs/learn/1011-package-manager.md +++ b/docs/learn/1011-package-manager.md @@ -39,14 +39,14 @@ That will create 2 directories: `.dagger` and `cue.mod` where our package will r ### Install -In our example we will use `gcpcloudrun` module from [github](https://github.com/tjovicic/dagger-modules/blob/main/gcpcloudrun/source.cue) +In our example we will use `gcpcloudrun` module from [github](https://github.com/dagger/packages/blob/main/gcpcloudrun/source.cue) Let's first add it to our `source.cue` file: ```cue title="./source.cue" package main import ( - "github.com/tjovicic/dagger-modules/gcpcloudrun" + "github.com/dagger/packages/gcpcloudrun" ) run: gcpcloudrun.#Run @@ -55,7 +55,7 @@ run: gcpcloudrun.#Run To install it just run ```shell -dagger mod get github.com/tjovicic/dagger-modules/gcpcloudrun@v0.1 +dagger mod get github.com/dagger/packages/gcpcloudrun@v0.1 ``` It should pull the `v0.1` version from Github, leave a copy in `cue.mod/pkg` and reflect the change in @@ -63,8 +63,8 @@ It should pull the `v0.1` version from Github, leave a copy in `cue.mod/pkg` and ```shell cue.mod/pkg/github.com/ -└── tjovicic - └── dagger-modules +└── dagger + └── packages └── gcpcloudrun ├── cue.mod ├── README.md @@ -72,7 +72,7 @@ cue.mod/pkg/github.com/ ``` ```cue title="./cue.mod/dagger.mod" -github.com/tjovicic/dagger-modules/gcpcloudrun v0.1 +github.com/dagger/packages/gcpcloudrun v0.1 ``` Querying the current setup with `dagger query` should return a valid result: @@ -102,17 +102,17 @@ Querying the current setup with `dagger query` should return a valid result: Now that you've successfully installed a package, let's try to upgrade it. ```shell -dagger mod get github.com/tjovicic/dagger-modules/gcpcloudrun@v0.2 +dagger mod get github.com/dagger/packages/gcpcloudrun@v0.2 ``` You should see similar output: ```shell -12:25PM INF system | downloading github.com/tjovicic/dagger-modules:v0.2 +12:25PM INF system | downloading github.com/dagger/packages:v0.2 ``` And `cue.mod/dagger.mod.cue` should reflect the new version: ```cue title="./cue.mod/dagger.mod" -github.com/tjovicic/dagger-modules/gcpcloudrun v0.2 +github.com/dagger/packages/gcpcloudrun v0.2 ``` From 73dc0200c3a786686d4dc01024635f646cccc298 Mon Sep 17 00:00:00 2001 From: Tihomir Jovicic Date: Tue, 31 Aug 2021 09:13:11 +0200 Subject: [PATCH 2/2] Explain how to develop packages locally Signed-off-by: Tihomir Jovicic --- docs/learn/1011-package-manager.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/learn/1011-package-manager.md b/docs/learn/1011-package-manager.md index 6b32e6f2..4368e27c 100644 --- a/docs/learn/1011-package-manager.md +++ b/docs/learn/1011-package-manager.md @@ -39,7 +39,7 @@ That will create 2 directories: `.dagger` and `cue.mod` where our package will r ### Install -In our example we will use `gcpcloudrun` module from [github](https://github.com/dagger/packages/blob/main/gcpcloudrun/source.cue) +In our example we will use `gcpcloudrun` package from [github](https://github.com/dagger/packages/blob/main/gcpcloudrun/source.cue) Let's first add it to our `source.cue` file: ```cue title="./source.cue" @@ -116,3 +116,13 @@ And `cue.mod/dagger.mod.cue` should reflect the new version: ```cue title="./cue.mod/dagger.mod" github.com/dagger/packages/gcpcloudrun v0.2 ``` + +## Develop package locally + +Currently, package manager cannot add local packages so a workaround is linking the package to `cue.mod/pkg`. +Create a directory with your domain name, usually github.com/myuser, and link your package directory. + +```shell +mkdir cue.mod/pkg/ +ln -s cue.mod/pkg// +```