Skip to content

Commit 47aa65a

Browse files
authored
Merge pull request #252 from pulp/regenerate-travis
Update the travis config with the plugin_template.
2 parents fab422d + c6ee9b2 commit 47aa65a

File tree

11 files changed

+65
-18
lines changed

11 files changed

+65
-18
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ env:
2121

2222
matrix:
2323
exclude:
24+
2425
- python: '3.6'
2526
env: DB=postgres TEST=docs
2627
fast_finish: true
@@ -75,3 +76,4 @@ jobs:
7576

7677
notifications: None
7778

79+

.travis/before_install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export POST_BEFORE_INSTALL=$TRAVIS_BUILD_DIR/.travis/post_before_install.sh
1515
COMMIT_MSG=$(git log --format=%B --no-merges -1)
1616
export COMMIT_MSG
1717

18-
if [ -x $PRE_BEFORE_INSTALL ]; then
18+
if [ -f $PRE_BEFORE_INSTALL ]; then
1919
$PRE_BEFORE_INSTALL
2020
fi
2121

@@ -81,6 +81,6 @@ cp pulp_python/.travis/postgres.yml ansible-pulp/postgres.yml
8181

8282
cd pulp_python
8383

84-
if [ -x $POST_BEFORE_INSTALL ]; then
84+
if [ -f $POST_BEFORE_INSTALL ]; then
8585
$POST_BEFORE_INSTALL
8686
fi

.travis/before_script.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#
88
# For more info visit https://github.com/pulp/plugin_template
99

10-
set -v
10+
set -euv
1111

1212
export PRE_BEFORE_SCRIPT=$TRAVIS_BUILD_DIR/.travis/pre_before_script.sh
1313
export POST_BEFORE_SCRIPT=$TRAVIS_BUILD_DIR/.travis/post_before_script.sh

.travis/check_commit.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
#
88
# For more info visit https://github.com/pulp/plugin_template
99

10+
set -euv
11+
1012
# skip this check for everything but PRs
1113
if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
1214
exit 0
@@ -18,7 +20,7 @@ elif [ "$TRAVIS_COMMIT" != "" ]; then
1820
RANGE=$TRAVIS_COMMIT
1921
fi
2022

21-
# Travis sends the ranges with 3 dots. Git only wants one.
23+
# Travis sends the ranges with 3 dots. Git only wants two.
2224
if [[ "$RANGE" == *...* ]]; then
2325
RANGE=`echo $TRAVIS_COMMIT_RANGE | sed 's/\.\.\./../'`
2426
else

.travis/install.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#
88
# For more info visit https://github.com/pulp/plugin_template
99

10-
set -v
10+
set -euv
1111

1212
if [ "$TEST" = 'docs' ]; then
1313
pip3 install -r doc_requirements.txt
@@ -20,5 +20,4 @@ cd ../ansible-pulp
2020
ansible-galaxy install -r requirements.yml
2121

2222
ansible-playbook --connection=local --inventory 127.0.0.1, playbook.yml --extra-vars \
23-
"pulp_python_interpreter=$VIRTUAL_ENV/bin/python, pulp_install_dir=$VIRTUAL_ENV \
24-
pulp_db_type=$DB"
23+
"pulp_python_interpreter=$VIRTUAL_ENV/bin/python, pulp_install_dir=$VIRTUAL_ENV"

.travis/playbook.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
- hosts: all
1010
pre_tasks:
1111
- name: Load DB variables
12-
include_vars: '{{ pulp_db_type }}.yml'
12+
include_vars: 'postgres.yml'
1313
vars:
1414
pulp_default_admin_password: admin
1515
pulp_source_dir: '{{ ansible_env.TRAVIS_BUILD_DIR | dirname }}/pulpcore/'
@@ -20,6 +20,7 @@
2020
source_dir: "$TRAVIS_BUILD_DIR"
2121
ansible_python_interpreter: '/opt/pyenv/shims/python3'
2222
pulp_user: 'travis'
23+
pulp_group: 'travis'
2324
developer_user: 'travis'
2425
pulp_install_db: false
2526
pulp_preq_packages: []
@@ -28,7 +29,6 @@
2829
secret_key: 'secret'
2930
databases:
3031
default:
31-
ENGINE: "{{ pulp_db_backend }}"
3232
USER: 'travis'
3333
PASSWORD: ''
3434
environment:

