Advertisement
Guest User

Untitled

a guest
Jan 27th, 2017
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.44 KB | None | 0 0
  1. # Concourse CI pipeline for Quay. This is similar to what we would
  2. # actually use, but we'd probably use the github-pull-request resource
  3. # rather than just the git repo, and report status back to GitHub.
  4. #
  5. # Also, this would be checked into the quay repo and the configs for
  6. # individual tasks would be split into separate files. The pipeline
  7. # would reference then at runtime so that they can change with the
  8. # code.
  9. #
  10. # The quay-build-image is a Docker image with Python and all the
  11. # libraries we need to run tests. The model of building the Quay
  12. # image, then running the tests inside it doesn't fit the Concourse
  13. # model well.
  14.  
  15. resources:
  16. - name: quay
  17. type: git
  18. source:
  19. uri: git@github.com:coreos-inc/quay.git
  20. branch: master
  21. private_key: {{quay-git-private-key}}
  22.  
  23. jobs:
  24. - name: karma
  25. plan:
  26. - get: quay
  27. tigger: true
  28.  
  29. - task: test
  30. config:
  31. platform: linux
  32. image_resource:
  33. type: docker-image
  34. source:
  35. repository: quay.io/quay/quay-build-image
  36. username: {{quay-robot-username}}
  37. password: {{quay-robot-password}}
  38. inputs:
  39. - name: quay
  40. run:
  41. path: /bin/sh
  42. args:
  43. - -c
  44. - |
  45. set -eux
  46. cd quay
  47. npm install
  48. npm link typescript
  49. npm test
  50.  
  51. - name: unit
  52. plan:
  53. - get: quay
  54. tigger: true
  55.  
  56. - task: test
  57. config:
  58. platform: linux
  59. image_resource:
  60. type: docker-image
  61. source:
  62. repository: quay.io/quay/quay-build-image
  63. username: {{quay-robot-username}}
  64. password: {{quay-robot-password}}
  65. inputs:
  66. - name: quay
  67. run:
  68. path: /bin/sh
  69. args:
  70. - -c
  71. - |
  72. set -eux
  73. export TEST=true
  74. pip install --quiet -r quay/requirements.txt
  75. pip install --quiet -r quay/requirements-tests.txt
  76. cd quay
  77. PYTHONPATH="." py.test --timeout=7200 --verbose \
  78. --show-count -x .
  79.  
  80. - name: registry
  81. plan:
  82. - get: quay
  83. tigger: true
  84.  
  85. - task: test
  86. config:
  87. platform: linux
  88. image_resource:
  89. type: docker-image
  90. source:
  91. repository: quay.io/quay/quay-build-image
  92. username: {{quay-robot-username}}
  93. password: {{quay-robot-password}}
  94. inputs:
  95. - name: quay
  96. run:
  97. path: /bin/sh
  98. args:
  99. - -c
  100. - |
  101. set -eux
  102. export TEST=true
  103. pip install --quiet -r quay/requirements.txt
  104. pip install --quiet -r quay/requirements-tests.txt
  105. cd quay
  106. PYTHONPATH="." py.test --timeout=7200 --verbose \
  107. --show-count -x test/registry_tests.py
  108.  
  109. - name: mysql
  110. plan:
  111. - get: quay
  112. tigger: true
  113.  
  114. - task: test
  115. config:
  116. platform: linux
  117. image_resource:
  118. type: docker-image
  119. source:
  120. repository: quay.io/quay/quay-build-image
  121. username: {{quay-robot-username}}
  122. password: {{quay-robot-password}}
  123. inputs:
  124. - name: quay
  125. run:
  126. path: /bin/sh
  127. args:
  128. - -c
  129. - |
  130. set -eux
  131. export TEST=true
  132. export TEST_DATABASE_URI='mysql+pymysql://quay@127.0.0.1/genschema'
  133. export SKIP_DB_SCHEMA=true
  134. pip install --quiet -r quay/requirements.txt
  135. pip install --quiet -r quay/requirements-tests.txt
  136. service mysql start
  137. mysqladmin create genschema
  138. mysql -e "CREATE USER 'quay'@'127.0.0.1' IDENTIFIED BY '';"
  139. mysql -e "GRANT ALL PRIVILEGES ON *.* TO 'quay'@'127.0.0.1';"
  140. cd quay
  141. PYTHONPATH="." alembic upgrade head
  142. PYTHONPATH="." python -m unittest discover -f
  143. service mysql stop
  144.  
  145. - name: postgres
  146. plan:
  147. - get: quay
  148. tigger: true
  149.  
  150. - task: test
  151. config:
  152. platform: linux
  153. image_resource:
  154. type: docker-image
  155. source:
  156. repository: quay.io/quay/quay-build-image
  157. username: {{quay-robot-username}}
  158. password: {{quay-robot-password}}
  159. inputs:
  160. - name: quay
  161. run:
  162. path: /bin/sh
  163. args:
  164. - -c
  165. - |
  166. set -eux
  167. export TEST=true
  168. export TEST_DATABASE_URI='postgresql://quay:quay@127.0.0.1/quaytest'
  169. export SKIP_DB_SCHEMA=true
  170. pip install --quiet -r quay/requirements.txt
  171. pip install --quiet -r quay/requirements-tests.txt
  172. service postgresql start
  173. su postgres -c "psql -c \"CREATE USER quay WITH PASSWORD 'quay';\""
  174. su postgres -c "psql -c 'CREATE DATABASE quaytest;'"
  175. su postgres -c "psql -c 'GRANT ALL PRIVILEGES ON DATABASE quaytest TO quay;'"
  176. cd quay
  177. PYTHONPATH="." alembic upgrade head
  178. PYTHONPATH="." python -m unittest discover -f
  179. service postgresql stop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement