sup icon indicating copy to clipboard operation
sup copied to clipboard

need new environment variable like $SUP_PATH

Open andares opened this issue 9 years ago • 8 comments

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.

andares avatar Oct 13 '16 09:10 andares

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.

andares avatar Oct 13 '16 09:10 andares

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?

VojtechVitek avatar Oct 13 '16 14:10 VojtechVitek

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.

andares avatar Oct 13 '16 16:10 andares

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

andares avatar Oct 13 '16 16:10 andares

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 avatar Oct 13 '16 16:10 andares

@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?

VojtechVitek avatar Jan 17 '18 16:01 VojtechVitek

I think it should be absolute path of supfile(.yml) in the host :-D

andares avatar Jan 18 '18 11:01 andares

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?

VojtechVitek avatar Jan 18 '18 19:01 VojtechVitek