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.

177 lines
4.2KB

  1. image: chocobozzz/peertube-ci:10
  2. stages:
  3. - build-and-lint
  4. - test
  5. - clients
  6. - docker-nightly
  7. - external-plugins
  8. #before_script:
  9. # - 'sed -i -z "s/database:\n hostname: ''localhost''/database:\n hostname: ''postgres''/" config/test.yaml'
  10. # - 'sed -i -z "s/redis:\n hostname: ''localhost''/redis:\n hostname: ''redis''/" config/test.yaml'
  11. # - if [[ $CI_JOB_STAGE == "test" ]]; then psql -c "create user peertube with password 'peertube';"; fi
  12. # - NOCLIENT=1 yarn install --pure-lockfile --cache-folder .yarn-cache
  13. cache:
  14. key: yarn
  15. paths:
  16. - .yarn-cache
  17. - cached-fixtures
  18. ###
  19. ## Jobs templates
  20. #
  21. #.build-and-lint: &build-and-lint
  22. # stage: build-and-lint
  23. #
  24. #.tests: &tests
  25. # stage: test
  26. # dependencies:
  27. # - build-server
  28. # services:
  29. # - name: postgres:9.6
  30. # alias: postgres
  31. # - name: redis:latest
  32. # alias: redis
  33. # variables:
  34. # PGHOST: postgres
  35. # PGUSER: postgres
  36. # REDIS_HOST: redis
  37. # artifacts:
  38. # expire_in: 1 day
  39. # paths:
  40. # - test*/logs
  41. # when: always
  42. #
  43. ####
  44. ### Build and lint
  45. ##
  46. #build-server:
  47. # <<: *build-and-lint
  48. # artifacts:
  49. # expire_in: 5h
  50. # paths:
  51. # - dist/
  52. # script:
  53. # - npm run build:server
  54. #
  55. #lint:
  56. # <<: *build-and-lint
  57. # script:
  58. # - yarn install --pure-lockfile --cache-folder .yarn-cache
  59. # - npm run ci -- "lint"
  60. #
  61. ####
  62. ### Tests
  63. #
  64. #test-misc:
  65. # <<: *tests
  66. # script:
  67. # - yarn install --pure-lockfile --cache-folder .yarn-cache
  68. # - npm run ci -- "misc"
  69. #
  70. #test-cli:
  71. # <<: *tests
  72. # retry:
  73. # max: 1
  74. # script:
  75. # - npm run ci -- "cli"
  76. #
  77. #api:
  78. # <<: *tests
  79. # parallel: 4
  80. # retry:
  81. # max: 1
  82. # script:
  83. # - NODE_PENDING_JOB_WAIT=1000 npm run ci -- api-$CI_NODE_INDEX
  84. build-openapi-clients:
  85. stage: clients
  86. only:
  87. refs:
  88. - master
  89. - schedules
  90. changes:
  91. - support/doc/api/openapi.yaml
  92. script:
  93. - apt-get update -qq
  94. - apt-get -yqqq install openjdk-8-jre
  95. - yarn install --pure-lockfile
  96. - scripts/openapi-peertube-version.sh
  97. - scripts/openapi-clients.sh
  98. build-nightly:
  99. stage: docker-nightly
  100. only:
  101. - schedules
  102. script:
  103. - yarn install --pure-lockfile --cache-folder .yarn-cache
  104. - npm run nightly
  105. - mkdir "${HOME}/.ssh"
  106. - chmod 700 "${HOME}/.ssh"
  107. - if [ ! -z ${DEPLOYEMENT_KNOWN_HOSTS+x} ]; then echo -e "${DEPLOYEMENT_KNOWN_HOSTS}" > ${HOME}/.ssh/known_hosts; fi
  108. - eval `ssh-agent -s`
  109. - if [ ! -z ${DEPLOYEMENT_KEY+x} ]; then ssh-add <(echo "${DEPLOYEMENT_KEY}"); fi
  110. - if [ ! -z ${DEPLOYEMENT_KEY+x} ]; then scp ./peertube-nightly-* ${DEPLOYEMENT_USER}@${DEPLOYEMENT_HOST}:../../web/nightly; fi
  111. .docker: &docker
  112. stage: docker-nightly
  113. cache: {}
  114. image:
  115. name: gcr.io/kaniko-project/executor:debug
  116. entrypoint: [""]
  117. before_script:
  118. - mkdir -p /kaniko/.docker
  119. - echo "{\"auths\":{\"$CI_REGISTRY\":{\"auth\":\"$CI_REGISTRY_AUTH\",\"email\":\"$CI_REGISTRY_EMAIL\"}}}" > /kaniko/.docker/config.json
  120. script:
  121. - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/support/docker/production/Dockerfile.buster --destination $DOCKER_IMAGE_NAME
  122. build-docker-develop:
  123. <<: *docker
  124. only:
  125. - schedules
  126. variables:
  127. DOCKER_IMAGE_NAME: chocobozzz/peertube:develop-buster
  128. build-docker-tag:
  129. <<: *docker
  130. only:
  131. - tags
  132. variables:
  133. DOCKER_IMAGE_NAME: chocobozzz/peertube:$CI_COMMIT_TAG-buster
  134. build-docker-master:
  135. <<: *docker
  136. only:
  137. - master
  138. variables:
  139. DOCKER_IMAGE_NAME: chocobozzz/peertube:production-buster
  140. test-external-plugins:
  141. stage: external-plugins
  142. only:
  143. - schedules
  144. services:
  145. - name: postgres:9.6
  146. alias: postgres
  147. - name: redis:latest
  148. alias: redis
  149. - name: rroemhild/test-openldap
  150. alias: ldap
  151. variables:
  152. POSTGRES_USER: peertube
  153. POSTGRES_HOST_AUTH_METHOD: trust
  154. REDIS_HOST: redis
  155. artifacts:
  156. expire_in: 1 day
  157. paths:
  158. - test*/logs
  159. when: always
  160. before_script:
  161. - 'sed -i -z "s/database:\n hostname: ''localhost''/database:\n hostname: ''postgres''/" config/test.yaml'
  162. - 'sed -i -z "s/redis:\n hostname: ''localhost''/redis:\n hostname: ''redis''/" config/test.yaml'
  163. - NOCLIENT=1 yarn install --pure-lockfile --cache-folder .yarn-cache
  164. script:
  165. - PGHOST=postgres PGUSER=peertube npm run ci -- "external-plugins"