Skip to content

Commit

Permalink
Add software update task
Browse files Browse the repository at this point in the history
Closes #22.
  • Loading branch information
matteocarnelos committed May 17, 2024
1 parent fdbae51 commit 6cbf0c3
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
22 changes: 22 additions & 0 deletions DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,28 @@ Since DietPi-Automation's built-in features aren't enough to fully configure the
This script runs after the DietPi configuration, and it finishes the steps needed to set up SailTrack Core (e.g. it installs the missing packages, it sets up authentication tokens, etc.).
Once the script ends, the Raspberry Pi is rebooted, and SailTrack Core is then successfully deployed.

### Upload scripts to a running instance

To update the `sailtrack-*` scripts on o running SailTrack Core instance, the `cargo make upload` task can be used while being connected to "SailTrack-CoreNet":

```bash
cargo make upload
```

This task will build and upload all the `sailtrack-*` scripts found locally.
By default, the upload process will target SailTrack Core's default IP, namely `192.168.42.1`.
However, an optional argument can be passed to specify a custom IP address:

```bash
cargo make upload <IP-ADDRESS>
```

Where `<IP-ADDRESS>` is the IP address of SailTrack Core in the local network.

> [!NOTE]
> The `upload` task only uploads the scripts.
> If the script is run by a service, the service needs to be restarted to actually run the new script.
## Components

In this section, each component of the system will be analyzed in detail.
Expand Down
11 changes: 8 additions & 3 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@ command = "cross"
[tasks.package]
clear = true
condition = { platforms = [ "linux" ] }
dependencies = [
"default"
]
dependencies = ["default"]
command = "sudo"
args = ["./.make/sailtrack-package"]

[tasks.upload]
dependencies = ["default"]
script = '''
scp sailtrack/sailtrack-* target/aarch64-unknown-linux-gnu/release/sailtrack-*[!.d] \
root@${1-192.168.42.1}:/boot/sailtrack
'''

0 comments on commit 6cbf0c3

Please sign in to comment.