.gitlab-ci.yml 2.62 KB
Newer Older
Amir MOHAMMADI's avatar
Amir MOHAMMADI 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.
André Anjos's avatar
André Anjos committed
3

Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
4 5 6
# Definition of global variables (all stages)
variables:
  CONDA_ROOT: "${CI_PROJECT_DIR}/miniconda"
André Anjos's avatar
André Anjos committed
7

Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
8 9

# Definition of our build pipeline order
André Anjos's avatar
André Anjos committed
10 11
stages:
  - build
12
  - deploy
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
13
  - pypi
André Anjos's avatar
André Anjos committed
14 15


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


Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
34
.build_linux_template: &linux_build_job
35
  <<: *build_job
André Anjos's avatar
André Anjos committed
36
  tags:
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
37 38 39 40 41 42 43 44 45 46
    - 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"
André Anjos's avatar
André Anjos committed
47 48


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


Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
63 64 65 66
build_linux_27:
  <<: *linux_build_job
  variables:
    PYTHON_VERSION: "2.7"
André Anjos's avatar
André Anjos committed
67 68


69
build_linux_36:
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
70 71
  <<: *linux_build_job
  variables:
72
    PYTHON_VERSION: "3.6"
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
73 74 75 76 77 78 79 80
    BUILD_EGG: "true"
  artifacts:
    expire_in: 1 week
    paths:
      - _ci/
      - dist/*.zip
      - sphinx
      - ${CONDA_ROOT}/conda-bld/linux-64/*.tar.bz2
81 82


André Anjos's avatar
André Anjos committed
83
build_macosx_27:
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
84 85
  <<: *macosx_build_job
  variables:
86
    PYTHON_VERSION: "2.7"
André Anjos's avatar
André Anjos committed
87 88


Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
89 90 91 92
build_macosx_36:
  <<: *macosx_build_job
  variables:
    PYTHON_VERSION: "3.6"
André Anjos's avatar
André Anjos committed
93 94


Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
95 96 97 98
# Deploy targets
.deploy_template: &deploy_job
  stage: deploy
  before_script:
99
    - ./_ci/install.sh _ci master #updates ci support scripts
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
100 101
  script:
    - ./_ci/deploy.sh
André Anjos's avatar
André Anjos committed
102
  dependencies:
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
103 104 105 106
    - build_linux_27
    - build_linux_36
    - build_macosx_27
    - build_macosx_36
André Anjos's avatar
André Anjos committed
107
  tags:
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
108
    - deployer
André Anjos's avatar
André Anjos committed
109 110


Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
111 112 113 114 115
deploy_beta:
  <<: *deploy_job
  environment: beta
  only:
    - master
André Anjos's avatar
André Anjos committed
116 117


Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
118 119 120 121 122 123 124 125
deploy_stable:
  <<: *deploy_job
  environment: stable
  only:
    - /^v\d+\.\d+\.\d+([abc]\d*)?$/  # PEP-440 compliant version (tags)
  except:
    - branches

André Anjos's avatar
André Anjos committed
126

Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
127 128 129 130 131 132 133 134
pypi:
  stage: pypi
  environment: pypi
  only:
    - /^v\d+\.\d+\.\d+([abc]\d*)?$/  # PEP-440 compliant version (tags)
  except:
    - branches
  before_script:
135
    - ./_ci/install.sh _ci master #updates ci support scripts
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
136 137
  script:
    - ./_ci/pypi.sh
André Anjos's avatar
André Anjos committed
138
  dependencies:
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
139
    - build_linux_36
André Anjos's avatar
André Anjos committed
140
  tags:
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
141
    - deployer