cfsetup.yaml 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. pinned_go: &pinned_go go-boring=1.22.10-1
  2. build_dir: &build_dir /cfsetup_build
  3. default-flavor: bookworm
  4. bullseye: &bullseye
  5. build-linux:
  6. build_dir: *build_dir
  7. builddeps: &build_deps
  8. - *pinned_go
  9. - build-essential
  10. - fakeroot
  11. - rubygem-fpm
  12. - rpm
  13. - libffi-dev
  14. - golangci-lint
  15. pre-cache: &build_pre_cache
  16. - export GOCACHE=/cfsetup_build/.cache/go-build
  17. - go install golang.org/x/tools/cmd/goimports@latest
  18. post-cache:
  19. # Linting
  20. - make lint
  21. - make fmt-check
  22. # Build binary for component test
  23. - GOOS=linux GOARCH=amd64 make cloudflared
  24. build-linux-fips:
  25. build_dir: *build_dir
  26. builddeps: *build_deps
  27. pre-cache: *build_pre_cache
  28. post-cache:
  29. - export FIPS=true
  30. # Build binary for component test
  31. - GOOS=linux GOARCH=amd64 make cloudflared
  32. cover:
  33. build_dir: *build_dir
  34. builddeps: *build_deps
  35. pre-cache: *build_pre_cache
  36. post-cache:
  37. - make cover
  38. # except FIPS and macos
  39. build-linux-release:
  40. build_dir: *build_dir
  41. builddeps: &build_deps_release
  42. - *pinned_go
  43. - build-essential
  44. - fakeroot
  45. - rubygem-fpm
  46. - rpm
  47. - libffi-dev
  48. - python3-dev
  49. - python3-pip
  50. - python3-setuptools
  51. - wget
  52. - python3-venv
  53. post-cache:
  54. - python3 -m venv env
  55. - . /cfsetup_build/env/bin/activate
  56. - pip install pynacl==1.4.0 pygithub==1.55 boto3==1.22.9 python-gnupg==0.4.9
  57. # build all packages (except macos and FIPS) and move them to /cfsetup/built_artifacts
  58. - ./build-packages.sh
  59. # handle FIPS separately so that we built with gofips compiler
  60. build-linux-fips-release:
  61. build_dir: *build_dir
  62. builddeps: *build_deps_release
  63. post-cache:
  64. # same logic as above, but for FIPS packages only
  65. - ./build-packages-fips.sh
  66. generate-versions-file:
  67. build_dir: *build_dir
  68. builddeps:
  69. - *pinned_go
  70. - build-essential
  71. post-cache:
  72. - make generate-docker-version
  73. build-deb:
  74. build_dir: *build_dir
  75. builddeps: &build_deb_deps
  76. - *pinned_go
  77. - build-essential
  78. - fakeroot
  79. - rubygem-fpm
  80. post-cache:
  81. - export GOOS=linux
  82. - export GOARCH=amd64
  83. - make cloudflared-deb
  84. build-fips-internal-deb:
  85. build_dir: *build_dir
  86. builddeps: &build_fips_deb_deps
  87. - *pinned_go
  88. - build-essential
  89. - fakeroot
  90. - rubygem-fpm
  91. post-cache:
  92. - export GOOS=linux
  93. - export GOARCH=amd64
  94. - export FIPS=true
  95. - export ORIGINAL_NAME=true
  96. - make cloudflared-deb
  97. build-internal-deb-nightly-amd64:
  98. build_dir: *build_dir
  99. builddeps: *build_fips_deb_deps
  100. post-cache:
  101. - export GOOS=linux
  102. - export GOARCH=amd64
  103. - export NIGHTLY=true
  104. - export FIPS=true
  105. - export ORIGINAL_NAME=true
  106. - make cloudflared-deb
  107. build-internal-deb-nightly-arm64:
  108. build_dir: *build_dir
  109. builddeps: *build_fips_deb_deps
  110. post-cache:
  111. - export GOOS=linux
  112. - export GOARCH=arm64
  113. - export NIGHTLY=true
  114. # - export FIPS=true # TUN-7595
  115. - export ORIGINAL_NAME=true
  116. - make cloudflared-deb
  117. build-deb-arm64:
  118. build_dir: *build_dir
  119. builddeps: *build_deb_deps
  120. post-cache:
  121. - export GOOS=linux
  122. - export GOARCH=arm64
  123. - make cloudflared-deb
  124. package-windows:
  125. build_dir: *build_dir
  126. builddeps:
  127. - *pinned_go
  128. - build-essential
  129. - python3-dev
  130. - libffi-dev
  131. - python3-setuptools
  132. - python3-pip
  133. - wget
  134. # libmsi and libgcab are libraries the wixl binary depends on.
  135. - libmsi-dev
  136. - libgcab-dev
  137. - python3-venv
  138. pre-cache:
  139. - wget https://github.com/sudarshan-reddy/msitools/releases/download/v0.101b/wixl -P /usr/local/bin
  140. - chmod a+x /usr/local/bin/wixl
  141. post-cache:
  142. - python3 -m venv env
  143. - . env/bin/activate
  144. - pip install pynacl==1.4.0 pygithub==1.55
  145. - .teamcity/package-windows.sh
  146. test:
  147. build_dir: *build_dir
  148. builddeps: &build_deps_tests
  149. - *pinned_go
  150. - build-essential
  151. - fakeroot
  152. - rubygem-fpm
  153. - rpm
  154. - libffi-dev
  155. - gotest-to-teamcity
  156. pre-cache: *build_pre_cache
  157. post-cache:
  158. - export GOOS=linux
  159. - export GOARCH=amd64
  160. - export PATH="$HOME/go/bin:$PATH"
  161. - make test | gotest-to-teamcity
  162. test-fips:
  163. build_dir: *build_dir
  164. builddeps: *build_deps_tests
  165. pre-cache: *build_pre_cache
  166. post-cache:
  167. - export GOOS=linux
  168. - export GOARCH=amd64
  169. - export FIPS=true
  170. - export PATH="$HOME/go/bin:$PATH"
  171. - make test | gotest-to-teamcity
  172. component-test:
  173. build_dir: *build_dir
  174. builddeps: &build_deps_component_test
  175. - *pinned_go
  176. - python3
  177. - python3-pip
  178. - python3-setuptools
  179. # procps installs the ps command which is needed in test_sysv_service
  180. # because the init script uses ps pid to determine if the agent is
  181. # running
  182. - procps
  183. - python3-venv
  184. pre-cache-copy-paths:
  185. - component-tests/requirements.txt
  186. post-cache: &component_test_post_cache
  187. - python3 -m venv env
  188. - . env/bin/activate
  189. - pip install --upgrade -r component-tests/requirements.txt
  190. # Creates and routes a Named Tunnel for this build. Also constructs
  191. # config file from env vars.
  192. - python3 component-tests/setup.py --type create
  193. - pytest component-tests -o log_cli=true --log-cli-level=INFO
  194. # The Named Tunnel is deleted and its route unprovisioned here.
  195. - python3 component-tests/setup.py --type cleanup
  196. component-test-fips:
  197. build_dir: *build_dir
  198. builddeps: *build_deps_component_test
  199. pre-cache-copy-paths:
  200. - component-tests/requirements.txt
  201. post-cache: *component_test_post_cache
  202. github-release-dryrun:
  203. build_dir: *build_dir
  204. builddeps:
  205. - *pinned_go
  206. - build-essential
  207. - python3-dev
  208. - libffi-dev
  209. - python3-setuptools
  210. - python3-pip
  211. - python3-venv
  212. post-cache:
  213. - python3 -m venv env
  214. - . env/bin/activate
  215. - pip install pynacl==1.4.0 pygithub==1.55
  216. - make github-release-dryrun
  217. github-release:
  218. build_dir: *build_dir
  219. builddeps:
  220. - *pinned_go
  221. - build-essential
  222. - python3-dev
  223. - libffi-dev
  224. - python3-setuptools
  225. - python3-pip
  226. - python3-venv
  227. post-cache:
  228. - python3 -m venv env
  229. - . env/bin/activate
  230. - pip install pynacl==1.4.0 pygithub==1.55
  231. - make github-release
  232. r2-linux-release:
  233. build_dir: *build_dir
  234. builddeps:
  235. - *pinned_go
  236. - build-essential
  237. - fakeroot
  238. - rubygem-fpm
  239. - rpm
  240. - wget
  241. - python3-dev
  242. - libffi-dev
  243. - python3-setuptools
  244. - python3-pip
  245. - reprepro
  246. - createrepo-c
  247. - python3-venv
  248. post-cache:
  249. - python3 -m venv env
  250. - . env/bin/activate
  251. - pip install pynacl==1.4.0 pygithub==1.55 boto3==1.22.9 python-gnupg==0.4.9
  252. - make r2-linux-release
  253. bookworm: *bullseye
  254. trixie: *bullseye