dqpi
Posts: 33
Joined: Fri May 24, 2013 12:22 pm

Update my code

Sun Feb 02, 2014 6:48 pm

I have a full website (and python script) that run locally on a couple of raspberry pi's. The same script and website is running on another server. What I want to do is, on startup of the raspberry pi, check if there are any changes (new versions) on the server and if so update the raspberry pi. It should apply to python scripts, html, css, jss, etc. Can someone point me in the right direction?

User avatar
DougieLawson
Posts: 39813
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Update my code

Sun Feb 02, 2014 6:53 pm

Put the code on git, use a git clone process to pull the latest version.

You can run a local version of git with something like Gitolite https://github.com/sitaramc/gitolite (it works well, I use it as a backup for everything I write that has any importance).
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All fake doctors are on my foes list.

dqpi
Posts: 33
Joined: Fri May 24, 2013 12:22 pm

Re: Update my code

Sun Feb 02, 2014 7:12 pm

That's great. I don't have experience with git but thanks for the direction. I need to have the files private though so that not everybody can download them. I see that github requires a paid account to have private projects. Would something like rsync work as well?

User avatar
DougieLawson
Posts: 39813
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Update my code

Sun Feb 02, 2014 9:53 pm

You can do it with rsync, but you'll have to write more code. Git may be ugly but there's a whole bunch of free code out there to play with it. I like gitolite quite simply because I can keep a consistent copy and can easily get my code on my RPi or on my Ubuntu server and I get the protection of being able to go back to the previous (committed) version if things go wrong. Also the data is held on my Zyxel NAS 2TB drive not on an SDCard or Ubuntu hard drive, that gives some protection against drive/card failure.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All fake doctors are on my foes list.

Return to “Beginners”