/arduino-sample

Arduino Due Sample CI/CD chain

Primary LanguageJavaScriptMIT LicenseMIT

arduino-sample

Build Status

Arduino Due Sample CI/CD chain

Usage

🚧 Work in Progress

1. BOARD_ID

Set your BOARD_ID (e.g. due) as variable in Travis CI environment variable via

$ travis env set PIO_BOARD <BOARD_ID> -r <GITHUB_USERNAME>/arduino-sample
2. PIO_AGENT

Set your PIO_AGENT as variable in Travis CI environment variable via

$ travis env set PIO_AGENT <PIO_AGENT> -r <GITHUB_USERNAME>/arduino-sample

ℹ️ http://docs.platformio.org/en/latest/userguide/remote/cmd_agent.html#platformio-remote-agent-start ⏬ see also 6. Monitor (optional)

3. PIO_USERNAME and PIO_PASSWORD

To be able to use the PIO Remote™ Agent from script/cibuild and script/deploy, set your PIO_USERNAME and PIO_PASSWORD as variable in Travis CI environment variable via

$ travis env set PIO_USERNAME <PIO_USERNAME> -r <GITHUB_USERNAME>/arduino-sample
$ travis env set PIO_PASSWORD <PIO_PASSWORD> -r <GITHUB_USERNAME>/arduino-sample

ℹ️ http://docs.platformio.org/en/latest/userguide/account/cmd_login.html

4. GITHUB_TOKEN

Create a GitHub token with user and repo scopes to be used in script/deploy and set it as variable in Travis CI via

travis env set GH_TOKEN <GITHUB_TOKEN> -r <GITHUB_USERNAME>/arduino-sample
5. Start the remote agent

Now to allow Travis CI to run tests and deployments on the locally connected (USB programming port) board, we have to start the agent locally to accept connections

$ platformio remote agent start --share <YOUT_PIO_LOGIN>

ℹ️ http://docs.platformio.org/en/latest/userguide/remote/cmd_agent.html#platformio-remote-agent-start

If you don't have an account, you can create one with platformio account register.

6. Monitor (optional)

We can run a serial port monitor locally, displaying information about what's going on.

<PIO_AGENT> has to be the same as in 2. PIO_AGENT to work correctly in the here described scenario

$ platformio remote -a <PIO_AGENT> device monitor

ℹ️ http://docs.platformio.org/en/latest/userguide/remote/cmd_device.html#platformio-remote-device-monitor

7. Push code

Push code to your GitHub PR, and see CI and CD in effect.

License license

MIT © Stefan Stölzle