.gitlab-ci.yml 3.0 KB

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