-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
47 lines (43 loc) · 1.09 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
include:
- project: 'infra/ci-cd/base'
file: '.gitlab-ci.yml'
lint:
stage: check
image: python:3.6
before_script:
- pip install -q flake8
script:
- flake8
allow_failure: true
dependency:
stage: pre-test
image: python:3.6
before_script:
- pip install pipenv
- pipenv install -d --system --ignore-pipfile
script:
- pipenv check
allow_failure: true
pytest:
stage: test
image: python:3.6
before_script:
- apt-get update
- apt-get --yes install libsnappy-dev
- pip install pipenv
- pipenv install -d
script:
- pipenv run python3 -m pytest tests/
allow_failure: false
docker:
dependencies: []
image: registry.mobilityservices.io/infra/images/docker
stage: build
when: always
script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- docker build --build-arg NPM_TOKEN=${NPM_TOKEN} --pull --cache-from
$IMAGE:latest -t $IMAGE:$VERSION -t $IMAGE:latest
--build-arg USERNAME=$USERNAME --build-arg PASSWORD=$PASSWORD .
- docker push $IMAGE:$VERSION
- docker push $IMAGE:latest