.gitlab-ci.yml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. # _____ _ _
  2. # | __|___ ___ ___ _| |___ _____| |_ ___ ___ ___
  3. # | __| _| -_| -_| . | . | | . | . | | -_|
  4. # |__| |_| |___|___|___|___|_|_|_|___|___|_|_|___|
  5. #
  6. # Freedom in the Cloud
  7. #
  8. # Gitlab-CI: Build and Test to ensure that known bugs get caught
  9. #
  10. # License
  11. # =======
  12. #
  13. # Copyright (C) 2019 Liam Hurwitz <liam@contra-bit.com>
  14. #
  15. # This program is free software: you can redistribute it and/or modify
  16. # it under the terms of the GNU Affero General Public License as published by
  17. # the Free Software Foundation, either version 3 of the License, or
  18. # (at your option) any later version.
  19. #
  20. # This program is distributed in the hope that it will be useful,
  21. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  22. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  23. # GNU Affero General Public License for more details.
  24. #
  25. # You should have received a copy of the GNU Affero General Public License
  26. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  27. #
  28. # This file builds images for freedombone and tests various apps
  29. # see https://docs.gitlab.com/ce/ci/yaml/README.html for all available options
  30. #
  31. # The Freedombone Docker image is defined in the Dockerfile, its purpose is to build and test freedombone. Using a docker image has the advantage, that most overhead is removed from the setup phase.
  32. # TODO: Currently erverything is run as root
  33. #
  34. # Local Testing is sometimes more Verbose. To run locally make sure you have gitlab-runner and docker installed,
  35. # then run gitlab-runner exec docker [testname]
  36. image: gitlab.informatik.uni-bremen.de:5005/turingcomplete/freedombone:latest
  37. stages:
  38. - prepare
  39. - build
  40. - test
  41. - deploy
  42. git update:
  43. stage: prepare
  44. script:
  45. - git pull --rebase origin stretch && git checkout buster
  46. build amd64:
  47. stage: build
  48. script:
  49. - echo "Buidling Image for amd64"
  50. - freedombone-image -t amd64 -m http://www.fb3.uni-bremen.de/download/linux/debian/debian/
  51. artifacts:
  52. paths:
  53. - freedombone-main-all-amd64.img
  54. only:
  55. - tags
  56. build qemu64:
  57. stage: build
  58. script:
  59. - echo "Buidling Image for qemu-x86_64"
  60. - freedombone-image -t qemu-x86_64 -m http://www.fb3.uni-bremen.de/download/linux/debian/debian/
  61. artifacts:
  62. paths:
  63. - freedombone-main-all-qemu-x86_64.img
  64. only:
  65. - tags
  66. build beaglebonegreen:
  67. stage: build
  68. script:
  69. - echo "Buidling Image for beaglebonegreen"
  70. - freedombone-image -t beaglebonegreen -m http://www.fb3.uni-bremen.de/download/linux/debian/debian/
  71. artifacts:
  72. paths:
  73. - freedombone-main-all-beaglebonegreen.img
  74. only:
  75. - tags
  76. build beaglebonegreenmesh:
  77. stage: build
  78. script:
  79. - echo "Buidling Image for beaglebonegreen"
  80. - freedombone-image -t beaglebonegreen -m http://www.fb3.uni-bremen.de/download/linux/debian/debian/ -v mesh
  81. artifacts:
  82. paths:
  83. - freedombone-main-all-beaglebonegreen.img
  84. only:
  85. - tags
  86. build amd64meshclient:
  87. stage: build
  88. script:
  89. - echo "Buidling Image for amd64 meshclient"
  90. - freedombone-image -t amd64 -m http://www.fb3.uni-bremen.de/download/linux/debian/debian/ -v meshclient
  91. artifacts:
  92. paths:
  93. - freedombone-main-all-beaglebonegreen.img
  94. only:
  95. - tags
  96. build menuconfig-onion:
  97. stage: build
  98. script:
  99. # Install Freedombone to local testing for testing
  100. # TODO: make sure,that tests have access to this build
  101. # TODO: add headless menuconfig
  102. - export TERMINFO=/usr/lib/terminfo
  103. - echo $TERMINFO
  104. - sudo freedombone menuconfig-onion --noninteractive
  105. build menuconfig:
  106. stage: build
  107. script:
  108. - export TERMINFO=/usr/lib/terminfo
  109. - echo $TERMINFO
  110. - sudo freedombone menuconfig --noninteractive your-test-domain-name.net
  111. test syncthing:
  112. stage: test
  113. script:
  114. # TODO: Emualte User in Browser for Clicks in postinstall with python programm
  115. # Then scrape HTML in order to use assertions to check if app works
  116. - echo "Testing Install for Syncthing"
  117. - freedombone addremove add syncthing
  118. - echo "For example run a test suite"
  119. - freedombone addremove remove syncthing
  120. test epicyon:
  121. stage: test
  122. script:
  123. # TODO: Emualte User in Browser for Clicks in postinstall with python programm
  124. # Then scrape HTML in order to use assertions to check if app works
  125. - echo "Testing Install for Epicyon"
  126. - freedombone addremove add epicyon
  127. - echo "For example run a test suite"
  128. - freedombone addremove remove epicyon
  129. test2:
  130. stage: test
  131. script:
  132. - echo "Do another parallel test here"
  133. - echo "For example run a lint test"
  134. deploy1:
  135. stage: deploy
  136. script:
  137. # TODO: Decide where to host images, and then push artefacts to website
  138. # Hosting at Uni Bremen should be no problem. TODO: Ask about logging
  139. - echo "Do your deploy here"