This repository has been archived by the owner on Sep 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
.travis.yml
47 lines (47 loc) · 2.83 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
dist: xenial
language: python
services:
- docker
env:
global:
- IMAGE_NAME=skyuk/docker-registry-exporter
- GOSS_VERSION=0.3.5
- GOSS_PATH=/usr/local/bin/goss
# REGISTRY_USER=
- secure: "J096altzBXDPA//Z5dQOT5tb8V5jCqu+PkRjrpUELTB+BuTEpM6JqMoGFJfvral352e1sUwnURHgEd6Nf7+sAULgHvqh1mVf/bhTzWlVB0XsA/8W2G6TMha6hM/FXt1KPh+0k6DFJqOVcToBl6LWTPj1dhilE9/zdzGsHP6rLnVgAZVxcWARvEAAHriu4fm3g2RHaP0RH/qRrpbCtojFqmTWDAi4jeWTBJpaw4vHBbZpg4oKIfcyaI2iHekU3UzitD1IqrQvuawP/F9li9ul0vPzCEbQJfNrNxVVeZqaA6szR5CFksd9VNms2uMh+zO2olK/w58ePCASM0J5xXe29LV/uH0aLAr/rqmK/uSWRivYhk4vLqC0A96w8bk2+P7FXa/394jY4ZjuYjU81ejuRfPHEjwoYTwyIJvvPxjfZg/aYvueTpWNetWYezv/jPhx2YDT/KsTralBU8IR3KRqu6JeN7NQrdpW1ZXGkjKAZirWK220BBITVwpFjanyqClGB22wpCNWsUiPJQZUpyfUupZ3oZfogyAsrKeR1PUf9UtEutDi6nEHEFl64w9Ay8vN/F4Dc/oX/xg2q9sFwuvekbv8azYDGVDTFDceii4c8XNamdMma/F33JZi39kolBJ+vDwPXdcZfS12/JK/lCgikgQctW/+T+lEahQfzAowN1Y="
# REGISTRY_PASS=
- secure: "D4I4uElXOoNfyCDeoOFGo3MqW0KdyI7jFmWisgrQrB2QN2cgeVQNWow0RF5TujApJrHM2p36YTFQI7tSy3Jp7EaqWj1Zf/L1mHhgbbbvTyrry/XaZ/Aa2j+yQrFGhdnuf4PDUw6ws1j94h1IhU1jdDvDIyFsX5QFZFMd/A9QUAwgPAC39I52zGDOnORCpRI4FKzF3MgV6IpmsIKMCT5uFo3A5F7jPBk62fU3bNMfS31KXMK5KW1XEzQQTTzbzmudDQhoKPNSqCJYx3FZK2RP2WOLge6wVWBQHhxsx6WwKlEdTgfgt1OVkYMMBCJMEvCNfcAqVqT8z/QJPgrWAgTwFx8Pjeklk43cX/s1JLMLMBGZe9OX6Q1dXKoTuRKfbJMqptL7jEaCfCdmG9MmOioJselbs++h0OX3xAQEv6r9zcs5V5lEUp1tDysRFsJ0jxpoPW5M0c61M0B3MCdrPrjpv3/QdZ2zZnTyXoqs7dTWs7o7jfOExEfgVZt4SOP5wAXL2azlwZmO/crm5lbeecVZGiW0ak2jRfdqWO/Zy26tdDkFa2L8XHhjccJ8fBHsWBcNl28E81FuN0DoLZJuqiJqIiPcVC546NOMPKnJxhaR5FlGGDwFjH0+RaAFqIAQa0KC6En37R8d1S515v9SECQQ0gUH7PU6GIVAytfx0G8tl/4="
python:
- "3.7"
before_install:
- sudo curl -L https://github.com/aelsabbahy/goss/releases/download/v$GOSS_VERSION/goss-linux-amd64 -o /usr/local/bin/goss
- sudo curl -L https://github.com/aelsabbahy/goss/releases/download/v$GOSS_VERSION/dgoss -o /usr/local/bin/dgoss
- sudo chmod +rx /usr/local/bin/goss
- sudo chmod +rx /usr/local/bin/dgoss
install:
- pip install -r requirements.txt
- pip install -r dev-requirements.txt
script:
# Ensure the script obeys PEP8 style guide
- flake8 --max-line-length=120 exporter/
# Run unit tests
- pytest
# Check coverage of unit tests and fail if <80%
- pytest --cov=exporter
# Run static code analysis for common security issues
- bandit exporter/*.py
# Check licenses of dependencies are permissive
- liccheck -s strategy.ini
# Check dependencies for known vulnerabilities
- safety check -r requirements.txt
# Package docker application
- docker build -t ${IMAGE_NAME} .
# Run integrated test
- dgoss run -v ${PWD}/integrated-test:/repositories ${IMAGE_NAME} /repositories
before_deploy:
- docker login -u "$REGISTRY_USER" -p "$REGISTRY_PASS"
deploy:
provider: script
script: docker-ci-deploy --version "$TRAVIS_TAG" --version-semver --version-latest "$IMAGE_NAME"
on:
tags: true