开发者

Using git push on my server using Ant build -- how do I deal with having to input my password

I'm not sure if this is an odd setup to begin with, but here's my problem regardless:

I have a git repository at the following: git.foo.com/repos/foo.com.git

I clone that repository both on my local machine and my server, such that when I make changes to my local checkout, commit and push, I can do a pull and the changes are reflected on the live site. It's how I guess I deploy from local to live for now.

However, because I have a WP setup and there are assets that are copied to my server and processed (for example made into cacheable resources and shrunk for mobile if they're images), I'd like to have the deployment work backwards and automatically as well.

Locally this is fine because I have SSH keys setup to validate me, such that doing git push goes off without a hitch. However, when I do git push on the server after some files have been added and processed, it prompts for a password and makes it impossible to automize.

What are my options at this point? I've tried inputting the password via a text file, which I don't feel comfortable with in the first place since that's bad practice; I've tried setting up SSH keys on my server which seems odd since it would be valid开发者_StackOverflowating itself...

I'm at a loss for words as to how to describe my problem, but hopefully someone has encountered a similar problem with backwards deployment (having changes on the server be committed and pushed to the repository).

Thanks!


If your problem is about connecting from your server to the same or another server by ssh:

Have a look at ssh-agent (and agent-forwarding in the ssh connection). This allows you to have your keys only locally, while using them for a connection from the server.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