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

need new environment variable like $SUP_PATH #99

Open
andares opened this issue Oct 13, 2016 · 8 comments · May be fixed by #176
Open

need new environment variable like $SUP_PATH #99

andares opened this issue Oct 13, 2016 · 8 comments · May be fixed by #176

Comments

@andares
Copy link

andares commented Oct 13, 2016

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
Copy link
Author

andares commented Oct 13, 2016

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.

@VojtechVitek
Copy link
Collaborator

VojtechVitek commented Oct 13, 2016

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?

@andares
Copy link
Author

andares commented Oct 13, 2016

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
Copy link
Author

andares commented Oct 13, 2016

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
Copy link
Author

andares commented Oct 13, 2016

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

@VojtechVitek
Copy link
Collaborator

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

@andares
Copy link
Author

andares commented Jan 18, 2018

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

@VojtechVitek
Copy link
Collaborator

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?

stengaard added a commit to stengaard/sup that referenced this issue Feb 9, 2020
This will allow Supfiles to be run different directories and
consistently resolve files relative to the Supfile.

Fixes pressly#99
stengaard added a commit to stengaard/sup that referenced this issue Feb 9, 2020
This will allow Supfiles to be run different directories and
consistently resolve files relative to the Supfile.

Fixes pressly#99
stengaard added a commit to stengaard/sup that referenced this issue Feb 9, 2020
This will allow Supfiles to be run different directories and
consistently resolve files relative to the Supfile.

This CL contains refactors the resolution order of environment
variables such that it's a bit easier to reason about.

Fixes pressly#99
stengaard added a commit to stengaard/sup that referenced this issue Feb 9, 2020
This will allow Supfiles to be run different directories and
consistently resolve files relative to the Supfile.

This CL contains refactors the resolution order of environment
variables such that it's a bit easier to reason about.

Fixes pressly#99
stengaard added a commit to stengaard/sup that referenced this issue Feb 9, 2020
This will allow Supfiles to be run different directories and
consistently resolve files relative to the Supfile.

This CL contains refactors the resolution order of environment
variables such that it's a bit easier to reason about.

Fixes pressly#99
@stengaard stengaard linked a pull request Feb 9, 2020 that will close this issue
stengaard added a commit to stengaard/sup that referenced this issue Feb 22, 2020
This will allow Supfiles to be run different directories and
consistently resolve files relative to the Supfile.

This CL contains refactors the resolution order of environment
variables such that it's a bit easier to reason about.

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

Successfully merging a pull request may close this issue.

2 participants