Skip to content

Commit

Permalink
Merge pull request #9 from geonnave/configure-build-via-env-var
Browse files Browse the repository at this point in the history
Configure builds from env var
  • Loading branch information
geonnave authored Nov 26, 2024
2 parents 6c268a2 + 392008d commit ea7f1cb
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,8 @@ jobs:

- name: Build ${{ matrix.target }}
run: |
BUILD_CONFIG=debug swarmake build ${{ matrix.target }}
if [ "${{ matrix.target }}" == "dotbot" ]; then
BUILD_CONFIG=debug TARGET_APP=move swarmake build ${{ matrix.target }}
else
BUILD_CONFIG=debug swarmake build ${{ matrix.target }}
fi
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ swarmake run lakers
## Deploy
Deploy a Swarm of DotBots:
```bash
swarmake deploy move --monitor
TARGET_APP=move swarmake deploy --monitor
```

The command above will:
Expand Down
9 changes: 5 additions & 4 deletions swarmake/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,9 @@ def list():

@main.command()
@click.option('-m', '--monitor', default=False, is_flag=True, help="Tell swarmit to monitor the event logs right after the experiment starts")
@click.argument("firmware_name")
def deploy(firmware_name, monitor):
def deploy(monitor):
"""Deploy a firmware to a set of DotBots."""
dotbot_project = load_project_config("dotbot")
swarmit_project = load_project_config("swarmit")

# if needed, build dotbot and swarmit projects
res = cmd.execute(dotbot_project.list_outputs_cmd, directory=dotbot_project.build_dir)
Expand All @@ -153,7 +151,10 @@ def deploy(firmware_name, monitor):

# deploy the firmware to the devices using swarmit
res = cmd.execute("swarmit stop") # make sure experiment is not running
time.sleep(1)
if not res:
logging.warning("Failed to stop the experiment")
return
time.sleep(2)
res = cmd.execute_pretty(f"swarmit flash -y $PWD/build/dotbot/{dotbot_project.output_dir}/*.bin")
time.sleep(1)
if not res:
Expand Down
10 changes: 3 additions & 7 deletions swarmake/swarmake.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@

[projects.dotbot]
repo = "DotBot-firmware" # if the project name is different from the repo name
build = """
BUILD_TARGET=dotbot-v2 BUILD_CONFIG=Debug DOCKER_TARGETS="swarmit_motors" make docker
"""
list-outputs = """
ls -l swarmit/motors/Output/dotbot-v2/Debug/Exe
"""
output-dir = "swarmit/motors/Output/dotbot-v2/Debug/Exe"
build = "BUILD_TARGET=dotbot-v2 BUILD_CONFIG=Debug DOCKER_TARGETS=swarmit_$TARGET_APP make docker"
list-outputs = "ls -l swarmit/$TARGET_APP/Output/dotbot-v2/Debug/Exe"
output-dir = "swarmit/$TARGET_APP/Output/dotbot-v2/Debug/Exe"

[projects.pydotbot]
repo = "PyDotBot"
Expand Down

0 comments on commit ea7f1cb

Please sign in to comment.