-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis.yml
55 lines (43 loc) · 1.35 KB
/
.travis.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
version: ~> 1.0
os: linux
dist: bionic
language: python
python: 3.8
services:
- docker
jobs:
include:
- name: languages
language: shell
env:
- CUSTOM_CACHE_DIR=$HOME/.cache/iomirea-run
- DEPLOYED_COMMIT_FILE=$CUSTOM_CACHE_DIR/deployed_commit
cache:
directories:
- $CUSTOM_CACHE_DIR
script:
- scripts/ci_docker_login.sh
# if $DEPLOYED_COMMIT_FILE, read it. otherwise use previous commit
- scripts/build_all_languages.sh $([ -e "$DEPLOYED_COMMIT_FILE" ] && cat "$DEPLOYED_COMMIT_FILE" || echo HEAD^)
- echo $TRAVIS_COMMIT > $DEPLOYED_COMMIT_FILE
- name: main
cache:
pip: true
directories:
- $HOME/.cache/pre-commit
env:
- PIP_DISABLE_PIP_VERSION_CHECK=yes
- DOCKER_IMAGE_NAME=iomirea/run-api-private
before_install:
- docker pull "$DOCKER_IMAGE_NAME" || true # pull to use image as cache
- docker build --cache-from "$DOCKER_IMAGE_NAME" -t "$DOCKER_IMAGE_NAME" . --build-arg GIT_COMMIT=$TRAVIS_COMMIT
install:
- pip install pre-commit # -r requirements.txt
script:
- pre-commit run --all-files
deploy:
edge: true
provider: script
script: scripts/ci_docker_login.sh && docker push $DOCKER_IMAGE_NAME
on:
branch: master