.travis/publish_client_gem.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
#
88
# For more info visit https://github.com/pulp/plugin_template
99

10+
set -euv
11+
1012
echo "---
1113
:rubygems_api_key: $RUBYGEMS_API_KEY" > ~/.gem/credentials
1214
sudo chmod 600 ~/.gem/credentials

.travis/publish_client_pypi.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
#
88
# For more info visit https://github.com/pulp/plugin_template
99

10+
set -euv
11+
1012
pip install twine
1113

1214
django-admin runserver 24817 >> ~/django_runserver.log 2>&1 &

.travis/publish_plugin_pypi.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
#
88
# For more info visit https://github.com/pulp/plugin_template
99

10+
set -euv
11+
1012
pip install twine
1113

1214
python setup.py sdist bdist_wheel --python-tag py3

.travis/script.sh

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ set -mveuo pipefail
1212

1313
export POST_SCRIPT=$TRAVIS_BUILD_DIR/.travis/post_script.sh
1414
export POST_DOCS_TEST=$TRAVIS_BUILD_DIR/.travis/post_docs_test.sh
15+
export FUNC_TEST_SCRIPT=$TRAVIS_BUILD_DIR/.travis/func_test_script.sh
1516

1617
# Needed for both starting the service and building the docs.
1718
# Gets set in .travis/settings.yml, but doesn't seem to inherited by
@@ -41,7 +42,7 @@ if [ "$TEST" = 'docs' ]; then
4142
make html
4243
cd ..
4344

44-
if [ -x $POST_DOCS_TEST ]; then
45+
if [ -f $POST_DOCS_TEST ]; then
4546
$POST_DOCS_TEST
4647
fi
4748
exit
@@ -66,6 +67,30 @@ if [ "$TEST" = 'bindings' ]; then
6667
pip install ./pulp_python-client
6768

6869
python $TRAVIS_BUILD_DIR/.travis/test_bindings.py
70+
71+
if [ ! -f $TRAVIS_BUILD_DIR/.travis/test_bindings.rb ]
72+
then
73+
exit
74+
fi
75+
76+
rm -rf ./pulpcore-client
77+
78+
./generate.sh pulpcore ruby
79+
cd pulpcore-client
80+
gem build pulpcore_client
81+
gem install --both ./pulpcore_client-0.gem
82+
cd ..
83+
84+
rm -rf ./pulp_python-client
85+
86+
./generate.sh pulp_python ruby
87+
88+
cd pulp_python-client
89+
gem build pulp_python_client
90+
gem install --both ./pulp_python_client-0.gem
91+
cd ..
92+
93+
ruby $TRAVIS_BUILD_DIR/.travis/test_bindings.rb
6994
exit
7095
fi
7196

@@ -75,10 +100,14 @@ coverage run $(which django-admin) test ./pulp_python/tests/unit/
75100
# Run functional tests, and upload coverage report to codecov.
76101
show_logs_and_return_non_zero() {
77102
readonly local rc="$?"
78-
cat ~/django_runserver.log
79-
cat ~/content_app.log
80-
cat ~/resource_manager.log
81-
cat ~/reserved_worker-1.log
103+
104+
for logfile in "~/django_runserver.log" "~/content_app.log" "~/resource_manager.log" "~/reserved_worker-1.log"
105+
do
106+
echo -en "travis_fold:start:$logfile"'\\r'
107+
cat $logfile
108+
echo -en "travis_fold:end:$logfile"'\\r'
109+
done
110+
82111
return "${rc}"
83112
}
84113

@@ -94,11 +123,13 @@ coverage run $(which django-admin) runserver 24817 --noreload >> ~/django_runser
94123
wait_for_pulp 20
95124

96125
# Run functional tests
97-
pytest -v -r sx --color=yes --pyargs pulpcore.tests.functional || show_logs_and_return_non_zero
98-
pytest -v -r sx --color=yes --pyargs pulp_python.tests.functional || show_logs_and_return_non_zero
99-
126+
if [ -f $FUNC_TEST_SCRIPT ]; then
127+
$FUNC_TEST_SCRIPT
128+
else
129+
pytest -v -r sx --color=yes --pyargs pulp_python.tests.functional || show_logs_and_return_non_zero
130+
fi
100131

101132

102-
if [ -x $POST_SCRIPT ]; then
133+
if [ -f $POST_SCRIPT ]; then
103134
$POST_SCRIPT
104135
fi

0 commit comments

Comments
 (0)