-
Notifications
You must be signed in to change notification settings - Fork 7
/
.gitlab-ci.yml
117 lines (103 loc) · 2.24 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
image: docker:latest
services:
- docker:dind
variables:
IMG_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
GIT_STRATEGY: clone
before_script:
- echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" "$CI_REGISTRY" --password-stdin
- docker pull $IMG_TAG || true
- apk update && apk add --no-cache git bash
stages:
- build
- test
- release
build_image:
tags:
- docker
stage: build
script:
- >
docker build
--build-arg STORAGE_HOST
--build-arg BUCKET_NAME
--build-arg STORAGE_REMOTE
--cache-from $IMG_TAG
-t $IMG_TAG
.
- docker push $IMG_TAG
after_script:
- docker container prune -f || true
- docker image prune -f || true
check_nbdev:
tags:
- docker
stage: test
script:
- >
docker run -i --rm
$IMG_TAG
/bin/bash -c "
poetry run nbdev_read_nbs &&
./scripts/check_clean_nb.sh &&
./scripts/check_lib_diff.sh
"
run_tests:
tags:
- docker
stage: test
script:
- >
docker run -i --rm
--env MASTER_TOKEN=$MASTER_TOKEN
$IMG_TAG
/bin/bash -c "./scripts/test_nb.sh"
check_lint:
tags:
- docker
stage: test
script:
- >
docker run -i --rm
--env MASTER_TOKEN=$MASTER_TOKEN
$IMG_TAG
/bin/bash -c "./scripts/check_lint.sh"
build_whls_release:
tags:
- docker
stage: release
when: manual
script:
- >
docker run -i --rm
$IMG_TAG
/bin/bash -c "poetry build -f wheel && poetry publish -r palaimon -u $POETRY_HTTP_BASIC_PYPI_USERNAME -p $POETRY_HTTP_BASIC_PYPI_PASSWORD"
build_whls_internal:
tags:
- docker
stage: release
when: manual
script:
- >
docker run -i $IMG_TAG
/bin/bash -c "
poetry config repositories.PYPIPALAIMON ${CI_API_V4_URL}/projects/299/packages/pypi &&
poetry build -f wheel &&
poetry publish --repository PYPIPALAIMON -u gitlab-ci-token -p ${CI_JOB_TOKEN}
"
pages:
tags:
- docker
stage: release
# only:
# - master
script:
- >
docker run -i --rm
-v $(pwd)/public:/app/_build/html
$IMG_TAG
/bin/bash -c "poetry run make docs"
- rm -rf $(pwd)/public/.doctrees
artifacts:
paths:
- public