Skip to content

Commit

Permalink
Update plugin template
Browse files Browse the repository at this point in the history
This accommodates for a change in pulpcore that will effect the CI.

pulp/pulpcore#1102

[noissue]
  • Loading branch information
mdellweg committed Feb 18, 2021
1 parent b691659 commit 87327cd
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 15 deletions.
6 changes: 3 additions & 3 deletions .ci/ansible/Containerfile.j2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM {{ ci_base | default("pulp/pulp-ci:latest") }}
FROM {{ ci_base | default("pulp/pulp-ci-centos:latest") }}

# Add source directories to container
{% for item in plugins %}
Expand All @@ -10,7 +10,7 @@ ADD {{ item.source }} {{ item.source }}
# Install python packages
# Hacking botocore (https://github.com/boto/botocore/pull/1990)

RUN pip3 install --use-feature=2020-resolver \
RUN pip3 install \
{%- if s3_test | default(false) -%}
{{ " " }}django-storages[boto3] git+https://github.com/fabricio-aguiar/botocore.git@fix-100-continue
{%- endif -%}
Expand All @@ -23,7 +23,7 @@ RUN pip3 install --use-feature=2020-resolver \

RUN mkdir -p /etc/nginx/pulp/
{% for item in plugins %}
RUN ln /usr/local/lib/python3.7/site-packages/{{ item.name }}/app/webserver_snippets/nginx.conf /etc/nginx/pulp/{{ item.name }}.conf || true
RUN ln /usr/local/lib/python3.6/site-packages/{{ item.name }}/app/webserver_snippets/nginx.conf /etc/nginx/pulp/{{ item.name }}.conf || true
{% endfor %}

ENTRYPOINT ["/init"]
2 changes: 1 addition & 1 deletion .ci/ansible/smash-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@
}
],
"custom": {
"fixtures_origin": "http://pulp-fixtures/"
"fixtures_origin": "http://pulp-fixtures:8080/"
}
}
23 changes: 16 additions & 7 deletions .ci/ansible/start_container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,22 @@
command: "docker logs pulp"
failed_when: true

- name: "Check version of component being tested"
assert:
that:
- (result.json.versions | items2dict(key_name="component", value_name="version"))[component_name] | canonical_semver == (component_version | canonical_semver)
fail_msg: |
Component {{ component_name }} was expected to be installed in version {{ component_version }}.
Instead it is reported as version {{ (result.json.versions | items2dict(key_name="component", value_name="version"))[component_name] }}.
- block:
- name: "Check version of component being tested"
assert:
that:
- (result.json.versions | items2dict(key_name="component", value_name="version"))[component_name] | canonical_semver == (component_version | canonical_semver)
fail_msg: |
Component {{ component_name }} was expected to be installed in version {{ component_version }}.
Instead it is reported as version {{ (result.json.versions | items2dict(key_name="component", value_name="version"))[component_name] }}.
rescue:
- name: "Check version of component being tested (legacy)"
assert:
that:
- (result.json.versions | items2dict(key_name="component", value_name="version"))[legacy_component_name] | canonical_semver == (component_version | canonical_semver)
fail_msg: |
Component {{ legacy_component_name }} was expected to be installed in version {{ component_version }}.
Instead it is reported as version {{ (result.json.versions | items2dict(key_name="component", value_name="version"))[legacy_component_name] }}.
- name: "Set pulp password in .netrc"
copy:
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/scripts/before_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ else
fi
mkdir .ci/ansible/vars || true
echo "---" > .ci/ansible/vars/main.yaml
echo "component_name: pulp_deb" >> .ci/ansible/vars/main.yaml
echo "legacy_component_name: pulp_deb" >> .ci/ansible/vars/main.yaml
echo "component_name: deb" >> .ci/ansible/vars/main.yaml
echo "component_version: '${COMPONENT_VERSION}'" >> .ci/ansible/vars/main.yaml

export PRE_BEFORE_INSTALL=$PWD/.github/workflows/scripts/pre_before_install.sh
Expand All @@ -57,11 +58,13 @@ then
export PULPCORE_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\/pulp\/pulp-smash\/pull\/(\d+)' | awk -F'/' '{print $7}')
export PULP_OPENAPI_GENERATOR_PR_NUMBER=$(echo $COMMIT_MSG | grep -oP 'Required\ PR:\ https\:\/\/github\.com\/pulp\/pulp-openapi-generator\/pull\/(\d+)' | awk -F'/' '{print $7}')
export PULP_CLI_PR_NUMBER=$(echo $COMMIT_MSG | grep -oP 'Required\ PR:\ https\:\/\/github\.com\/pulp\/pulp-cli\/pull\/(\d+)' | awk -F'/' '{print $7}')
echo $COMMIT_MSG | sed -n -e 's/.*CI Base Image:\s*\([-_/[:alnum:]]*:[-_[:alnum:]]*\).*/ci_base: "\1"/p' >> .ci/ansible/vars/main.yaml
else
export PULPCORE_PR_NUMBER=
export PULP_SMASH_PR_NUMBER=
export PULP_OPENAPI_GENERATOR_PR_NUMBER=
export PULP_CLI_PR_NUMBER=
export CI_BASE_IMAGE=
fi

Expand All @@ -80,6 +83,8 @@ sed -i -e 's/localhost:24817/pulp/g' generate.sh
sed -i -e 's/:24817/pulp/g' generate.sh
cd ..



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

cd pulpcore
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ if [[ "$TEST" == "pulp" || "$TEST" == "performance" || "$TEST" == "s3" || "$TEST
sed -i -e '/^services:/a \
- name: pulp-fixtures\
image: docker.io/pulp/pulp-fixtures:latest\
env: {BASE_URL: "http://pulp-fixtures"}' vars/main.yaml
env: {BASE_URL: "http://pulp-fixtures:8080"}' vars/main.yaml
fi

if [ "$TEST" = "s3" ]; then
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/scripts/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ if [[ "$TEST" = "docs" || "$TEST" = "publish" ]]; then

echo "Validating OpenAPI schema..."
cat $PWD/.ci/scripts/schema.py | cmd_stdin_prefix bash -c "cat > /tmp/schema.py"
cmd_prefix bash -c "python /tmp/schema.py"
cmd_prefix bash -c "python3 /tmp/schema.py"
cmd_prefix bash -c "pulpcore-manager spectacular --file pulp_schema.yml --validate"

if [ -f $POST_DOCS_TEST ]; then
Expand Down Expand Up @@ -90,7 +90,7 @@ echo "Checking for uncommitted migrations..."
cmd_prefix bash -c "django-admin makemigrations --check --dry-run"

# Run unit tests.
cmd_prefix bash -c "PULP_DATABASES__default__USER=postgres django-admin test --noinput /usr/local/lib/python3.7/site-packages/pulp_deb/tests/unit/"
cmd_prefix bash -c "PULP_DATABASES__default__USER=postgres django-admin test --noinput /usr/local/lib/python3.6/site-packages/pulp_deb/tests/unit/"

# Run functional tests
export PYTHONPATH=$REPO_ROOT:$REPO_ROOT/../pulpcore${PYTHONPATH:+:${PYTHONPATH}}
Expand Down
1 change: 1 addition & 0 deletions template_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ pydocstyle: true
pypi_username: pulp
redmine_project: pulp_deb
test_bindings: false
test_cli: false
test_performance: false
test_released_plugin_with_next_pulpcore_release: true
test_s3: true
Expand Down

0 comments on commit 87327cd

Please sign in to comment.