项目作者: Negashev

项目描述 :
[DEPRECATED] Skip ci for monorepo in Gitlab CI
高级语言: Python
项目地址: git://github.com/Negashev/cis.git
创建时间: 2018-05-18T07:57:36Z
项目社区:https://github.com/Negashev/cis

开源协议:

下载


CIS (CI Skip)

The ci-accelerator for the mono repository in the CI Gitlab, passes the builds for the folders that you did not touch in the new branch, just using the containers from the previous branch to git flow

example in docker-compose.yml

Dependencies

Some applications in monorepositories depend on neighbors, you can make your dependency map in the variable CIS_DEPENDENCIES_MAP. for example from docker-compose.yml. src / flask depends on the src / python folder, which means that if you hit something in the src / python folder, then CI job for src / flask will also run if it checks its dependencies

gitlab ci

  1. variables:
  2. CIS_SERVICE_PATH: src
  3. CIS_DEPENDENCIES_MAP: |
  4. src/core:
  5. - requirements.txt
  6. src/api:
  7. - src/core
  8. prebuild-core:
  9. stage: prebuild
  10. image: docker:git
  11. services:
  12. - name: negash/cis
  13. alias: cis
  14. variables:
  15. DOCKER_FILE: Dockerfile
  16. CIS_SERVICE_REGEXP: ^prebuild-([\w]{1,})$
  17. script:
  18. - wget cis -O- || exit 0
  19. - #long build (or skip ifs cis work)
  20. - pip install requirements.txt
  21. - #build docker image $CI_REGISTRY_IMAGE/core:$CI_COMMIT_REF_SLUG
  22. build-api:
  23. stage: build
  24. image: docker:git
  25. services:
  26. - name: negash/cis
  27. alias: cis
  28. variables:
  29. DOCKER_FILE: Dockerfile
  30. CIS_SERVICE_REGEXP: ^build-([\w]{1,})$
  31. PULL_IMAGE_WITH_CIS: core
  32. script:
  33. - wget cis -O- || exit 0
  34. - wget cis/$PULL_IMAGE_WITH_CIS?status=200 -O- > /tmp/.PULL_IMAGE_WITH_CIS; docker pull $CI_REGISTRY_IMAGE/core:`cat /tmp/.PULL_IMAGE_WITH_CIS`
  35. - #long build (or skip ifs cis work)
  36. - # --build-arg CI_COMMIT_REF_SLUG=`cat /tmp/.PULL_IMAGE_WITH_CIS`
  37. - # build docker image $CI_REGISTRY_IMAGE/core