-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
111 lines (98 loc) · 6.11 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
global:
env:
- secure: "MxfwGJxfxWPHHk4qNwNyaK9YXRLdW0sV3ct5b3dZ3kDoV6uKWC5Xq7tZkG96v4GQwnajJdKBHXFHDVJwDSKwUBEI8ZOdRFAgG73/FHjo8OU01y42EuAlBoKqJhO+uHY6nybipQuNfbLOeuH8/qufF/rpL9S59ZajbV5ZONdODDmgUCafah1tOyZpixwM09380kJVh99iAAfsZ9rNDHOzOmFED1KZ9y0k4G08dvlR3+WYNnJZyyUnLHMC1fXa3ekgEw5zGCxCE8hT8QC24D/nEVUKrB08nwq7AkoKeeGqNznF9bTcEdhap5ntK6oubNeI2UxZWdJJ1lrFeMRNplPfB6swsjd6uxNysZqQdzvS6N6DLCDSZ4MJaShv+jkP3FpQeiC5dTN36+DU+j27ccFlOkSxz7ivv+rYyEMesDIb5J8OZB/oEuoAby8zStZ7v4BVZJMK+RGACdlqw66a6oYh7uFV4Ba2uUq6SlSlBwAuB1tPBEz92SxlsP9CMSSVWjoW8KD2UpA0mMmY0W6YRataxAnkx37YZf3h1FeZwmYS9WMgEDWrBwqH3rHP/njwNJRLMsdTk3nTWGkKwiwzfOeel4znZNQYmU2/kWXiNY6c+zRRXR+Q3xCpAKGUM4l9sNzaDWWptQY1poZIl3SJFAimCK1ELR5YNN/ECyOquPvOwZA="
- secure: "FLjyol33MBBMDXzjM5/mYZP+VOl3OYF3L4USUJ3Tnkp0JjUzcgi34frPlvoyDokqJFvui0B7luaSYpbK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fls4Ar5Qvldg/oKS+ADyQa5Zt1QU39MU4Ep/xXhQ7/l85V1fKoR0Y/HSADDzTN6fETnhpHLuLIKcrHHFqRAkRjeztn7AYxSygwxXUSTu7aI+/2C53fJQKunozkDsIwturi+GnoXb8zVZgIQo/83jFMY09luBPLMmaoKnSsy1Vv1HP1w8aH9EQOcm66Gj+VslpToTuyacTZPL0A="
language: python
sudo: false
cache:
apt: true
directories:
- $HOME/.cache/pip
- $HOME/download
python:
- "2.7"
#- "3.4"
- "3.5"
- "3.6"
before_install:
- pip install pip -U
- pip install -r requirements.txt -U
install:
- travis_retry pip install -e .
script:
#- travis_wait ./run_tests.py
#- travis_wait python run_tests.py
- travis_wait pytest --cov-config .coveragerc --cov-report html --xdoc --cov=xinspect xinspect
after_success:
- codecov
- gpg --version
- gpg2 --version
- export GPG_EXECUTABLE=gpg2
- openssl version
- |
__heredoc__='''
# Load or generate secrets
source $(secret_loader.sh)
echo $TRAVIS_SECRET
echo $TWINE_USERNAME
# encrypt relevant travis variables
travis encrypt TRAVIS_SECRET=$TRAVIS_SECRET
travis encrypt TWINE_PASSWORD=$TWINE_PASSWORD
travis encrypt TWINE_USERNAME=$TWINE_USERNAME
# HOW TO ENCRYPT YOUR SECRET GPG KEY
IDENTIFIER="travis-ci-Erotemic"
KEYID=$(gpg --list-keys --keyid-format LONG "$IDENTIFIER" | head -n 2 | tail -n 1 | awk '{print $1}' | tail -c 9)
echo "KEYID = $KEYID"
# Export plaintext gpg public keys, private keys, and trust info
mkdir -p dev
gpg --armor --export-secret-keys $KEYID > dev/travis_secret_gpg_key.pgp
gpg --armor --export $KEYID > dev/travis_public_gpg_key.pgp
gpg --export-ownertrust > dev/gpg_owner_trust
# Encrypt gpg keys and trust with travis secret
TSP=$TRAVIS_SECRET openssl enc -aes-256-cbc -md MD5 -pass env:TSP -e -a -in dev/travis_public_gpg_key.pgp > dev/travis_public_gpg_key.pgp.enc
TSP=$TRAVIS_SECRET openssl enc -aes-256-cbc -md MD5 -pass env:TSP -e -a -in dev/travis_secret_gpg_key.pgp > dev/travis_secret_gpg_key.pgp.enc
TSP=$TRAVIS_SECRET openssl enc -aes-256-cbc -md MD5 -pass env:TSP -e -a -in dev/gpg_owner_trust > dev/gpg_owner_trust.enc
source $(secret_unloader.sh)
# Look at what we did, clean up, and add it to git
ls dev/*.enc
rm dev/gpg_owner_trust dev/*.pgp
git status
git add dev/*.enc
''' # <hack vim "regex" parser> '
# Decrypt and import GPG Keys / trust
- $GPG_EXECUTABLE --version
- openssl version
- $GPG_EXECUTABLE --list-keys
- TSP=$TRAVIS_SECRET openssl enc -aes-256-cbc -md MD5 -pass env:TSP -d -a -in dev/travis_secret_gpg_key.pgp.enc | $GPG_EXECUTABLE --import
- TSP=$TRAVIS_SECRET openssl enc -aes-256-cbc -md MD5 -pass env:TSP -d -a -in dev/travis_public_gpg_key.pgp.enc | $GPG_EXECUTABLE --import
- TSP=$TRAVIS_SECRET openssl enc -aes-256-cbc -md MD5 -pass env:TSP -d -a -in dev/gpg_owner_trust.enc | $GPG_EXECUTABLE --import-ownertrust
- $GPG_EXECUTABLE --list-keys
- |
pip install twine
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
pip install six pyopenssl ndg-httpsclient pyasn1 -U --user
pip install requests[security] twine --user
elfi
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
pip install six twine
pip install --upgrade pyOpenSSL
fi
# Package and publish to pypi (if on release)
- |
echo "TRAVIS_BRANCH = $TRAVIS_BRANCH"
if [[ "$TRAVIS_BRANCH" == "release" ]]; then
# use set +x to log all intermediate commands
set +x
export CURRENT_BRANCH=$TRAVIS_BRANCH
# TODO: reliable and secure gpg keys
# Relies on a specific environmenmt being available
GPG_KEYID=D297D757 CURRENT_BRANCH=$TRAVIS_BRANCH TWINE_PASSWORD=$TWINE_PASSWORD TWINE_USERNAME=$TWINE_USERNAME GPG_EXECUTABLE=$GPG_EXECUTABLE USE_GPG=True DEPLOY_BRANCH=release TAG_AND_UPLOAD=yes ./publish.sh
set -x
else
GPG_KEYID=D297D757 CURRENT_BRANCH=$TRAVIS_BRANCH TWINE_PASSWORD=$TWINE_PASSWORD TWINE_USERNAME=$TWINE_USERNAME GPG_EXECUTABLE=$GPG_EXECUTABLE USE_GPG=True DEPLOY_BRANCH=release TAG_AND_UPLOAD=no ./publish.sh
fi
cache:
apt: true
directories:
- $HOME/.pip-cache