You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
2.4 KiB

8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
  1. \subsection{Automatic deployment and roll-out}
  2. The source code of the \textit{ESPer} project is published into a \textit{GIT} source code repository which is provided by the hackerspace.
  3. To avoid interferences between different build environments on developers computers and roll out new versions as early as possible, the code has been integrated into a continuous integration (CI) system.
  4. The CI, which is based on \textit{drone}\cite{drone} and provided as part of the hackerspace infrastructure, allows to execute commands on each version published into the \textit{GIT} repository.
  5. Therefore a \textit{drone} configuration file as shown in Listing~\ref{lst:drone} has been added to the source code as \texttt{.drone.yml}.
  6. \begin{sloppypar}
  7. As shown in the configuration Snippet, the build environment includes some special settings.
  8. First, the \texttt{CONFIG=maglab} option lets the build system use \texttt{Configurion.mk.maglab} instead of the default configuration file.
  9. This configuration file is stored inside the repository, too.
  10. To keep the WiFi password secret, it is not written down in the configuration, but must be specified in the environment.
  11. To include secrets into a build process while allowing to keep the configuration public, \textit{drone} allows to encrypt these with a repository specific key.
  12. Using this method, the password is stored as \texttt{.drone.sec} file inside the repository from where it is injected into the build environment.
  13. At last, the firmware version is configured to be made out of the first 8 letters of the \textit{GIT} commit hash, which uniquely identifies a version of the source code.
  14. \end{sloppypar}
  15. \begin{lstlisting}[language=,
  16. caption={The \textit{drone} configuration for the \textit{ESPer} project.},
  17. label=lst:drone]
  18. build:
  19. image: maglab/sming
  20. environment:
  21. - CONFIG=maglab
  22. - WIFI_PWD=$$WIFI_PWD
  23. - VERSION=$${COMMIT:0:8}
  24. commands:
  25. - make clean
  26. - make
  27. publish:
  28. sftp:
  29. host: eddie.maglab.space
  30. username: esper
  31. files:
  32. - dist/*
  33. destination_path: './'
  34. when:
  35. branch: master
  36. \end{lstlisting}
  37. For deployment, only the master branch is considered.
  38. After a successful build, all distribution files (the binary firmware files and the version files) of all devices are copied to the machine running the home automation controller software into a directory served by a HTTP server.
  39. The used configuration file references this server as source of updates.