Skip to content

Commit

Permalink
Merge pull request #239 from dralley/master
Browse files Browse the repository at this point in the history
Depend on pulpcore directly instead of pulpcore-plugin
  • Loading branch information
bmbouter committed Oct 28, 2019
2 parents 679602c + 4ca6ce8 commit fbccd05
Show file tree
Hide file tree
Showing 11 changed files with 81 additions and 122 deletions.
15 changes: 5 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,15 @@ python:
- "3.7"
env:
matrix:
- DB=postgres TEST=pulp
- DB=postgres TEST=docs
- DB=postgres TEST=bindings

- TEST=pulp
- TEST=docs
- TEST=bindings
matrix:
exclude:
- python: '3.7'
env: DB=postgres TEST=bindings
env: TEST=bindings
- python: '3.6'
env: DB=postgres TEST=docs
env: TEST=docs
fast_finish: true
services:
- postgresql
Expand Down Expand Up @@ -53,25 +52,21 @@ jobs:
- stage: publish-daily-client-gem
script: PULP_SETTINGS=/etc/pulp/settings.py bash .travis/publish_client_gem.sh
env:
- DB=postgres
- TEST=bindings
if: type = cron
- stage: publish-daily-client-pypi
script: PULP_SETTINGS=/etc/pulp/settings.py bash .travis/publish_client_pypi.sh
env:
- DB=postgres
- TEST=bindings
if: type = cron
- stage: publish-client-gem
script: PULP_SETTINGS=/etc/pulp/settings.py bash .travis/publish_client_gem.sh
env:
- DB=postgres
- TEST=bindings
if: tag IS present
- stage: publish-client-pypi
script: PULP_SETTINGS=/etc/pulp/settings.py bash .travis/publish_client_pypi.sh
env:
- DB=postgres
- TEST=bindings
if: tag IS present

Expand Down
34 changes: 0 additions & 34 deletions .travis/ansible_playbook.yml

This file was deleted.

79 changes: 47 additions & 32 deletions .travis/before_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,28 @@ if [ -f $PRE_BEFORE_INSTALL ]; then
$PRE_BEFORE_INSTALL
fi

export PULP_PR_NUMBER=$(echo $COMMIT_MSG | grep -oP 'Required\ PR:\ https\:\/\/github\.com\/pulp\/pulpcore\/pull\/(\d+)' | awk -F'/' '{print $7}')
export PULP_PLUGIN_PR_NUMBER=$(echo $COMMIT_MSG | grep -oP 'Required\ PR:\ https\:\/\/github\.com\/pulp\/pulpcore-plugin\/pull\/(\d+)' | awk -F'/' '{print $7}')
export PULP_SMASH_PR_NUMBER=$(echo $COMMIT_MSG | grep -oP 'Required\ PR:\ https\:\/\/github\.com\/PulpQE\/pulp-smash\/pull\/(\d+)' | awk -F'/' '{print $7}')
export PULP_ROLES_PR_NUMBER=$(echo $COMMIT_MSG | grep -oP 'Required\ PR:\ https\:\/\/github\.com\/pulp\/ansible-pulp\/pull\/(\d+)' | awk -F'/' '{print $7}')
export PULP_BINDINGS_PR_NUMBER=$(echo $COMMIT_MSG | grep -oP 'Required\ PR:\ https\:\/\/github\.com\/pulp\/pulp-openapi-generator\/pull\/(\d+)' | awk -F'/' '{print $7}')
if [[ -n $(echo -e $COMMIT_MSG | grep -P "Required PR:.*" | grep -v "https") ]]; then
echo "Invalid Required PR link detected in commit message. Please use the full https url."
exit 1
fi

