Git deplyoment question


#1

Hi,

I have a few question about how to use git properly with gearhost.

I have deployed a CMS with git and that’s fine.

So now the user upload some images or makes changes to files through the CMS if i do git push again will it overwrite the remote files that were change by the CMS with my local files ?

I expect that it will and that i should do git pull first but git pull always tells me i am uptodate.

If the file system changes from another source via FTP or by the CMS itself does that mean i can only use FTP ?


#2

Sounds like you are not doing a server-side git commit. You would need to use terminal access to run git commit and then a git push to your respiratory. Once you have done this you would need to pull it down to your local computer from the respiratory. Hope this helps. :smile:


#3

No not really helpfull.

Obviously when the content editor makes changes and CMS saves them to file a GIT commit is not made.
If there was a gerhost API call to create a GIT commit i could change the CMS to make a commit when it changes files but it seems there is no such gearhost API function.

I can use terminal access with gear host to commit files on the server ?
How do i do this ?


#4

I am not sure if it will work based on the permissions given to us on cloudsites but php have a function called shell_exec which allows you to execute command line. Or better yet after a bit of googling I found a bit wrapper in php.

Perhaps this can be utilized to build a solution. Again not sure if the permissions on the server will allow but this is the alternative I would suggested based on the lack of terminal access or an API call.


#5

Well you were right there is a terminal i had no clue, its not documented.
https://[sitename].scm.gear.host/DebugConsole

there is an entire kudu console so many great features

a lot of people are asking for feature that already exist…
– remote site replication
– phpmyadmin
– golang
– visual studio online (awesome)

Its also possible to connect to it with kodoexec client and use the terminal from your computer.

But it is also possible to to use the wwwroot folder as repository then git pull works as i expect but then no more git roll backs, but great for using git to backup the entire site with one command.

This app setting is needed to be added
name: SCM_REPOSITORY_PATH
value: wwwroot

After that i tried making commits through visual studio online and git pull worked.

More info about it:
[https://github.com/projectkudu/kudu/wiki/Deploying-inplace-and-without-repository][1]

And here is someone describing it in more detail with using umbraco:
[http://www.andrewconnell.com/HowTo-Improved-Two-Way-Deployment-Sync-To-Azure-Web-Sites][2]
[1]: https://github.com/projectkudu/kudu/wiki/Deploying-inplace-and-without-repository
[2]: http://www.andrewconnell.com/HowTo-Improved-Two-Way-Deployment-Sync-To-Azure-Web-Sites


#6

Kudu’s documentation can be found here https://www.gearhost.com/documentation/how-to-use-kudu.
hope this helps
cheers