github.com/upcmd/up@v0.8.1-0.20230108151705-ad8b797bf04f/tests/modtests/0011/doc.yml (about) 1 vars: 2 folder: module 3 title: module multi vesioning 4 weight: 2151 5 log: yes 6 head: | 7 Showcase how to manage multiple versions of same module in its version directories 8 sections: 9 - title: Use version git repo as module directory 10 content: | 11 12 If the module is code in git repo, the other way to organize the module and version is to checkout each version of that module and put it into a module directory - .modules, like below: 13 14 ``` 15 myproject 16 ├── hello-module 17 │ ├── up.yml 18 │ └── upconfig.yml 19 │ └── upconfig.yml 20 ├── .modules 21 │ ├── hi-module@release_1.2.3 22 │ └── up.yml 23 │ ├── hi-module@feature_branch 24 │ └── up.yml 25 │ ├── hi-module@e8e9dc5dc913e211fdaa3bf1bd8a6618e602e8ff 26 │ └── up.yml 27 │ ├── hi-module@e8e9dc5 28 │ └── up.yml 29 ├───── world-module 30 │ ├── up.yml 31 │ └── upconfig.yml 32 ├───── up.yml 33 └───── upconfig.yml 34 ``` 35 36 - title: module pull 37 content: | 38 ``` 39 Ξ ▶ mod pull -d ./tests/modtests/0011 -i dev --configdir=$./tests/modtests/ -w refdir 40 loading [Config]: ./tests/modtests/0011/upconfig.yml 41 Main config: 42 Version -> 1.0.0 43 RefDir -> ./tests/modtests/0011 44 WorkDir -> refdir 45 TaskFile -> up.yml 46 Verbose -> vvv 47 ModuleName -> reverent_archimedes3 48 MaxCallLayers -> 8 49 work dir: ./tests/modtests/0011 50 loading [Task]: ./up.yml 51 module: [reverent_archimedes3] instance id: [dev] 52 -validate all modules: 53 -pull repos: 54 +------------+-------------------------------------------+ 55 | PROPERTY | VALUE | 56 +------------+-------------------------------------------+ 57 | alias | hello | 58 | dir | .upmodules/hello@v2 | 59 | repo | https://github.com/upcmd/hello-module.git | 60 | version | v2 | 61 | pullpolicy | skip | 62 | instanceid | nonamed | 63 | subdir | | 64 +------------+-------------------------------------------+ 65 WARN: [module repo exist: skipped] - [repo: [.upmodules/hello@v2]] 66 checkout version 67 checkout version: v2 ... 68 git checkout v2 69 Already on 'v2' 70 Your branch is up to date with 'origin/v2'. 71 +------------+-------------------------------------------+ 72 | PROPERTY | VALUE | 73 +------------+-------------------------------------------+ 74 | alias | hello-dummy1 | 75 | dir | .upmodules/hello-dummy1@master | 76 | repo | https://github.com/upcmd/hello-module.git | 77 | version | master | 78 | pullpolicy | always | 79 | instanceid | nonamed | 80 | subdir | | 81 +------------+-------------------------------------------+ 82 removing .upmodules/hello-dummy1@master ...Enumerating objects: 9, done. 83 Counting objects: 100% (9/9), done. 84 Compressing objects: 100% (4/4), done. 85 Total 9 (delta 2), reused 9 (delta 2), pack-reused 0 86 checkout version 87 checkout version: master ... 88 git checkout master 89 Already on 'master' 90 Your branch is up to date with 'origin/master'. 91 +------------+------------------------------------------------------------------+ 92 | PROPERTY | VALUE | 93 +------------+------------------------------------------------------------------+ 94 | alias | hello-dummy2 | 95 | dir | .upmodules/hello-dummy2@25456bbcd17db524d1148e42bdcc3bb36ce90042 | 96 | repo | https://github.com/upcmd/hello-module.git | 97 | version | 25456bbcd17db524d1148e42bdcc3bb36ce90042 | 98 | pullpolicy | always | 99 | instanceid | nonamed | 100 | subdir | | 101 +------------+------------------------------------------------------------------+ 102 removing .upmodules/hello-dummy2@25456bbcd17db524d1148e42bdcc3bb36ce90042 ...Enumerating objects: 9, done. 103 Counting objects: 100% (9/9), done. 104 Compressing objects: 100% (4/4), done. 105 Total 9 (delta 2), reused 9 (delta 2), pack-reused 0 106 checkout version 107 checkout version: 25456bbcd17db524d1148e42bdcc3bb36ce90042 ... 108 git checkout 25456bbcd17db524d1148e42bdcc3bb36ce90042 109 Note: switching to '25456bbcd17db524d1148e42bdcc3bb36ce90042'. 110 ``` 111 112 - title: module list 113 content: | 114 ``` 115 Ξ ▶ mod list -d ./tests/modtests/0011 -i dev --configdir=./tests/modtests/0011 -w refdir 116 loading [Config]: ./tests/modtests/0011/upconfig.yml 117 Main config: 118 Version -> 1.0.0 119 RefDir -> ./tests/modtests/0011 120 WorkDir -> refdir 121 TaskFile -> up.yml 122 Verbose -> vvv 123 ModuleName -> elated_payne9 124 MaxCallLayers -> 8 125 work dir: ./tests/modtests/0011 126 loading [Task]: ./up.yml 127 module: [elated_payne9] instance id: [dev] 128 -list all modules: 129 +-----+--------------+------------------------------------------------------------------+-------------------------------------------+------------------------------------------+------------+------------+--------+ 130 | IDX | ALIAS | DIR | REPO | VERSION | PULLPOLICY | INSTANCEID | SUBDIR | 131 +-----+--------------+------------------------------------------------------------------+-------------------------------------------+------------------------------------------+------------+------------+--------+ 132 | 1 | hello-module | hello-module/ | | | | nonamed | | 133 | 2 | hello | .upmodules/hello@v2 | https://github.com/upcmd/hello-module.git | v2 | skip | nonamed | | 134 | 3 | hello-dummy1 | .upmodules/hello-dummy1@master | https://github.com/upcmd/hello-module.git | master | always | nonamed | | 135 | 4 | hello-dummy2 | .upmodules/hello-dummy2@25456bbcd17db524d1148e42bdcc3bb36ce90042 | https://github.com/upcmd/hello-module.git | 25456bbcd17db524d1148e42bdcc3bb36ce90042 | always | nonamed | | 136 +-----+--------------+------------------------------------------------------------------+-------------------------------------------+------------------------------------------+------------+------------+--------+ 137 -validate all modules: 138 ``` 139 140 141 - title: config file - upconfig.yml 142 filelookup: upconfig.yml 143 144 - title: up task - up.yml 145 filelookup: up.yml 146 147 - title: up module task - up.yml 148 filelookup: hello-module/up.yml 149 150 - title: up module config - upconfig.yml 151 filelookup: hello-module/upconfig.yml 152 153 - title: hi module task - up.yml 154 filelookup: hi-module/up.yml