config.yml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. # Python CircleCI 2.0 configuration file
  2. #
  3. # Check https://circleci.com/docs/2.0/language-python/ for more details
  4. #
  5. version: 2
  6. jobs:
  7. build:
  8. docker:
  9. # specify the version you desire here
  10. # use `-browsers` prefix for selenium tests, e.g. `3.6.1-browsers`
  11. # - image: circleci/python:3.6.1
  12. - image: gethue/hue:latest
  13. # Specify service dependencies here if necessary
  14. # CircleCI maintains a library of pre-built images
  15. # documented at https://circleci.com/docs/2.0/circleci-images/
  16. # - image: circleci/postgres:9.4
  17. working_directory: ~/repo
  18. steps:
  19. - checkout
  20. # Download and cache dependencies
  21. # - restore_cache:
  22. # keys:
  23. # - v1-dependencies-{{ checksum "requirements.txt" }}
  24. # # fallback to using the latest cache if no exact match is found
  25. # - v1-dependencies-
  26. # - run:
  27. # name: install dependencies
  28. # command: |
  29. # python -m venv venv
  30. # . venv/bin/activate
  31. # pip install -r requirements.txt
  32. # - save_cache:
  33. # paths:
  34. # - ./venv
  35. # key: v1-dependencies-{{ checksum "requirements.txt" }}
  36. # Revert to traditional pip install when build refactored, in the meantime:
  37. - run:
  38. name: refresh sources
  39. command: |
  40. rm -r /usr/share/hue/desktop/core/src/desktop
  41. cp -r desktop/core/src/desktop /usr/share/hue/desktop/core/src/desktop
  42. for lib in `ls desktop/libs`
  43. do
  44. rm -r /usr/share/hue/desktop/libs/$lib/src/$lib
  45. cp -r desktop/libs/$lib/src/$lib /usr/share/hue/desktop/libs/$lib/src/$lib
  46. done
  47. for lib in `ls apps | grep -v Makefile`
  48. do
  49. rm -r /usr/share/hue/apps/$lib/src/$lib
  50. cp -r apps/$lib/src/$lib /usr/share/hue/apps/$lib/src/$lib
  51. done
  52. rm -r /usr/share/hue/tools
  53. cp -r tools /usr/share/hue
  54. rm /usr/share/hue/desktop/conf/*.ini
  55. cp desktop/conf/pseudo-distributed.ini.tmpl /usr/share/hue/desktop/conf/pseudo-distributed.ini
  56. cd /usr/share/hue
  57. # make npm-install # Not available
  58. cp ~/repo/.babelrc .
  59. cp ~/repo/webpack.config*.js .
  60. npm install
  61. npm run webpack
  62. npm run webpack-login
  63. npm run webpack-workers
  64. ./build/env/bin/hue collectstatic --noinput
  65. # cp -r ~/repo/docs .
  66. # make doc
  67. # hugo --source docs/docs-site
  68. # Run tests
  69. - run:
  70. name: run python API tests
  71. command: |
  72. cd /usr/share/hue
  73. ./build/env/bin/hue test unit --with-xunit --with-cover
  74. - run:
  75. name: run js tests
  76. command: |
  77. cd /usr/share/hue
  78. npm run test
  79. # Code analyses
  80. - run:
  81. name: run js lint
  82. command: |
  83. cd /usr/share/hue
  84. cp ~/repo/.eslint* .
  85. cp ~/repo/.prettierrc .
  86. cp ~/repo/tools . -r
  87. npm run lint
  88. - store_artifacts:
  89. path: test-reports
  90. destination: test-reports
  91. commit:
  92. docker:
  93. - image: circleci/python:3.6.1
  94. working_directory: ~/repo
  95. steps:
  96. - checkout
  97. - add_ssh_keys:
  98. fingerprints:
  99. - "8c:68:29:28:04:80:38:31:c0:59:d9:3d:65:3e:b7:8c"
  100. - run:
  101. name: push to master
  102. command: |
  103. git push origin HEAD:master
  104. workflows:
  105. version: 2
  106. run-tests-and-rebase-master:
  107. jobs:
  108. - build:
  109. filters:
  110. branches:
  111. ignore:
  112. - master
  113. - commit:
  114. requires:
  115. - build
  116. filters:
  117. branches:
  118. only:
  119. - /.*ci-commit-master.*/