.gitlab-ci.yml 2.46 KB
Newer Older
David GEISSBUHLER's avatar
David GEISSBUHLER committed
1 2
# This build file uses template features from YAML so it is generic enough for
# any Bob project. Don't modify it unless you know what you're doing.
3

David GEISSBUHLER's avatar
David GEISSBUHLER committed
4 5 6
# Definition of global variables (all stages)
variables:
  CONDA_ROOT: "${CI_PROJECT_DIR}/miniconda"
7

David GEISSBUHLER's avatar
David GEISSBUHLER committed
8 9

# Definition of our build pipeline order
10 11 12
stages:
  - build
  - deploy
David GEISSBUHLER's avatar
David GEISSBUHLER committed
13
  - pypi
14 15


David GEISSBUHLER's avatar
David GEISSBUHLER committed
16
# Build targets
17 18 19 20 21 22
.build_template: &build_job
  stage: build
  before_script:
    - mkdir _ci
    - curl --silent "https://gitlab.idiap.ch/bob/bob.admin/raw/master/gitlab/install.sh" > _ci/install.sh
    - chmod 755 _ci/install.sh
David GEISSBUHLER's avatar
David GEISSBUHLER committed
23
    - ./_ci/install.sh _ci master #installs ci support scripts
24 25 26 27 28
    - ./_ci/before_build.sh
  script:
    - ./_ci/build.sh
  after_script:
    - ./_ci/after_build.sh
David GEISSBUHLER's avatar
David GEISSBUHLER committed
29
  cache: &build_caches
30
    paths:
David GEISSBUHLER's avatar
David GEISSBUHLER committed
31 32 33
      - miniconda.sh
      - ${CONDA_ROOT}/pkgs/*.tar.bz2
      - ${CONDA_ROOT}/pkgs/urls.txt
34 35


David GEISSBUHLER's avatar
David GEISSBUHLER committed
36
.build_linux_template: &linux_build_job
37 38
  <<: *build_job
  tags:
David GEISSBUHLER's avatar
David GEISSBUHLER committed
39 40 41 42 43 44 45 46 47 48
    - docker
  image: continuumio/conda-concourse-ci
  artifacts:
    expire_in: 1 week
    paths:
      - _ci/
      - ${CONDA_ROOT}/conda-bld/linux-64/*.tar.bz2
  cache:
    <<: *build_caches
    key: "linux-cache"
49 50


David GEISSBUHLER's avatar
David GEISSBUHLER committed
51
.build_macosx_template: &macosx_build_job
52 53
  <<: *build_job
  tags:
David GEISSBUHLER's avatar
David GEISSBUHLER committed
54 55 56 57 58 59 60 61 62
    - macosx
  artifacts:
    expire_in: 1 week
    paths:
      - _ci/
      - ${CONDA_ROOT}/conda-bld/osx-64/*.tar.bz2
  cache:
    <<: *build_caches
    key: "macosx-cache"
63 64


65
build_linux_36:
David GEISSBUHLER's avatar
David GEISSBUHLER committed
66 67
  <<: *linux_build_job
  variables:
68
    PYTHON_VERSION: "3.6"
David GEISSBUHLER's avatar
David GEISSBUHLER committed
69 70 71 72 73 74 75 76
    BUILD_EGG: "true"
  artifacts:
    expire_in: 1 week
    paths:
      - _ci/
      - dist/*.zip
      - sphinx
      - ${CONDA_ROOT}/conda-bld/linux-64/*.tar.bz2
77 78


David GEISSBUHLER's avatar
David GEISSBUHLER committed
79 80 81 82 83 84 85 86 87 88 89 90 91
build_macosx_36:
  <<: *macosx_build_job
  variables:
    PYTHON_VERSION: "3.6"


# Deploy targets
.deploy_template: &deploy_job
  stage: deploy
  before_script:
    - ./_ci/install.sh _ci master #updates ci support scripts
  script:
    - ./_ci/deploy.sh
92
  dependencies:
David GEISSBUHLER's avatar
David GEISSBUHLER committed
93 94
    - build_linux_36
    - build_macosx_36
95
  tags:
David GEISSBUHLER's avatar
David GEISSBUHLER committed
96
    - deployer
97 98


David GEISSBUHLER's avatar
David GEISSBUHLER committed
99 100 101 102 103
deploy_beta:
  <<: *deploy_job
  environment: beta
  only:
    - master
104 105


David GEISSBUHLER's avatar
David GEISSBUHLER committed
106 107 108 109 110 111 112
deploy_stable:
  <<: *deploy_job
  environment: stable
  only:
    - /^v\d+\.\d+\.\d+([abc]\d*)?$/  # PEP-440 compliant version (tags)
  except:
    - branches
113 114


David GEISSBUHLER's avatar
David GEISSBUHLER committed
115 116 117 118 119 120 121 122 123 124 125
pypi:
  stage: pypi
  environment: pypi
  only:
    - /^v\d+\.\d+\.\d+([abc]\d*)?$/  # PEP-440 compliant version (tags)
  except:
    - branches
  before_script:
    - ./_ci/install.sh _ci master #updates ci support scripts
  script:
    - ./_ci/pypi.sh
126
  dependencies:
David GEISSBUHLER's avatar
David GEISSBUHLER committed
127
    - build_linux_36
128
  tags:
David GEISSBUHLER's avatar
David GEISSBUHLER committed
129
    - deployer