forked from gipit/gips
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.gitlab-ci.yml
91 lines (87 loc) · 3.04 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
variables:
CONT_NAME: "gips_test_${CI_COMMIT_REF_SLUG}_runner"
BASE_IMG_NAME: "gips-base_${CI_COMMIT_REF_SLUG}"
IMG_NAME: "gips_test_${CI_COMMIT_REF_SLUG}"
make_image:
stage: build
script:
- docker pull regrow/gippy:1.0.5-UGU
- docker build --no-cache -t ${BASE_IMG_NAME} --build-arg SENTINEL1=NO -f Dockerfile .
- docker build --no-cache -t ${IMG_NAME}
--build-arg BASE_IMAGE=${BASE_IMG_NAME} -f docker/gips-ci.docker .
- docker image rm ${BASE_IMG_NAME}
tags:
- gipsdev
after_script:
- docker system prune -f
run_tests:
stage: test
script:
- docker run --rm -itd --name ${CONT_NAME}
-v /net/cluster/projects/gips-dev/sys-test-assets/:/artifact-store
-v ${PWD}:/backdoor
-e AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
-e AWS_REGION=${AWS_REGION}
-e AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
-e AWS_REQUEST_PAYER=requester
${IMG_NAME} sleep 1h
- docker exec ${CONT_NAME}
pytest -vv -s -k 'unit or int'
--cov gips
--junit-xml=/backdoor/unit_int_tests-$CI_COMMIT_REF_SLUG.xml
- docker exec ${CONT_NAME}
pytest -r es -vv --slow --setup-repo --sys -s
--cov gips
-m lite -k process
--cov-append
--junit-xml=/backdoor/proc_tests-$CI_COMMIT_REF_SLUG.xml
- docker exec ${CONT_NAME}
pytest -r es -vv --slow --setup-repo --sys -s
--cov gips
-m lite -k export
--cov-append
--junit-xml=/backdoor/export_tests-$CI_COMMIT_REF_SLUG.xml
- docker exec ${CONT_NAME}
pytest -r es -vv --slow --setup-repo --sys -s
--cov gips
-m lite -k stats
--cov-append
--junit-xml=/backdoor/stats_tests-$CI_COMMIT_REF_SLUG.xml
--cov-report xml --cov-fail-under=46
tags:
- gipsdev
artifacts:
reports:
junit:
- unit_int_tests-$CI_COMMIT_REF_SLUG.xml
- proc_tests-$CI_COMMIT_REF_SLUG.xml
- export_tests-$CI_COMMIT_REF_SLUG.xml
- stats_tests-$CI_COMMIT_REF_SLUG.xml
cobertura: coverage.xml
after_script:
- docker container kill ${CONT_NAME}
- docker rmi -f ${IMG_NAME}
- docker system prune -f
#publish_image:
# stage: deploy
# only:
# - tags
# script:
# - apt-get update && apt-get -y install wget git
# - wget -O sixs ftp://$AGSFTPUSERNAME:$AGSFTPPASSWORD@agsftp.ags.io/gipsftp/sixs
# - wget -O ortho ftp://$AGSFTPUSERNAME:$AGSFTPPASSWORD@agsftp.ags.io/gipsftp/ortho
# - git checkout $CI_COMMIT_SHA
# - VERSION=$(PYTHONPATH=. python -c 'import gips ; print(gips.__version__)')
# - test -z "$(docker image ls --quiet registry.ags.io/gips:$VERSION)" -a "v$VERSION" = "$CI_COMMIT_REF_NAME"
# - docker build -t gippy-03x-release -f docker/gippy-release.docker docker
# # TODO GIPS_VERSION isn't actually used?
# - docker build --no-cache
# --build-arg GIPS_VERSION=$VERSION
# -t registry.ags.io/gips:$VERSION
# -f docker/gips-production.docker .
# - docker push registry.ags.io/gips:$VERSION
# - docker rmi registry.ags.io/gips:$VERSION
# tags:
# - gipsdev
# after_script:
# - docker system prune -f