-
-
Notifications
You must be signed in to change notification settings - Fork 38
/
.gitlab-ci.yml
75 lines (68 loc) · 3.01 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
# Note: We use --silent argument on yarn invocations to keep the output simple
# and readable through email notifications.
default:
image: node:18
# Change pip's cache directory to be inside the project directory since we can
# only cache local items.
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
APT_CACHE_DIR: "$CI_PROJECT_DIR/apt-cache"
ci:
before_script:
- yarn install
script:
# Lint and check last commit in a dedicated task.
# JS code lint.
- yarn run --silent ci:lint-full
# Client TS code check.
- yarn run ci:ts-client
# Domain specific checks.
- yarn run --silent ci:banks
- yarn run --silent ci:locales
- yarn run --silent ci:config
# Build the server and client code in development and production. Also install python dependencies
# for further jobs.
- yarn run --silent build:ci
# Install lxml, dev and yaml to prevent weboob from compiling them. This cannot be done in after_script: this would not be cached.
- apt-get update && apt-get install -y python3-pip python3-virtualenv python3-lxml python3-dev python3-yaml
- update-alternatives --install /usr/bin/python python $(which python3) 1
# Create a virtualenv to cache installed modules.
- python -m virtualenv -p /usr/bin/python3 venv
- source venv/bin/activate
# Fix for outdated pip and setuptools.
- pip3 install --upgrade requests
# Install weboob.
- mkdir -p .woob
- pip3 install woob -t .woob
- pip3 install black
# Run tests.
# Generate EN locale to avoid exceptions like "Unknown exception raised: 'ascii' codec can't decode byte".
- mkdir -p $APT_CACHE_DIR
- apt-get update && apt-get install -o dir::cache::archives=$APT_CACHE_DIR -y locales
- echo "en_US UTF-8" > /etc/locale.gen
- locale-gen C.UTF-8 && update-locale C.UTF-8
- export LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8
# Activate the virtualenv
- source venv/bin/activate
# Run the CI test suite without woob.
- yarn run --silent ci:test
# Lint Python code.
- KRESUS_WOOB_DIR=.woob yarn run --silent ci:python
# Run the CI test suite with woob.
- KRESUS_WOOB_DIR=.woob yarn run --silent ci:test
.docker: &docker
cache: {}
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
before_script:
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"https://index.docker.io/v1/\":{\"auth\":\"$DOCKER_AUTH\"}}}" > /kaniko/.docker/config.json
script:
- /kaniko/executor --context $CI_PROJECT_DIR/support/docker --dockerfile $CI_PROJECT_DIR/support/docker/Dockerfile-nightly --destination bnjbvr/kresus-nightly:prod --build-arg VCS_REF=$CI_VCS_REF --build-arg BUILD_DATE=$CI_JOB_TIMESTAMP
build-docker-main:
<<: *docker
rules:
- if: '$CI_PROJECT_NAMESPACE != "kresusapp"'
when: never
- if: '$CI_PIPELINE_SOURCE == "schedule"'