forked from greenbluelab/musterstadt-giesst-treedata
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
67 lines (58 loc) · 2.31 KB
/
.gitlab-ci.yml
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
stages:
- prepare
- process
variables:
# Use TLS https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#tls-enabled
DOCKER_HOST: tcp://docker:2376
DOCKER_TLS_CERTDIR: "/certs"
CONDA_BASE_IMAGE: $CI_REGISTRY/leipziggiesst/treedata/conda:latest
CONTAINER_BASE_IMAGE: $CI_REGISTRY/leipziggiesst/treedata/treedata:latest
build-conda-image:
when: manual
stage: prepare
image: docker:20.10.16
services:
- docker:20.10.16-dind
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- cd ./.docker
- docker build -t $CONDA_BASE_IMAGE .
- docker push $CONDA_BASE_IMAGE
build-base-image:
when: manual
stage: prepare
image: docker:20.10.16
services:
- docker:20.10.16-dind
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker build -t $CONTAINER_BASE_IMAGE .
- docker push $CONTAINER_BASE_IMAGE
download-and-process-treedata:
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
when: always
- when: manual
stage: process
environment:
name: $CI_COMMIT_REF_NAME
image: $CONTAINER_BASE_IMAGE
script:
- /bin/bash -c "conda run -n treedata python ./treedata/main.py trees --source-encoding iso-8859-1 --xml-file-name wfs --skip-convert-to-geojson"
- /bin/bash -c "sed -i s/UTF-8/ISO-8859-1/g resources/trees/wfs.xml"
- /bin/bash -c "conda run -n treedata python ./treedata/main.py trees --source-encoding iso-8859-1 --xml-file-name wfs --geojson-file-name trees --skip-download-wfs-xml"
- /bin/bash -c "conda run -n treedata python ./treedata/main.py trees_process --city-shape-geojson-file-name city_shape --trees-geojson-file-name trees --geojson-file-name trees-transformed --database-table-name trees_tmp"
download-and-process-radolan-data:
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
when: always
- when: manual
stage: process
environment:
name: $CI_COMMIT_REF_NAME
image: $CONTAINER_BASE_IMAGE
script:
- /bin/bash -c "conda install -y -c conda-forge gdal krb5"
- /bin/bash -c "pip install gssapi"
- /bin/bash -c "gdalwarp --version"
- /bin/bash -c "conda run -n treedata python ./treedata/main.py weather --start-days-offset 2 --end-days-offset 1 --city-shape-geojson-file-name city_shape --city-shape-buffer-file-name city_shape-buffered"