.gitlab-ci.yml 1.46 KB
Newer Older
Gmodena's avatar
Gmodena committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
image: "continuumio/miniconda3"
stages:
  - build
  - test
  - publish
# TODO(gmodena): cross-project artifacts download
# are not available in Gitlab Freemium.
#build-ima-upstream:
#  stage: build-ima
#  script:
#    - ls -lhR
#  needs:
#    - project: gmodena/ImageMatching
#      job: build
#      ref: add-gitlab-ci
#      artifacts: true

# curl is not installed by default on continuumio/miniconda3.
before_script:
  - conda install -y make curl

# Install IMA dependencies in a virtual environment
# and publish it as a build artifact.
# TODO(gmodena): venvs produced by conda-pack and venv-pack
# exceed the artifact size limit provided by gitlab.
# Currently env and dep building is delegated to the "deploy"
# host. In our case, the developer workstation where
# `make deploy` is executed.
#build-ima-deps:
#  stage: build
#  script:
#    - make -C image-matching venv
#  artifacts:
#    paths:
#      - image-matching/venv.tar.gz
#    expire_in: "1 hour"

# Install Apache Spark in the test image.
# TODO(gmodena): we should have a polyglot Docker image with jdk8, python3,
# and spark pre-installed
test-ima:
  stage: test
  script:
    - make test SKIP_DOCKER=true

publish-dags:
  stage: publish
  script:
    - make archive
    - 'curl -v --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file /tmp/platform-airflow-dags.tar.gz "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/platform-airflow-dags/${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}/platform-airflow-dags.tar.gz"'