Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve way to update config.yaml on the Doorbots #11

Open
amcewen opened this issue Jun 16, 2015 · 6 comments
Open

Improve way to update config.yaml on the Doorbots #11

amcewen opened this issue Jun 16, 2015 · 6 comments

Comments

@amcewen
Copy link
Member

amcewen commented Jun 16, 2015

The canonical copy of the config.yaml lives in bitbucket. However, so far we tend to update it on doorbot1 and just copy it across.

The reload-all-config.sh script should perform a git pull rather than copying things across.

@DefProc
Copy link

DefProc commented Jul 9, 2015

Or would a post-update or post-receive hook allow auto updates when pushed, e.g.

  • run git push
  • hook ssh's to each doorbot in turn and runs git pull
  • success/failure info appears in the terminal during the push

Or would a separate script be better, e.g.

  • make commit and push to settings repo
  • run script to ssh to each doorbot and git pull

@DefProc
Copy link

DefProc commented Jul 30, 2015

without having updated the reload-local-config.sh or reload-all-config.sh I have run ssh-copy-id for doorbot 1&2, so the process to pull and reload stands at:

  • ssh doorbot1
  • cd logcards/doorbot-config/
  • git pull
  • cd ../..
  • ./reload-local-config.sh
  • sudo screen -x (to check the config is fine)
  • ./reload-all-config.sh
  • exit

@DefProc
Copy link

DefProc commented Sep 23, 2015

I've made an rfid-keyboard to allow easier collection of the RFID UIDs: https://git.defproc.co.uk/DefProc/rfid-keyboard

So now, with the device plugged in as a USB keyboard, the process to add/search though a local clone of doorbot-setup can be done without ssh'ing to a doorbot for an ID number.

@DefProc
Copy link

DefProc commented Sep 23, 2015

Ideally, the pull should happen from the user's local repo in a script. e.g:

@DefProc
Copy link

DefProc commented Jun 9, 2016

As a way of taking steps to improve the current process, I've written a pair of scripts that automate the git pull, checking if the yaml is valid and then either copying out to the other doorbots or restoring the previous known good configuration. These are derived from, and can be used in place of the older reload-local-config and reload-all-config scripts.

In the doorbots-config repo, there is now:

  • config.yaml has been moved to _config.yaml so the original is used as the current config on the actual doorbot
  • update-rfids.sh will (when run on the doorbot):
    • pull the remote repo
    • copy the new config into position
    • run screen for you to view the loading message from the new config
    • ask you if the loading message looked correct
    • either restore the original config
    • or copy the config to the other two doorbots
  • ssh-update-rfids.sh will (when run locally from inside DoES's network) ssh over to doorbot1 and run update-rfids.sh remotely

@amcewen amcewen changed the title reload-all-config.sh script should pull from bitbucket Improve way to update config.yaml on the Doorbots Feb 6, 2017
@amcewen
Copy link
Member Author

amcewen commented Feb 6, 2017

Have changed the title on this to reflect what the issue is now about.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants