-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.travis.yml
57 lines (43 loc) · 1.1 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
56
57
sudo: required
dist: bionic
language: python
python:
- "3.9"
services: docker
git:
depth: 5
branches:
only:
- main
addons:
apt:
update: true
packages:
- gettext
install:
# Install Python linters
- pip install --quiet --upgrade pip
- pip install --quiet flake8
before_script:
- export IMAGENAME="$QUAY_URL"/"$APPLICATION_NAME"-"$APPLICATION_MAINTAINER"
- export IMAGETAG="$(date '+%Y.%m.%d')-$(git rev-parse --short HEAD)"
script:
# Run Python linter
- flake8 --max-line-length=100 bin/
# Connect to quay.io
- docker login -u "$QUAY_USERNAME" -p "$QUAY_API_KEY" quay.io
- docker image build --tag "$IMAGENAME":"$IMAGETAG" .
- docker image push "$IMAGENAME":"$IMAGETAG"
- if [ "$TRAVIS_BRANCH" == "main" ]; then
docker image tag "$IMAGENAME":"$IMAGETAG" "$IMAGENAME":latest;
docker image push "$IMAGENAME":latest;
fi;
after_script:
- pip list
env:
global:
- QUAY_USERNAME=st4sd+mdlab
- QUAY_URL=quay.io/st4sd/community-applications
- APPLICATION_MAINTAINER=mdlab
- APPLICATION_NAME=geometry
# QUAY_API_KEY defined via web UI