@Farmbot team: would you tell us something about your deployment cycle?

Hi Farmbot team,

would you tell us something about your deployment cycle? e.g. do you have a buildserver and some flags so you could easily switch between the dev-/production-environment fo your farmbot-hardware or have you just two farmbot-hardware-sets or have you sth like a virtual machine for the farmbot to test it?

Please give us some insights how your development process is working because I’m really sure you have made more thoughts about it than the average farmbot-comitter.

Thanks for your response.

Hi @fafi, that’s a great question.


do you have a build server and some flags so you could easily switch between the dev-/production-environment

We do! Here is a basic overview for the API and OS:

Build System: API / Web App

For the API, we use Travis CI.
Most of the configuration values for the API are set through the use of ENV variables. A list of those variables can be found here. It’s important to note that the API is just a Rails app. So we can switch between prod / dev mode very easily by setting the RAILS_ENV variable. This is true for all rails apps. This also means we have three databases, production, development and test. Again, this is all standard stuff for a Rails application. You can read more about it here

Build System: FarmBot OS

For FarmBot OS, we use Circle CI as our build server. @connor did a writeup on the subject here. In the same way that the API is “just a Rails app”, FarmBot OS is a Nerves app, so it’s worth giving the Nerves documentation a read.


Please give us some insights how your development process

The API and OS have two slightly different setups.

Development Process: API / Web App

Typically, when I’m writing software for the API I:

  1. Start the server like usual (rails api:start/ rails mqtt:start)
  2. Write the features and tests and whatnot.
  3. Run the tests (rspec spec for Ruby code, npm run test for Typescript code)
  4. Commit my results and send a pull request to Github, which will run the continuous integration system.
  5. Once that passes Travis CI, we deploy it to a staging server where it is manually tested against a physical FarmBot in a real-world setup.

It’s important to note that I rarely need a running FarmBot to write API/Web App features. Most features can be written and tested in isolation without a running FarmBot. Sometimes, if I need to test against a FarmBot, I will burn FarmBot OS onto an SD card and plug in a Raspberry Pi on my desk (no steppers or perihperals).

Development Process: FarmbotOS

Typical Farmbot OS workflow:

  1. Start the application like normal (iex -S mix)
  2. Write the features and tests.
  3. Run the tests (mix test)
  4. Commit my results and send a pull request to Github, which will run the continuous integration system.

It’s important to note that FarmBot OS always need a running FarmBot API to write most features for Farmbot OS.


Hopefully, that gives you a better picture of how we write features for FarmBot on a day-to-day basis. If you have any other questions feel free to ask.

3 Likes

Wow, super explanation as always. I love that.
Maybe this would also fit into the FAQ section? I think this may be hard to find through the search function only.

1 Like

hmmn what would you think about a development-section so that it could seperate between user-orientated questions and sw-development-things

1 Like

@Ascend @fafi -

I wrote this document this morning. I look forward to hearing your feedback.

That’s great, I really like it. Maybe this will help to encourage more users to develop and share some code :+1:

1 Like

@RickCarlino wow have not expected that would it so huge with a custom website. Have you seen that I already made a suggestion

@fafi I did, thanks! :tada:

Please let us know how else we can help with the process of learning the code base.

Our focus over the next few months is to build better tools for third party developers.

@RickCarlino
Farmbot-OS:

  • I think nerves and elixir is pretty cool but most of the developers don’t know erlang/elixir and just reading raspberry pi and think about to write / develop a python/nodejs program…So maybe a section how to use other languages with nerves would be cool.
  • I played a little bit around with nerves in the last 2-3 days and have to confess that I’m a little unsure if i need to clone the farmbot-os repo or just download the image
  • Are you using phonix for webcommunication?
  • Maybe a Layer-Architecture-Pic for the farmbot-os?
1 Like

Sorry, i think there was a misunderstanding here.

That post describes how we develop features for FarmbotOS. To add a feature for all users to use, such as that report temperature feature request would follow process. For interacting with Farmbot you may want to look at developing a Farmware which is like plugin system that currently supports Python. You can read about it here