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.

255 lines
8.6 KiB

[RPC] Static swagger (#3880) * manually swagging Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * three definitions with polymorphism Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * added blockchain and block Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * low quality generation, commit, block_response and validators Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * genesis and consensus states endpoints Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * fix indentation Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * consensus parameters Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * fix indentation Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add height to consensus parameters endpoint Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * unconfirmed_txs and num_unconfirmed_txs Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add missing query parameter Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add ABCI queries Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * added index document for swagger documentation Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add missing routes Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * contract tests added on CCI Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * contract tests job should be in the test suite Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * simplify requirements to test Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * typo Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * build is a prerequisite to start localnet Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * reduce nodejs size, move goodman to get_tools, add docs, fix comments Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * Update scripts/get_tools.sh That's cleaner, thanks! Co-Authored-By: Anton Kaliaev <anton.kalyaev@gmail.com> * xz not supported by cci image, let's keep it simple Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * REMOVE-indirect debug of CCI paths Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * dirty experiment, volume is empty but binary has been produced Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * dirty experiment, volume is empty but binary has been produced Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * dirty experiment going on Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * locally works, CCI have difficulties with second layaer containers volumes Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * restore experiment, use machine instead of docker for contract tests Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * simplify a bit Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * rollback on machine golang Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * Document the changes Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * Changelog Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * comments Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>
5 years ago
[RPC] Static swagger (#3880) * manually swagging Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * three definitions with polymorphism Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * added blockchain and block Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * low quality generation, commit, block_response and validators Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * genesis and consensus states endpoints Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * fix indentation Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * consensus parameters Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * fix indentation Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add height to consensus parameters endpoint Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * unconfirmed_txs and num_unconfirmed_txs Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add missing query parameter Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add ABCI queries Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * added index document for swagger documentation Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add missing routes Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * contract tests added on CCI Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * contract tests job should be in the test suite Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * simplify requirements to test Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * typo Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * build is a prerequisite to start localnet Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * reduce nodejs size, move goodman to get_tools, add docs, fix comments Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * Update scripts/get_tools.sh That's cleaner, thanks! Co-Authored-By: Anton Kaliaev <anton.kalyaev@gmail.com> * xz not supported by cci image, let's keep it simple Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * REMOVE-indirect debug of CCI paths Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * dirty experiment, volume is empty but binary has been produced Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * dirty experiment, volume is empty but binary has been produced Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * dirty experiment going on Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * locally works, CCI have difficulties with second layaer containers volumes Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * restore experiment, use machine instead of docker for contract tests Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * simplify a bit Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * rollback on machine golang Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * Document the changes Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * Changelog Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * comments Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>
5 years ago
  1. version: 2.1
  2. executors:
  3. golang:
  4. docker:
  5. - image: tendermintdev/docker-tendermint-build
  6. working_directory: /go/src/github.com/tendermint/tendermint
  7. environment:
  8. GOBIN: /tmp/bin
  9. release:
  10. machine: true
  11. docs:
  12. docker:
  13. - image: tendermintdev/docker-website-deployment
  14. environment:
  15. AWS_REGION: us-east-1
  16. commands:
  17. run_test:
  18. parameters:
  19. script_path:
  20. type: string
  21. steps:
  22. - attach_workspace:
  23. at: /tmp/bin
  24. - restore_cache:
  25. name: "Restore source code cache"
  26. keys:
  27. - go-src-v1-{{ .Revision }}
  28. - checkout
  29. - restore_cache:
  30. name: "Restore go modules cache"
  31. keys:
  32. - go-mod-v1-{{ checksum "go.sum" }}
  33. - run:
  34. name: "Running test"
  35. command: |
  36. bash << parameters.script_path >>
  37. jobs:
  38. setup_dependencies:
  39. executor: golang
  40. steps:
  41. - checkout
  42. - restore_cache:
  43. name: "Restore go modules cache"
  44. keys:
  45. - go-mod-v1-{{ checksum "go.sum" }}
  46. - run:
  47. command: |
  48. mkdir -p /tmp/bin
  49. - run:
  50. name: Cache go modules
  51. command: make go-mod-cache
  52. - run:
  53. name: tools
  54. command: make tools
  55. - run:
  56. name: "Build binaries"
  57. command: make install install_abci
  58. - save_cache:
  59. name: "Save go modules cache"
  60. key: go-mod-v1-{{ checksum "go.sum" }}
  61. paths:
  62. - "/go/pkg/mod"
  63. - save_cache:
  64. name: "Save source code cache"
  65. key: go-src-v1-{{ .Revision }}
  66. paths:
  67. - ".git"
  68. - persist_to_workspace:
  69. root: "/tmp/bin"
  70. paths:
  71. - "."
  72. deploy_docs:
  73. executor: docs
  74. steps:
  75. - checkout
  76. - run:
  77. name: "Pull versions"
  78. command: git fetch origin v0.32 v0.33
  79. - run:
  80. name: "Build docs"
  81. command: make build-docs
  82. - run:
  83. name: "Sync to S3"
  84. command: make sync-docs
  85. prepare_build:
  86. executor: golang
  87. steps:
  88. - restore_cache:
  89. name: "Restore source code cache"
  90. keys:
  91. - go-src-v1-{{ .Revision }}
  92. - checkout
  93. - run:
  94. name: Get next release number
  95. command: |
  96. export LAST_TAG="`git describe --tags --abbrev=0 --match "${CIRCLE_BRANCH}.*"`"
  97. echo "Last tag: ${LAST_TAG}"
  98. if [ -z "${LAST_TAG}" ]; then
  99. export LAST_TAG="${CIRCLE_BRANCH}"
  100. echo "Last tag not found. Possibly fresh branch or feature branch. Setting ${LAST_TAG} as tag."
  101. fi
  102. export NEXT_TAG="`python -u scripts/release_management/bump-semver.py --version "${LAST_TAG}"`"
  103. echo "Next tag: ${NEXT_TAG}"
  104. echo "export CIRCLE_TAG=\"${NEXT_TAG}\"" > release-version.source
  105. - run:
  106. name: Build dependencies
  107. command: make tools
  108. - persist_to_workspace:
  109. root: .
  110. paths:
  111. - "release-version.source"
  112. - save_cache:
  113. key: v2-release-deps-{{ checksum "go.sum" }}
  114. paths:
  115. - "/go/pkg/mod"
  116. build_artifacts:
  117. executor: golang
  118. parallelism: 5
  119. steps:
  120. - restore_cache:
  121. name: "Restore source code cache"
  122. keys:
  123. - go-src-v1-{{ .Revision }}
  124. - checkout
  125. - restore_cache:
  126. name: "Restore release dependencies cache"
  127. keys:
  128. - v2-release-deps-{{ checksum "go.sum" }}
  129. - attach_workspace:
  130. at: /tmp/workspace
  131. - run:
  132. name: Build artifact
  133. command: |
  134. # Setting CIRCLE_TAG because we do not tag the release ourselves.
  135. source /tmp/workspace/release-version.source
  136. if test ${CIRCLE_NODE_INDEX:-0} == 0 ;then export GOOS=linux GOARCH=amd64 && export OUTPUT=build/tendermint_${GOOS}_${GOARCH} && make build && python -u scripts/release_management/zip-file.py ;fi
  137. if test ${CIRCLE_NODE_INDEX:-0} == 1 ;then export GOOS=darwin GOARCH=amd64 && export OUTPUT=build/tendermint_${GOOS}_${GOARCH} && make build && python -u scripts/release_management/zip-file.py ;fi
  138. if test ${CIRCLE_NODE_INDEX:-0} == 2 ;then export GOOS=windows GOARCH=amd64 && export OUTPUT=build/tendermint_${GOOS}_${GOARCH} && make build && python -u scripts/release_management/zip-file.py ;fi
  139. if test ${CIRCLE_NODE_INDEX:-0} == 3 ;then export GOOS=linux GOARCH=arm && export OUTPUT=build/tendermint_${GOOS}_${GOARCH} && make build && python -u scripts/release_management/zip-file.py ;fi
  140. if test ${CIRCLE_NODE_INDEX:-0} == 4 ;then export GOOS=linux GOARCH=arm64 && export OUTPUT=build/tendermint_${GOOS}_${GOARCH} && make build && python -u scripts/release_management/zip-file.py ;fi
  141. - persist_to_workspace:
  142. root: build
  143. paths:
  144. - "*.zip"
  145. - "tendermint_linux_amd64"
  146. release_artifacts:
  147. executor: golang
  148. steps:
  149. - restore_cache:
  150. name: "Restore source code cache"
  151. keys:
  152. - go-src-v1-{{ .Revision }}
  153. - checkout
  154. - attach_workspace:
  155. at: /tmp/workspace
  156. - run:
  157. name: "Deploy to GitHub"
  158. command: |
  159. # Setting CIRCLE_TAG because we do not tag the release ourselves.
  160. source /tmp/workspace/release-version.source
  161. echo "---"
  162. ls -la /tmp/workspace/*.zip
  163. echo "---"
  164. python -u scripts/release_management/sha-files.py
  165. echo "---"
  166. cat /tmp/workspace/SHA256SUMS
  167. echo "---"
  168. export RELEASE_ID="`python -u scripts/release_management/github-draft.py`"
  169. echo "Release ID: ${RELEASE_ID}"
  170. #Todo: Parallelize uploads
  171. export GOOS=linux GOARCH=amd64 && python -u scripts/release_management/github-upload.py --id "${RELEASE_ID}"
  172. export GOOS=darwin GOARCH=amd64 && python -u scripts/release_management/github-upload.py --id "${RELEASE_ID}"
  173. export GOOS=windows GOARCH=amd64 && python -u scripts/release_management/github-upload.py --id "${RELEASE_ID}"
  174. export GOOS=linux GOARCH=arm && python -u scripts/release_management/github-upload.py --id "${RELEASE_ID}"
  175. export GOOS=linux GOARCH=arm64 && python -u scripts/release_management/github-upload.py --id "${RELEASE_ID}"
  176. python -u scripts/release_management/github-upload.py --file "/tmp/workspace/SHA256SUMS" --id "${RELEASE_ID}"
  177. python -u scripts/release_management/github-publish.py --id "${RELEASE_ID}"
  178. # # Test RPC implementation against the swagger documented specs
  179. # contract_tests:
  180. # working_directory: /home/circleci/.go_workspace/src/github.com/tendermint/tendermint
  181. # machine:
  182. # image: circleci/classic:latest
  183. # environment:
  184. # GOBIN: /home/circleci/.go_workspace/bin
  185. # GOPATH: /home/circleci/.go_workspace/
  186. # GOOS: linux
  187. # GOARCH: amd64
  188. # parallelism: 1
  189. # steps:
  190. # - checkout
  191. # - run:
  192. # name: Test RPC endpoints against swagger documentation
  193. # command: |
  194. # set -x
  195. # export PATH=~/.local/bin:$PATH
  196. # # install node and dredd
  197. # ./scripts/get_nodejs.sh
  198. # # build the binaries with a proper version of Go
  199. # docker run --rm -v "$PWD":/go/src/github.com/tendermint/tendermint -w /go/src/github.com/tendermint/tendermint golang make build-linux build-contract-tests-hooks
  200. # # This docker image works with go 1.7, we can install here the hook handler that contract-tests is going to use
  201. # go get github.com/snikch/goodman/cmd/goodman
  202. # make contract-tests
  203. workflows:
  204. version: 2
  205. docs:
  206. jobs:
  207. - deploy_docs:
  208. context: tendermint-docs
  209. filters:
  210. branches:
  211. only:
  212. - master
  213. tags:
  214. only:
  215. - /^v.*/
  216. - deploy_docs:
  217. context: tendermint-docs-staging
  218. filters:
  219. branches:
  220. only:
  221. - docs-staging
  222. # - contract_tests:
  223. # requires:
  224. # - setup_dependencies
  225. release:
  226. jobs:
  227. - prepare_build:
  228. filters:
  229. branches:
  230. only:
  231. - /v[0-9]+\.[0-9]+/
  232. - build_artifacts:
  233. requires:
  234. - prepare_build
  235. filters:
  236. branches:
  237. only:
  238. - /v[0-9]+\.[0-9]+/
  239. - release_artifacts:
  240. requires:
  241. - prepare_build
  242. - build_artifacts
  243. filters:
  244. branches:
  245. only:
  246. - /v[0-9]+\.[0-9]+/