Closed bplimley closed 8 years ago
I talked to Joey and we realized that if there are any local changes, there should be a git stash
and then checkout/pull. So, don't merge yet.
See also new issue #37 which is related (but will be implemented at a later time).
Added features:
git-pull-reboot.sh
git status
.
origin
, then they are moved to a temporary branch named like localchanges-May-12
, and the current branch is reset to origin/$CURRENT_BRANCH
where it should be.git stash
.git stash
will fail because git
is not configured with user.name
and user.email
. So...system-update.sh
user.name
and user.email
are set in the repo. If not, they are set to "Anonymous Pi" and "dosenet.pi@radwatch.berkeley.edu" (this email address is recorded in git, but doesn't have to be a real address)Note that if any of the deployed devices actually have local changes, then the existing git pull --ff-only
call in git-pull-reboot.sh
, as it exists on the old master branch, will fail. And that means that this updated script will never get on there, until we go fix it by hand (or have a local student do it). So really, the git stash
and git branch
stuff is for the future.
In addition, as discussed, the branch configuration should really not be part of the same code repo, but be somewhere else (a different repo, or something else downloadable). That will be a different PR though.
I believe I've tested everything pretty carefully. So I am going to merge this now, so that everything can update tonight. The system update or branch changes won't occur until tomorrow night, because the existing copy of git-pull-reboot.sh
doesn't have them.
dosenet.py
globalvalues.py
andmanager.py
's argparse looks for them whenmanager.py
is run in normal mode (not--test
). Instead of raising an error in the bash script,manager.py
will raise an IOError (with description) if you try to startmanager.py
in normal mode without these files.manager.py --test
without needing a config file or publickey. Closes bearing/dosenet/#70dosenet.sh --test
still checks for config and publickey, because if you don't supply them explicitly tomanager.py --test
, they will not be loaded./var/log/messages
as well asstderr
in the same call (logger --stderr
)git-pull-reboot.sh
/home/pi/config/config.csv
git status
(although currently not used)master
.Exit codes fromgit checkout
andgit pull
are checked. Although there isn't very much to use them for right now, since the pi does not have a method of reporting info to the server.There is aFORCE_GIT
option which willgit checkout -f
, discarding local changes. It is currently turned off. This may be superfluous because our deployed stations should not be on random branches with local changes.system-update.sh
after thegit checkout
/git pull
, before the reboot. The station ID is an argument tosystem-update.sh
. See below.system-update.sh
/etc/network/interfaces
, or/var/www/
stuff.case
statement that checks station ID. There is an example set up for test station 10005.