Skip to content

Commit 33f48b4

Browse files
joachimmetzberggren
authored andcommitted
Changes to Travis-CI configuration to use installation script (#832)
1 parent de8f4e3 commit 33f48b4

File tree

3 files changed

+74
-5
lines changed

3 files changed

+74
-5
lines changed

.travis.yml

+22-4
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,46 @@ matrix:
1010
node_js: '8'
1111
virtualenv:
1212
system_site_packages: true
13-
- name: "Ubuntu Xenial (16.04) with Python 2.7"
13+
- name: "Ubuntu Xenial (16.04) with Python 2.7 (pip)"
1414
env: TARGET="linux-python27"
1515
os: linux
1616
dist: xenial
1717
group: edge
1818
language: python
1919
python: 2.7
2020
node_js: '8'
21-
- name: "Ubuntu Xenial (16.04) with Python 3.6"
21+
- name: "Ubuntu Xenial (16.04) with Python 3.6 (pip)"
2222
env: TARGET="linux-python36"
2323
os: linux
2424
dist: xenial
2525
group: edge
2626
language: python
2727
python: 3.6
2828
node_js: '8'
29+
- name: "Ubuntu Bionic (18.04) (Docker) with Python 2.7"
30+
env: UBUNTU_VERSION="18.04"
31+
os: linux
32+
dist: xenial
33+
sudo: required
34+
group: edge
35+
language: python
36+
python: 2.7
37+
services:
38+
- docker
39+
- name: "Ubuntu Bionic (18.04) (Docker) with Python 3.6"
40+
env: UBUNTU_VERSION="18.04"
41+
os: linux
42+
dist: xenial
43+
sudo: required
44+
group: edge
45+
language: python
46+
python: 3.6
47+
services:
48+
- docker
2949
cache:
3050
- yarn
3151
- pip
3252
install:
3353
- ./config/travis/install.sh
34-
- pip install -r requirements.txt
35-
- yarn install
3654
script:
3755
- ./config/travis/run_with_timeout.sh 30 ./config/travis/runtests.sh

config/travis/install.sh

+41-1
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,49 @@
55
# This file is generated by l2tdevtools update-dependencies.py any dependency
66
# related changes should be made in dependencies.ini.
77

8+
DPKG_PYTHON2_DEPENDENCIES="python-alembic python-altair python-amqp python-aniso8601 python-asn1crypto python-attr python-bcrypt python-billiard python-blinker python-bs4 python-celery python-certifi python-cffi python-chardet python-click python-configparser python-cryptography python-datasketch python-dateutil python-editor python-elasticsearch python-elasticsearch5 python-entrypoints python-enum34 python-flask python-flask-bcrypt python-flask-login python-flask-migrate python-flask-restful python-flask-script python-flask-sqlalchemy python-flask-wtf python-gunicorn python-idna python-ipaddress python-itsdangerous python-jinja2 python-jsonschema python-jwt python-kombu python-mako python-markupsafe python-neo4jrestclient python-numpy python-pandas python-parameterized python-pycparser python-pyrsistent python-redis python-requests python-six python-sqlalchemy python-toolz python-typing python-tz python-urllib3 python-vine python-werkzeug python-wtforms python-yaml";
9+
10+
DPKG_PYTHON2_TEST_DEPENDENCIES="python-coverage python-flask-testing python-funcsigs python-mock python-nose python-pbr";
11+
12+
DPKG_PYTHON3_DEPENDENCIES="python3-alembic python3-altair python3-amqp python3-aniso8601 python3-asn1crypto python3-attr python3-bcrypt python3-billiard python3-blinker python3-bs4 python3-celery python3-certifi python3-cffi python3-chardet python3-click python3-cryptography python3-datasketch python3-dateutil python3-editor python3-elasticsearch python3-elasticsearch5 python3-entrypoints python3-flask python3-flask-bcrypt python3-flask-login python3-flask-migrate python3-flask-restful python3-flask-script python3-flask-sqlalchemy python3-flask-wtf python3-gunicorn python3-idna python3-ipaddress python3-itsdangerous python3-jinja2 python3-jsonschema python3-jwt python3-kombu python3-mako python3-markupsafe python3-neo4jrestclient python3-numpy python3-pandas python3-parameterized python3-pycparser python3-pyrsistent python3-redis python3-requests python3-six python3-sqlalchemy python3-toolz python3-tz python3-urllib3 python3-vine python3-werkzeug python3-wtforms python3-yaml";
13+
14+
DPKG_PYTHON3_TEST_DEPENDENCIES="python3-flask-testing python3-mock python3-nose python3-pbr python3-setuptools";
15+
816
# Exit on error.
917
set -e;
10-
if test ${TRAVIS_OS_NAME} = "linux" && test ${TARGET} != "jenkins";
18+
19+
if test -n "${UBUNTU_VERSION}";
20+
then
21+
CONTAINER_NAME="ubuntu${UBUNTU_VERSION}";
22+
23+
docker pull ubuntu:${UBUNTU_VERSION};
24+
25+
docker run --name=${CONTAINER_NAME} --detach -i ubuntu:${UBUNTU_VERSION};
26+
27+
docker exec ${CONTAINER_NAME} apt-get update -q;
28+
docker exec ${CONTAINER_NAME} apt-get install -y software-properties-common;
29+
30+
docker exec ${CONTAINER_NAME} add-apt-repository universe -y;
31+
docker exec ${CONTAINER_NAME} add-apt-repository ppa:gift/dev -y;
32+
33+
docker exec ${CONTAINER_NAME} apt-key adv --fetch-keys https://dl.yarnpkg.com/debian/pubkey.gpg;
34+
docker exec ${CONTAINER_NAME} add-apt-repository "deb https://dl.yarnpkg.com/debian/ stable main";
35+
36+
if test ${TRAVIS_PYTHON_VERSION} = "2.7";
37+
then
38+
docker exec ${CONTAINER_NAME} sh -c "DEBIAN_FRONTEND=noninteractive apt-get install -y git yarn python ${DPKG_PYTHON2_DEPENDENCIES} ${DPKG_PYTHON2_TEST_DEPENDENCIES}";
39+
else
40+
docker exec ${CONTAINER_NAME} sh -c "DEBIAN_FRONTEND=noninteractive apt-get install -y git yarn python3 ${DPKG_PYTHON3_DEPENDENCIES} ${DPKG_PYTHON3_TEST_DEPENDENCIES}";
41+
fi
42+
43+
docker cp ../timesketch ${CONTAINER_NAME}:/
44+
45+
docker exec ${CONTAINER_NAME} sh -c "cd timesketch && yarn install";
46+
47+
elif test ${TRAVIS_OS_NAME} = "linux" && test ${TARGET} != "jenkins";
1148
then
49+
pip install -r requirements.txt;
50+
1251
if test ${TARGET} = "pylint";
1352
then
1453
sudo add-apt-repository ppa:gift/pylint3 -y;
@@ -20,4 +59,5 @@ then
2059
then
2160
sudo apt-get install -y pylint;
2261
fi
62+
yarn install;
2363
fi

config/travis/runtests.sh

+11
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,17 @@ then
2626
PYTHONPATH=api_client/python pylint --rcfile=.pylintrc ${FILE};
2727
done
2828

29+
elif test -n "${UBUNTU_VERSION}";
30+
then
31+
CONTAINER_NAME="ubuntu${UBUNTU_VERSION}";
32+
33+
if test ${TRAVIS_PYTHON_VERSION} = "2.7";
34+
then
35+
docker exec ${CONTAINER_NAME} sh -c "export LANG=en_US.UTF-8; cd timesketch && nosetests";
36+
else
37+
docker exec ${CONTAINER_NAME} sh -c "export LANG=en_US.UTF-8; cd timesketch && nosetests3";
38+
fi
39+
2940
elif test "${TRAVIS_OS_NAME}" = "linux";
3041
then
3142
python ./run_tests.py --full

0 commit comments

Comments
 (0)