forked from flare-foundation/fsp-observer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
62 lines (55 loc) · 1.2 KB
/
.gitlab-ci.yml
File metadata and controls
62 lines (55 loc) · 1.2 KB
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
# templates
.test_template: &test
stage: test
variables:
GIT_STRATEGY: none
image:
name: $CI_REGISTRY_IMAGE:$CI_COMMIT_BRANCH
entrypoint: [""]
only:
- branches
.build_template:
stage: build
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- mkdir -p /kaniko/.docker
- echo "$CI_COMMIT_SHA" > COMMIT_HASH
- >
echo "{
\"auths\": {
\"$CI_REGISTRY\": {
\"username\": \"$CI_REGISTRY_USER\",
\"password\":\"$CI_REGISTRY_PASSWORD\"
}
}
}" > /kaniko/.docker/config.json
- >
/kaniko/executor --context $CI_PROJECT_DIR \
--dockerfile $CI_PROJECT_DIR/Dockerfile \
--destination $CI_REGISTRY_IMAGE:$TARGET_REF \
--cache=true \
--cache-ttl=120h
stages:
- build
- test
build_branches:
extends: .build_template
variables:
TARGET_REF: $CI_COMMIT_BRANCH
only:
- branches
build_tags:
extends: .build_template
variables:
TARGET_REF: $CI_COMMIT_TAG
only:
- tags
test_ruff:
<<: *test
script:
- cd /app
- pip install -r dev-requirements.txt
- python -m ruff check .
- python -m ruff format --check