Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add 'getlib' to get vendor library functions #25

Open
icasimpan opened this issue May 25, 2020 · 1 comment
Open

add 'getlib' to get vendor library functions #25

icasimpan opened this issue May 25, 2020 · 1 comment

Comments

@icasimpan
Copy link
Collaborator

icasimpan commented May 25, 2020

command sample:

shcf_cli getlib <project_name> shcf-lib/abs_value:v1.0

underneath, it would be (tag abs_value-v1.0 in https://github.com/icasimpan/shcf-lib):

git clone --branch abs_value-v1.0 https://github.com/icasimpan/shcf-lib

or, without the ":v1.0" specified at the end, latest tag will be used and is always the same as branch "stable/abs_value in https://github.com/icasimpan/shcf-lib.

.shcf-vendor.lock - lock file similar in purpose to composer.json.lock
create a

shcf-vendor.lock

with format:

          [repodomain.ext/username/]<libname>:vX.Y:sha256sum
          [repodomain.ext/username] -> defaults to github.com/icasimpan/shcf-lib

---> so that external repositories can be made like github.com/maeng/shcf-lib/

in "getlib", make sure:

      stable/<lib_name>
                \- lib/<lib_name>.bash.inc    => goes to lib/
                \- etc/init.conf                 => app_defs.conf
                \- etc/binaries.conf         => binaries.conf (filter out existing one)
                \- dependencies.cfg       => dependency libraries of <lib_name>.in each line
                \- version_hash.cfg.        => [repodomain.ext/username/]<libname>:vX.Y:<hash>

where hash is taken as follows:

~$ for x in $(find ./shcf-lib/abs_value -type f|grep -v .git|grep -v version_hash.cfg); do sha256sum $x; done|sha256sum|cut -d' ' -f1
17eafc47d1e9919168aeaaaef1038a1bf953a7c8adaf4731453e9559593c9b26

Libraries are written into 'vendor' folder in shcf core for audit purposes but copied into corresponding project's 'lib' directory.

@icasimpan
Copy link
Collaborator Author

icasimpan commented May 26, 2020

Initial implementation committed to branch 'getlib'. Check the TODO in

core/lib/create_getlib.bash.inc
and this was unimplemented yet:
shcf-vendor.lock
NOTE: it shouldn't be hidden so no dot as first character of vendor-lock name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant