need new environment variable like $SUP_PATH
run sup command:
sup -f sup/elk.yml local install
I need a variable to get path by supfile and find other file with relative path.
supfile content:
kibana2nginx:
desc: add kibana site conf to nginx
upload:
- src: ./elk/kibana.shihou.conf
dst: /etc/nginx/conf.d/
and file structure is:
- elk.yml
- elk/kibana.shihou.conf
it does not work.
Oh, this is interesting. By default, the working directory is equivalent to your $PWD (from which you're running sup). Are you ok with $SUPFILE_DIR?
Yep, I hope my deploy file can be checkout in everywhere and I can call sup in everywhere. only relative path in deploy files is clearly.
I think upload method could be add a param like base, example:
file structure:
- elk.yml
- elk/kibana.shihou.conf
supfile content:
kibana2nginx:
desc: add kibana site conf to nginx
upload:
- src: kibana.shihou.conf
dst: /etc/nginx/conf.d/
base: {$SUPFILE_DIR}/elk/
it will upload kibana.shihou.conf to /etc/nginx/conf.d/kibana.shihou.conf
I understand sup is design to called in the directory with Supfile, but these change can improve the versatility, such as substitute for ansible :-P
@andares sorry for picking this up so late. Did you intend to have $SUP_PATH that would print absolute path of current directory in the host? Or absolute path on the remote host?
I think it should be absolute path of supfile(.yml) in the host :-D
So, something like $SUPFILE_PATH or $SUPFILE_ABSOLUTE_PATH?
Can anyone help me figure this one out? How would we resolve an absolute path from something like ./Supfile or ~/dir/Supfile?
Anyone able to come up with a PR?