-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
57 lines (43 loc) · 1.16 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
os: linux
dist: bionic
language: python
python:
- "3.9"
services: docker
git:
depth: 5
branches:
only:
- main
addons:
apt:
update: true
packages:
- gettext
install:
- pip install --quiet --upgrade pip
before_script:
- export IMAGENAME="$QUAY_URL"/"$APPLICATION_NAME"-"$APPLICATION_MAINTAINER"
- export IMAGETAG="$(date '+%Y.%m.%d')-$(git rev-parse --short HEAD)"
script:
# Connect to quay.io
- docker login -u "$QUAY_USERNAME" -p "$QUAY_API_KEY" quay.io
# Build scripts container image into quay.io
- docker image pull "$IMAGENAME":latest || true
- docker image build --cache-from "$IMAGENAME":latest
--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_NAME=flow-simulator-scripts
- APPLICATION_MAINTAINER=mdlab
# QUAY_API_KEY defined via web UI