Skip to content

Commit

Permalink
Small changes to scripts, updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
retrodaredevil committed May 6, 2020
1 parent 826199e commit e7d98d0
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 6 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ The [input and output](other/docs/input_and_outputs.md) README is documentation
#### [Project Structure](other/docs/technical/project_structure.md)
#### [History](other/docs/history.md)
#### [Google Analytics](other/docs/google_analytics.md)
#### [Updating](other/docs/updating.md)

#### Configuration
This uses all JSON for configuring everything. The files you edit are all in one place unless you decide to move them.
Expand Down
1 change: 1 addition & 0 deletions other/docs/history.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ have the ability to have multiple instances uploading packets to a single databa
* RoverPi became corrupt, but was eventually re-flashed and set up again
* MatePi finally became corrupt. It was re-flashed, worked, then became corrupt again. (Need new SD card).
* Google Analytics were added
* Did a huge rebase to remove all solarthing.jar files, restructured program directory


### Moving from Gson to Jackson
Expand Down
4 changes: 4 additions & 0 deletions other/docs/random_links.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## Random Links
These links probably aren't useful to anyone.

https://github.com/github/git-sizer - can be used to make sure this repo is healthy
1 change: 0 additions & 1 deletion other/docs/todo.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ easy displaying in Grafana
* Looks interesting
* [Metrictank](https://grafana.com/oss/metrictank/)
* IntelliJ is complaining about "busy waiting". We do a lot of this. Should we change how we're doing this?
* https://git-lfs.github.com/ - For solarthing.jar

#### TODO - Additions I'm not going to work on
These might be useful to some people. I will not implement these in the future, but pull requests are welcome!
Expand Down
11 changes: 11 additions & 0 deletions other/docs/updating.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Updating
To update, run these commands:
```shell script
# NOTE: These will need sudo
git pull
program/download_solarthing.sh # if there's an update, this will download it
```
If you are running the systemd service, do this to restart:
```shell script
sudo systemctl restart solarthing-<program type>
```
2 changes: 1 addition & 1 deletion program/.scripts/download_if_needed.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

BASEDIR=$(dirname "$0")

if ! ls "$BASEDIR/../solarthing.jar" 2>/dev/null; then
if ! ls "$BASEDIR/../solarthing.jar" 2>/dev/null 2>&1; then
../download_solarthing.sh || exit 1
fi
6 changes: 4 additions & 2 deletions program/download_solarthing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ BASEDIR=$(dirname "$0")
cd "$BASEDIR" || exit 1

# shellcheck source=.scripts/export_version.sh
. "$BASEDIR"/.scripts/export_version.sh || exit 1
. .scripts/export_version.sh || exit 1

if ! ls ".downloads/solarthing-$SOLARTHING_VERSION.jar" 2>/dev/null; then
if ! ls ".downloads/solarthing-$SOLARTHING_VERSION.jar" 1>/dev/null 2>&1; then
echo Going to download version: "$SOLARTHING_VERSION"
mkdir ".downloads" 2>/dev/null
(cd .downloads && wget "https://github.com/wildmountainfarms/solarthing/releases/download/v$SOLARTHING_VERSION/solarthing-$SOLARTHING_VERSION.jar") || exit 1
else
echo Already downloaded
fi
ln -sf ".downloads/solarthing-$SOLARTHING_VERSION.jar" solarthing.jar || exit 1
echo Using SolarThing Version: "$SOLARTHING_VERSION"
2 changes: 1 addition & 1 deletion program/graphql/solarthing-graphql.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
BASEDIR=$(dirname "$0")
cd "$BASEDIR" || exit 1

if ! ls "solarthing-graphql.jar" 2>/dev/null; then
if ! ls "solarthing-graphql.jar" 2>/dev/null 2>&1; then
../download_solarthing.sh || exit 1
fi
java -jar solarthing-graphql.jar --spring.config.location=config/application.properties
4 changes: 3 additions & 1 deletion program/graphql_download_solarthing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ cd "$BASEDIR" || exit 1
# shellcheck source=.scripts/export_version.sh
. "$BASEDIR"/.scripts/export_version.sh || exit 1

if ! ls ".downloads/solarthing-graphql-$SOLARTHING_VERSION.jar" 2>/dev/null; then
if ! ls ".downloads/solarthing-graphql-$SOLARTHING_VERSION.jar" 2>/dev/null 2>&1; then
echo Going to download version: "$SOLARTHING_VERSION"
mkdir ".downloads" 2>/dev/null
(cd .downloads && wget "https://github.com/wildmountainfarms/solarthing/releases/download/v$SOLARTHING_VERSION/solarthing-graphql-$SOLARTHING_VERSION.jar") || exit 1
else
echo Already downloaded
fi
ln -sf "../.downloads/solarthing-graphql-$SOLARTHING_VERSION.jar" graphql/solarthing-graphql.jar || exit 1
echo Using SolarThing Version: "$SOLARTHING_VERSION"

0 comments on commit e7d98d0

Please sign in to comment.