github.com/upcmd/up@v0.8.1-0.20230108151705-ad8b797bf04f/tests/modtests/0013/doc.yml (about) 1 vars: 2 folder: module 3 title: manage indirect dependencies 4 weight: 2153 5 log: yes 6 head: | 7 Your code may reference to an external module repo, then that repo again references to the third module and this could go on and on. This shows how to detect those indirect module dependencies and how to automatically pull and update those dependencies into your local 8 9 sections: 10 - title: Pull all module dependencies including indirect one 11 content: | 12 Please notice that in this case, the only reference is a local module in directory hello-module which as a dependency on a git repo, then that git repo module has another dependency, so the direct dependenc is 1, but the indirect dependencies are 2 13 14 You can pull module dependencies including indirect one 15 ``` 16 Ξ ▶ up mod pull -d ./tests/modtests/0013 -i dev --configdir=./tests/modtests/0013 -w refdir 17 loading [Config]: ./tests/modtests/0013/upconfig.yml 18 Main config: 19 Version -> 1.0.0 20 RefDir -> ./tests/modtests/0013 21 WorkDir -> refdir 22 AbsWorkDir -> ./tests/modtests/0013 23 TaskFile -> up.yml 24 Verbose -> vvv 25 ModuleName -> drunk_nobel1 26 MaxCallLayers -> 8 27 MaxModuelCallLayers -> 8 28 work dir: ./tests/modtests/0013 29 loading [Task]: ./up.yml 30 module: [drunk_nobel1] instance id: [dev] 31 -validate all modules: 32 -pull repos: 33 loading [Config]: ./tests/modtests/0013/hello-module/upconfig.yml 34 35 -main direct modules: 36 - repo: https://github.com/upcmd/hello-module.git 37 tag: "" 38 version: crosstalk1 39 alias: crosstalk1 40 dir: "" 41 subdir: "" 42 iid: "" 43 pullpolicy: always 44 45 +------------+-------------------------------------------+ 46 | PROPERTY | VALUE | 47 +------------+-------------------------------------------+ 48 | alias | crosstalk1 | 49 | dir | .upmodules/crosstalk1@crosstalk1 | 50 | repo | https://github.com/upcmd/hello-module.git | 51 | version | crosstalk1 | 52 | pullpolicy | always | 53 | instanceid | nonamed | 54 | subdir | | 55 +------------+-------------------------------------------+ 56 Enumerating objects: 30, done. 57 Counting objects: 100% (30/30), done. 58 Compressing objects: 100% (19/19), done. 59 Total 30 (delta 9), reused 26 (delta 5), pack-reused 0 60 checkout version 61 checkout version: crosstalk1 ... 62 git checkout crosstalk1 63 Branch 'crosstalk1' set up to track remote branch 'crosstalk1' from 'origin'. 64 Switched to a new branch 'crosstalk1' 65 loading [Config]: .upmodules/crosstalk1@crosstalk1/upconfig.yml 66 +------------+-------------------------------------------+ 67 | PROPERTY | VALUE | 68 +------------+-------------------------------------------+ 69 | alias | crosstalk2 | 70 | dir | .upmodules/crosstalk2@crosstalk2 | 71 | repo | https://github.com/upcmd/hello-module.git | 72 | version | crosstalk2 | 73 | pullpolicy | always | 74 | instanceid | nonamed | 75 | subdir | | 76 +------------+-------------------------------------------+ 77 Enumerating objects: 30, done. 78 Counting objects: 100% (30/30), done. 79 Compressing objects: 100% (19/19), done. 80 Total 30 (delta 9), reused 26 (delta 5), pack-reused 0 81 checkout version 82 checkout version: crosstalk2 ... 83 git checkout crosstalk2 84 Branch 'crosstalk2' set up to track remote branch 'crosstalk2' from 'origin'. 85 Switched to a new branch 'crosstalk2' 86 loading [Config]: .upmodules/crosstalk2@crosstalk2/upconfig.yml 87 ``` 88 89 - title: Priority to override the required indirect module version 90 content: | 91 In case there is a indirect module used by one of the modules you use 92 93 94 ``` 95 module declaration in one of the upconfig.yml 96 97 - repo: https://github.com/upcmd/hello-module.git 98 alias: crosstalk1 99 version: crosstalk1 100 pullpolicy: always 101 ``` 102 103 104 Normally you don't need to declare a indirect module, when you use up mod pull, the above module will be cloned to your local .modules directory. But if you do, shown as below, that means you explicitly demand to use the same repo(you can use another repo too) but different branch instead. This will take priority and above versioning code base will not be used. 105 106 Note this will impact the behavior of your sub modules, you must be clear what you are doing when you use this technic 107 108 ``` 109 module declaration in the main upconfig.yml 110 111 - repo: https://github.com/upcmd/hello-module.git 112 alias: crosstalk1 113 version: feature 114 pullpolicy: always 115 ``` 116 117 118 - title: Probe all dependant modules details 119 content: | 120 121 ``` 122 ▶ up mod probe -d ./tests/modtests/0013 -i dev --configdir=./tests/modtests/0013 -w refdir 123 loading [Config]: ./tests/modtests/0013/upconfig.yml 124 Main config: 125 Version -> 1.0.0 126 RefDir -> ./tests/modtests/0013 127 WorkDir -> refdir 128 AbsWorkDir -> ./tests/modtests/0013 129 TaskFile -> up.yml 130 Verbose -> vvv 131 ModuleName -> drunk_ritchie8 132 MaxCallLayers -> 8 133 MaxModuelCallLayers -> 8 134 work dir: ./tests/modtests/0013 135 loading [Task]: ./up.yml 136 module: [drunk_ritchie8] instance id: [dev] 137 -list all modules: 138 loading [Config]: ./tests/modtests/0013/hello-module/upconfig.yml 139 140 -main direct modules: 141 - repo: https://github.com/upcmd/hello-module.git 142 tag: "" 143 version: crosstalk1 144 alias: crosstalk1 145 dir: "" 146 subdir: "" 147 iid: "" 148 pullpolicy: always 149 150 - Insights: 151 +-----+------------+----------------------------------+-------------------------------------------+------------+------------+------------+--------+ 152 | IDX | ALIAS | DIR | REPO | VERSION | PULLPOLICY | INSTANCEID | SUBDIR | 153 +-----+------------+----------------------------------+-------------------------------------------+------------+------------+------------+--------+ 154 | 1 | crosstalk1 | .upmodules/crosstalk1@crosstalk1 | https://github.com/upcmd/hello-module.git | crosstalk1 | always | nonamed | | 155 +-----+------------+----------------------------------+-------------------------------------------+------------+------------+------------+--------+ 156 157 loading [Config]: ./tests/modtests/0013/.upmodules/crosstalk1@crosstalk1/upconfig.yml 158 loading [Config]: ./tests/modtests/0013/.upmodules/crosstalk2@crosstalk2/upconfig.yml 159 160 -indirect sub modules: 161 - repo: https://github.com/upcmd/hello-module.git 162 tag: "" 163 version: crosstalk2 164 alias: crosstalk2 165 dir: "" 166 subdir: "" 167 iid: "" 168 pullpolicy: always 169 - repo: https://github.com/upcmd/hello-module.git 170 tag: "" 171 version: crosstalk1 172 alias: crosstalk1 173 dir: "" 174 subdir: "" 175 iid: "" 176 pullpolicy: always 177 178 - Insights: 179 +-----+------------+----------------------------------+-------------------------------------------+------------+------------+------------+--------+ 180 | IDX | ALIAS | DIR | REPO | VERSION | PULLPOLICY | INSTANCEID | SUBDIR | 181 +-----+------------+----------------------------------+-------------------------------------------+------------+------------+------------+--------+ 182 | 1 | crosstalk2 | .upmodules/crosstalk2@crosstalk2 | https://github.com/upcmd/hello-module.git | crosstalk2 | always | nonamed | | 183 | 2 | crosstalk1 | .upmodules/crosstalk1@crosstalk1 | https://github.com/upcmd/hello-module.git | crosstalk1 | always | nonamed | | 184 +-----+------------+----------------------------------+-------------------------------------------+------------+------------+------------+--------+ 185 ``` 186 187 188 - title: config file - upconfig.yml 189 filelookup: upconfig.yml 190 191 - title: up task - up.yml 192 filelookup: up.yml 193 194 - title: up module task - up.yml 195 filelookup: hello-module/up.yml 196 197 - title: up module config - upconfig.yml 198 filelookup: hello-module/upconfig.yml 199 200 - title: crosstalk1 - up.yml 201 filelookup: .upmodules/crosstalk1@crosstalk1/up.yml 202 - title: crosstalk1 - upconfig.yml 203 filelookup: .upmodules/crosstalk1@crosstalk1/upconfig.yml 204 205 - title: crosstalk2 - up.yml 206 filelookup: .upmodules/crosstalk1@crosstalk1/up.yml 207 - title: crosstalk2 - upconfig.yml 208 filelookup: .upmodules/crosstalk2@crosstalk2/upconfig.yml