开发者

How to deploy git-versioned web apps through WebDAV?

开发者 https://www.devze.com 2023-03-18 23:59 出处:网络
I have: Mac OS X web app being developed using PHP, etc basic git knowledge ;) remote hosting server with WebDav access

I have:

  • Mac OS X
  • web app being developed using PHP, etc
  • basic git knowledge ;)
  • remote hosting server with WebDav access
  • possibility to manage server files using local git binary via Terminal and WebDav

I don't have:

  • git installed on my remote server
  • ssh access to my remote server

What I do now?

  1. Develop my app locally.
  2. Mount remote server as volume using WebDav (remote files behave like "normal" files in MacOSX)
  3. Copy and replace (upload) my web app to remote server using normal OSX functionality.

What I want to do?

  • Track my web app files using git (git init,add,commit works well as for now)
  • Deploy (upload) my web app to the server using git and WebDav.

What is the best way to achieve these goals? I am able to use local binary of git app on remote files using Terminal and "cd"-ing to them thanks to the mounted WebDav volume. What's next? Do I set up a "git remote" on my local repo and then push changes to the server? Or maybe vice versa, I set up a git remote on my server repo and pull changes from my local repo?

I imagine that I could for example have two deployment directories on the server, one that I push a stable branch to (public accessed website version) and the other one for testing purposes ("unstable branch"). I could easily return to an older version of website if something doesn't work using git...

Tha开发者_Python百科nks in advance for your help, I promise that I tried to find a good solution myself, but didn't find anything that would answer all my questions.


You can huse githooks. They are small scripts that are executed after some actions in git.

For instance, if you want to upload your repository to the webdab folder everytime you commit some changes, you can add a hook on commit with cp -fr /your_git_dir/* /your_webdav_dir/

0

精彩评论

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

关注公众号