if [ "$TRAVIS_PULL_REQUEST" != "false" ] || [ -z "$TRAVIS_TAG" -a "$TRAVIS_BRANCH" != "master"]
then
export PULP_PR_NUMBER=$(echo $COMMIT_MSG | grep -oP 'Required\ PR:\ https\:\/\/github\.com\/pulp\/pulpcore\/pull\/(\d+)' | awk -F'/' '{print $7}')
export PULP_SMASH_PR_NUMBER=$(echo $COMMIT_MSG | grep -oP 'Required\ PR:\ https\:\/\/github\.com\/PulpQE\/pulp-smash\/pull\/(\d+)' | awk -F'/' '{print $7}')
export PULP_ROLES_PR_NUMBER=$(echo $COMMIT_MSG | grep -oP 'Required\ PR:\ https\:\/\/github\.com\/pulp\/ansible-pulp\/pull\/(\d+)' | awk -F'/' '{print $7}')
export PULP_BINDINGS_PR_NUMBER=$(echo $COMMIT_MSG | grep -oP 'Required\ PR:\ https\:\/\/github\.com\/pulp\/pulp-openapi-generator\/pull\/(\d+)' | awk -F'/' '{print $7}')
export PULP_OPERATOR_PR_NUMBER=$(echo $COMMIT_MSG | grep -oP 'Required\ PR:\ https\:\/\/github\.com\/pulp\/pulp-operator\/pull\/(\d+)' | awk -F'/' '{print $7}')
else
export PULP_PR_NUMBER=
export PULP_SMASH_PR_NUMBER=
export PULP_ROLES_PR_NUMBER=
export PULP_BINDINGS_PR_NUMBER=
export PULP_OPERATOR_PR_NUMBER=
fi

# dev_requirements should not be needed for testing; don't install them to make sure
# test_requirements contains tools needed for flake8, etc.
# So install them here rather than in install.sh
pip install -r test_requirements.txt

# check the commit message
Expand All @@ -39,48 +54,49 @@ flake8 --config flake8.cfg

cd ..
git clone --depth=1 https://github.com/pulp/ansible-pulp.git
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
if [ -n "$PULP_ROLES_PR_NUMBER" ]; then
cd ansible-pulp
git fetch --depth=1 origin +refs/pull/$PULP_ROLES_PR_NUMBER/merge
git checkout FETCH_HEAD
cd ..
fi
if [ -n "$PULP_ROLES_PR_NUMBER" ]; then
cd ansible-pulp
git fetch --depth=1 origin +refs/pull/$PULP_ROLES_PR_NUMBER/merge
git checkout FETCH_HEAD
cd ..
fi

git clone --depth=1 https://github.com/pulp/pulpcore.git

if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
if [ -n "$PULP_PR_NUMBER" ]; then
cd pulpcore
git fetch --depth=1 origin +refs/pull/$PULP_PR_NUMBER/merge
git checkout FETCH_HEAD
cd ..
fi
git clone --depth=1 https://github.com/pulp/pulp-operator.git
if [ -n "$PULP_OPERATOR_PR_NUMBER" ]; then
cd pulp-operator
git fetch --depth=1 origin +refs/pull/$PULP_OPERATOR_PR_NUMBER/merge
git checkout FETCH_HEAD
RELEASE_VERSION=v0.9.0
curl -LO https://github.com/operator-framework/operator-sdk/releases/download/${RELEASE_VERSION}/operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu
chmod +x operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu && sudo mkdir -p /usr/local/bin/ && sudo cp operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu /usr/local/bin/operator-sdk && rm operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu
sudo operator-sdk build --image-builder=docker quay.io/pulp/pulp-operator:latest
cd ..
fi


git clone --depth=1 https://github.com/pulp/pulpcore-plugin.git
git clone --depth=1 https://github.com/pulp/pulpcore.git

if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
if [ -n "$PULP_PLUGIN_PR_NUMBER" ]; then
cd pulpcore-plugin
git fetch --depth=1 origin +refs/pull/$PULP_PLUGIN_PR_NUMBER/merge
git checkout FETCH_HEAD
cd ..
fi
if [ -n "$PULP_PR_NUMBER" ]; then
cd pulpcore
git fetch --depth=1 origin +refs/pull/$PULP_PR_NUMBER/merge
git checkout FETCH_HEAD
cd ..
fi


git clone --depth=1 https://github.com/PulpQE/pulp-smash.git
# When building a (release) tag, we don't need the development modules for the
# build (they will be installed as dependencies of the plugin).
if [ -z "$TRAVIS_TAG" ]; then
git clone --depth=1 https://github.com/PulpQE/pulp-smash.git

if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
if [ -n "$PULP_SMASH_PR_NUMBER" ]; then
cd pulp-smash
git fetch --depth=1 origin +refs/pull/$PULP_SMASH_PR_NUMBER/merge
git checkout FETCH_HEAD
cd ..
fi

# pulp-smash already got installed via test_requirements.txt
pip install --upgrade --force-reinstall ./pulp-smash
fi
Expand All @@ -89,7 +105,6 @@ psql -c 'CREATE DATABASE pulp OWNER travis;'

