-
Notifications
You must be signed in to change notification settings - Fork 17
/
.gitlab-ci.yml
93 lines (86 loc) · 2.2 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
stages:
- prepare
- check_code_style
- run_tests
- build
- deploy
variables:
GITLAB_EJ_TOKEN: "gitlab+deploy-token-533883:51xTbvyHGmEfeZZUxUct"
install_dependencies:
stage: prepare
image:
name: python:3.7
pull_policy: if-not-present
script:
- apt update && apt install -y bash git curl
tags:
- osf
check_style:
stage: check_code_style
image:
name: python:3.7
pull_policy: if-not-present
before_script:
- pip install black==22.3.0
script:
- black --check .
tags:
- osf
run_tests:
stage: run_tests
image:
name: python:3.7
pull_policy: if-not-present
script:
- /bin/sh -c 'git clone -b $CI_COMMIT_REF_NAME https://$GITLAB_EJ_TOKEN@gitlab.com/pencillabs/ej/ej-application.git'
- cd ej-application
- pip install poetry
- poetry install --only ci
- poetry run inv test
tags:
- osf
build_dev_image:
stage: build
image:
name: docker
pull_policy: if-not-present
script:
- apk update && apk add git
- git clone -b stable --depth=1 https://$GITLAB_INFRA_TOKEN@gitlab.com/pencillabs/infraestructure/core.git
- cd core
- bin/pencilctl build ej -e dev -b develop -c prod --no-cache --push
only:
refs:
- develop
tags:
- osf
build_prod_image:
stage: build
image:
name: docker
pull_policy: if-not-present
script:
- apk update && apk add git
- git clone -b stable --depth=1 https://$GITLAB_INFRA_TOKEN@gitlab.com/pencillabs/infraestructure/core.git
- cd core
- bin/pencilctl build ej -e dev -b prod -c prod --no-cache --push
only:
refs:
- prod
tags:
- osf
deploy_to_dev:
stage: deploy
image:
name: docker
pull_policy: if-not-present
script:
- apk update && apk add git
- git clone -b stable --depth=1 https://$GITLAB_INFRA_TOKEN@gitlab.com/pencillabs/infraestructure/core.git
- cd core
- bin/pencilctl deploy ej -e dev -c prod
only:
refs:
- develop
tags:
- osf