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

The ability to add confirmation to a specific server #595

Open
Sofianio opened this issue Oct 20, 2020 · 4 comments
Open

The ability to add confirmation to a specific server #595

Sofianio opened this issue Oct 20, 2020 · 4 comments
Labels
enhancement New feature or improvement

Comments

@Sofianio
Copy link

Enhancement

It would be helpful to have the ability to add confirmation to a specific server before pushing changes

Use case:
Imagine you configured 2 servers,
Beta server in which you test under development functionalities
Prod server where the stable version is
You can easily run git ftp push -s prod and break the production App
(I'm not saying it happened to me because I thought I was on another project)

So it would be helpful if there was a confirmation question like "Are you sure you want to push to AppName Production ?"
It can be set up for a server like so:

[git-ftp "prod"]
	url = sftp://123.321.12.21:22/app_folder/web
	user = admin
	password = ******
        confirmation_message= "Are you sure you want to push to AppName Production ?"
@LukasFritzeDev LukasFritzeDev added the enhancement New feature or improvement label Oct 25, 2020
@LukasFritzeDev
Copy link
Collaborator

Thanks for this idea.

I added the enhancement tag so we have it in our possible features list. But since we don't have that much time to develop the project, it may take some (or a lot) time to implement it.

On the other hand you could easily implement such a check in a Hook for pre-ftp-push. If you want to know how hooks work, please refer to the manual.

@Sofianio
Copy link
Author

Thank you for considering my suggestion,

I read the manual but didn't find how to use the pre-ftp-push hook

I tried this:

[git-ftp "prod"]
	...
        pre-ftp-push=script.sh

But it didn't work, can you please give me an example?

@LukasFritzeDev
Copy link
Collaborator

Oh. Git hooks is an official git feature:

The hooks are all stored in the hooks subdirectory of the Git directory. In most projects, that’s .git/hooks. When you initialize a new repository with git init, Git populates the hooks directory with a bunch of example scripts … (source)

You have to place your script file in .git/hooks with the name pre-ftp-push and it will be called automatically.

@Sofianio
Copy link
Author

Sofianio commented Nov 2, 2020

Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement
Projects
None yet
Development

No branches or pull requests

2 participants