pip install ansible
cp pulp_ansible/.travis/playbook.yml ansible-pulp/playbook.yml
cp pulp_ansible/.travis/postgres.yml ansible-pulp/postgres.yml

cd pulp_ansible

Expand Down
4 changes: 3 additions & 1 deletion .travis/check_commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#
# For more info visit https://github.com/pulp/plugin_template

set -euv

# skip this check for everything but PRs
if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
exit 0
Expand All @@ -18,7 +20,7 @@ elif [ "$TRAVIS_COMMIT" != "" ]; then
RANGE=$TRAVIS_COMMIT
fi

# Travis sends the ranges with 3 dots. Git only wants one.
# Travis sends the ranges with 3 dots. Git only wants two.
if [[ "$RANGE" == *...* ]]; then
RANGE=`echo $TRAVIS_COMMIT_RANGE | sed 's/\.\.\./../'`
else
Expand Down
3 changes: 1 addition & 2 deletions .travis/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@ cd ../ansible-pulp
ansible-galaxy install -r requirements.yml

ansible-playbook --connection=local --inventory 127.0.0.1, playbook.yml --extra-vars \
"pulp_python_interpreter=$VIRTUAL_ENV/bin/python, pulp_install_dir=$VIRTUAL_ENV \
pulp_db_type=$DB"
"pulp_python_interpreter=$VIRTUAL_ENV/bin/python, pulp_install_dir=$VIRTUAL_ENV"
9 changes: 0 additions & 9 deletions .travis/mariadb.yml

This file was deleted.

5 changes: 1 addition & 4 deletions .travis/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@

---
- hosts: all
pre_tasks:
- name: Load DB variables
include_vars: '{{ pulp_db_type }}.yml'
vars:
pulp_default_admin_password: admin
pulp_source_dir: '{{ ansible_env.TRAVIS_BUILD_DIR | dirname }}/pulpcore/'
Expand All @@ -29,7 +26,7 @@
secret_key: 'secret'
databases:
default:
ENGINE: "{{ pulp_db_backend }}"
ENGINE: "django.db.backends.postgresql_psycopg2"
USER: 'travis'
PASSWORD: ''
environment:
Expand Down
2 changes: 1 addition & 1 deletion .travis/post_before_install.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cp .travis/ansible_playbook.yml ../ansible-pulp/playbook.yml
cp .travis/playbook.yml ../ansible-pulp/playbook.yml
9 changes: 0 additions & 9 deletions .travis/postgres.yml

This file was deleted.

2 changes: 2 additions & 0 deletions CHANGES/5580.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Depend on pulpcore, directly, instead of pulpcore-plugin.

41 changes: 21 additions & 20 deletions template_config.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@
# This config represents the latest values used when running the plugin-template. Any settings that
# were not present before running plugin-template have been added with their default values.

all: False
bootstrap: False
docs: False
additional_plugins: []
all: false
black: true
bootstrap: false
check_commit_message: true
coverage: false
deploy_client_to_pypi: true
deploy_client_to_rubygems: true
deploy_daily_client_to_pypi: true
deploy_daily_client_to_rubygems: true
deploy_to_pypi: true
docs: false
docs_test: true
plugin_app_label: ansible
plugin_camel: PulpAnsible
plugin_camel_short: Ansible
plugin_caps: PULP_ANSIBLE
plugin_caps_short: ANSIBLE
plugin_dash: pulp-ansible
plugin_dash_short: ansible
plugin_name: ansible
plugin_name: pulp_ansible
plugin_snake: pulp_ansible
plugin_snake_short: ansible
pydocstyle: true
pypi_username: pulp
test: False
black: True
check_commit_message: True
coverage: False
deploy_client_to_pypi: True
deploy_client_to_rubygems: True
deploy_daily_client_to_pypi: True
deploy_daily_client_to_rubygems: True
deploy_to_pypi: True
docs_test: True
pydocstyle: True
test_bindings: True
plugin_app_label: ansible
test: false
test_bindings: true
test_performance: false
travis_notifications:
irc:
channels:
- "chat.freenode.net#pulp-ansible"
on_success: change
- chat.freenode.net#pulp-ansible
on_failure: always

on_success: change

0 comments on commit fbccd05

Please sign in to comment.