Skip to content

Commit

Permalink
Merge pull request #1832 from nicomiguelino/1831-update-balena-docs
Browse files Browse the repository at this point in the history
Add details in relevant docs and scripts about the possible values for the `--board` option.
  • Loading branch information
nicomiguelino authored Oct 18, 2023
2 parents fad92c6 + d2282ac commit 4170486
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
19 changes: 18 additions & 1 deletion bin/deploy_to_balena.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,31 @@

set -euo pipefail

print_help() {
echo "Usage: deploy_to_balena.sh [options]"
echo "Options:"
echo " -h, --help show this help message and exit"
echo " -b, --board BOARD specify the board to build for (pi1, pi2, pi3, pi4)"
echo " -f, --fleet FLEET specify the fleet name to deploy to"
echo " -s, --short-hash HASH specify the short hash to use for the image tag"
echo " -d, --dev run in dev mode"
}

while [[ $# -gt 0 ]]; do
key="$1"
case $key in
-h|--help)
print_help
exit 0
;;
-b|--board)
export BOARD="$2"

if [[ $BOARD =~ ^(pi1|pi2|pi3|pi4)$ ]]; then
echo "Building for $BOARD"
else
echo "Invalid board $BOARD"
print_help
exit 1
fi

Expand All @@ -28,25 +43,27 @@ while [[ $# -gt 0 ]]; do
shift
shift
;;
# add an option whether to run in dev mode or not
-d|--dev)
export DEV_MODE=1
shift
;;
*)
echo "Unknown option $key"
print_help
exit 1
;;
esac
done

if [[ -z "${BOARD+x}" ]]; then
echo "Please specify a board with --board"
print_help
exit 1
fi

if [[ -z "${FLEET+x}" ]]; then
echo "Please specify the fleet name with --fleet"
print_help
exit 1
fi

Expand Down
3 changes: 3 additions & 0 deletions docs/balena-fleet-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ $ ./bin/deploy_to_balena.sh \
--fleet $FLEET_NAME \
```

`$BOARD_TYPE` could be any one of the following — `pi1`, `pi2`, `pi3`, `pi4`.
You can run `./bin/deploy_to_balena.sh --help` for details.

Running the command above will pull the latest Docker images from Docker Hub and
push them to your balenaCloud account. It will also create a new release and
deploy it to your fleet.
Expand Down

0 comments on commit 4170486

Please sign in to comment.