1

I want to create a program that runs continuously on background and checks if there is an update in the git repo. If there is it will automatically update on the local.

For example:

I have a project of continuously reading data from 2-3 sensors and send it to thingspeak. Now I have updated the git repo for this project and it now supports more than 3 sensors of different types.

This script should continuously check for an update in the repo and update it on local. If possible it should also look for release versions.

I tried to search and found this:

https://dzone.com/articles/github-continuous-deployment-to-a-raspberry-pi

and

https://www.engineersgarage.com/contributions/automatic-software-update-by-iot-device-over-ftp-protocol-iot-part-44/

Anyone has any idea how to do it or any reference to example/tutorial?

Lucifer
  • 195
  • 1
  • 7
  • What's the problem with the sources? – M. Rostami Jan 06 '20 at 07:12
  • @M.Rostami Sorry, I did not understand what you are trying to say. – Lucifer Jan 06 '20 at 07:23
  • Did you follow the references? https://www.engineersgarage.com/contributions/automatic-software-update-by-iot-device-over-ftp-protocol-iot-part-44/ https://dzone.com/articles/github-continuous-deployment-to-a-raspberry-pi – M. Rostami Jan 06 '20 at 08:05
  • It "sounds like" you may be able to do what you want with git and cron. Are you familiar nough with git ti write a script to do the updates you want? If so, edit your question to include the git code/command sequence, and we can help with the cron setup. – Seamus Jan 06 '20 at 08:15
  • @M.Rostami yes. I read the full document and Created a free server on biz.nf. Ok so you are saying what is the problem using this FTP server as a source, right? I searched and found that FTP servers are not secure and also I am currently searching for its best alternative or upgrade which is secure. Then I looked into "Mycroft-open source voice assistant" and they created a skill, core repo on git and were doing automate update through it. I thought I can try and learn this. I am just doing it as a learning process. – Lucifer Jan 06 '20 at 10:14
  • @Seamus I am not that much familiar with it but I know basic add, commit, git-flow init, merge conflict, push and pull just the basics. If you can give reference to an example or tutorial I can try to create on my own. – Lucifer Jan 06 '20 at 10:16
  • "checks if there is an update in the git repo. If there is it will automatically update on the local." -> That is what git does. This is like saying, "I would like something on my phone to check if my friend is answering his phone, and, if so, call him." O_O? Just call him. – goldilocks Jan 06 '20 at 13:03
  • @goldilocks so you are saying every sometimes do git fetch or git pull for that repo? – Lucifer Jan 06 '20 at 14:05
  • Yes; use the full repo and branch name (eg. git pull origin master). You could redirect the output to a log file (git pull origin master &> somefile.txt; beware &> is a bashism); it will just say "Already up to date". – goldilocks Jan 06 '20 at 15:05
  • @goldilocks Thank you. I will try it and will see if I can update it any more or not. – Lucifer Jan 07 '20 at 05:42

0 Answers0