diff --git a/.travis.yml b/.travis.yml index ae2e9c0ff..ed91af9c0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 @@ -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 diff --git a/.travis/ansible_playbook.yml b/.travis/ansible_playbook.yml deleted file mode 100644 index e560db0d1..000000000 --- a/.travis/ansible_playbook.yml +++ /dev/null @@ -1,34 +0,0 @@ ---- -- 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/' - pulp_plugin_source_dir: "{{ ansible_env.TRAVIS_BUILD_DIR | dirname }}/pulpcore-plugin" - pulp_install_plugins: - pulp-ansible: - app_label: "ansible" - source_dir: "$TRAVIS_BUILD_DIR" - ansible_python_interpreter: '/opt/pyenv/shims/python3' - pulp_user: 'travis' - pulp_group: 'travis' - developer_user: 'travis' - pulp_install_db: false - pulp_preq_packages: [] - pulp_settings: - secret_key: 'secret' - databases: - default: - ENGINE: "{{ pulp_db_backend }}" - USER: 'travis' - PASSWORD: '' - environment: - DJANGO_SETTINGS_MODULE: pulpcore.app.settings - roles: - - pulp-database - - pulp-workers - - pulp-resource-manager - - pulp-webserver - - pulp-content diff --git a/.travis/before_install.sh b/.travis/before_install.sh index e5040b5d1..1d06637ea 100755 --- a/.travis/before_install.sh +++ b/.travis/before_install.sh @@ -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 @@ -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 @@ -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 diff --git a/.travis/check_commit.sh b/.travis/check_commit.sh index 86e6407cf..cda7e60f2 100755 --- a/.travis/check_commit.sh +++ b/.travis/check_commit.sh @@ -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 @@ -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 diff --git a/.travis/install.sh b/.travis/install.sh index e1f6b1bd6..8c8142cb1 100755 --- a/.travis/install.sh +++ b/.travis/install.sh @@ -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" diff --git a/.travis/mariadb.yml b/.travis/mariadb.yml deleted file mode 100644 index b26bda83b..000000000 --- a/.travis/mariadb.yml +++ /dev/null @@ -1,9 +0,0 @@ -# WARNING: DO NOT EDIT! -# -# This file was generated by plugin_template, and is managed by bootstrap.py. Please use -# bootstrap.py to update this file. -# -# For more info visit https://github.com/pulp/plugin_template - ---- -pulp_db_backend: django.db.backends.mysql diff --git a/.travis/playbook.yml b/.travis/playbook.yml index 63bae7269..3fcdda822 100644 --- a/.travis/playbook.yml +++ b/.travis/playbook.yml @@ -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/' @@ -29,7 +26,7 @@ secret_key: 'secret' databases: default: - ENGINE: "{{ pulp_db_backend }}" + ENGINE: "django.db.backends.postgresql_psycopg2" USER: 'travis' PASSWORD: '' environment: diff --git a/.travis/post_before_install.sh b/.travis/post_before_install.sh index e6a2a3a7d..8b521768d 100755 --- a/.travis/post_before_install.sh +++ b/.travis/post_before_install.sh @@ -1 +1 @@ -cp .travis/ansible_playbook.yml ../ansible-pulp/playbook.yml +cp .travis/playbook.yml ../ansible-pulp/playbook.yml diff --git a/.travis/postgres.yml b/.travis/postgres.yml deleted file mode 100644 index 295bd570f..000000000 --- a/.travis/postgres.yml +++ /dev/null @@ -1,9 +0,0 @@ -# WARNING: DO NOT EDIT! -# -# This file was generated by plugin_template, and is managed by bootstrap.py. Please use -# bootstrap.py to update this file. -# -# For more info visit https://github.com/pulp/plugin_template - ---- -pulp_db_backend: django.db.backends.postgresql_psycopg2 diff --git a/CHANGES/5580.misc b/CHANGES/5580.misc new file mode 100644 index 000000000..c53f440cf --- /dev/null +++ b/CHANGES/5580.misc @@ -0,0 +1,2 @@ +Depend on pulpcore, directly, instead of pulpcore-plugin. + diff --git a/template_config.yml b/template_config.yml index ca1e9b82c..6413e6695 100644 --- a/template_config.yml +++ b/template_config.yml @@ -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