Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 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-centos:latest") }}
FROM {{ ci_base | default("pulp/pulp-ci-centos:" + pulp_container_tag) }}

# Add source directories to container
{% for item in plugins %}
Expand All @@ -23,7 +23,8 @@ RUN pip3 install \

RUN mkdir -p /etc/nginx/pulp/
{% for item in plugins %}
RUN ln /usr/local/lib/python3.8/site-packages/{{ item.name }}/app/webserver_snippets/nginx.conf /etc/nginx/pulp/{{ item.name }}.conf || true
RUN export plugin_path="$(pip3 show {{ item.name }} | sed -n -e 's/Location: //p')/{{ item.name }}" && \
ln $plugin_path/app/webserver_snippets/nginx.conf /etc/nginx/pulp/{{ item.name }}.conf || true
{% endfor %}

ENTRYPOINT ["/init"]
8 changes: 4 additions & 4 deletions .ci/ansible/settings.py.j2
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
CONTENT_ORIGIN = "http://pulp:80"
ANSIBLE_API_HOSTNAME = "http://pulp:80"
ANSIBLE_CONTENT_HOSTNAME = "http://pulp:80/pulp/content"
CONTENT_ORIGIN = "{{ pulp_scheme }}://pulp:{{ 443 if pulp_scheme == 'https' else 80 }}"
ANSIBLE_API_HOSTNAME = "{{ pulp_scheme }}://pulp:{{ 443 if pulp_scheme == 'https' else 80 }}"
ANSIBLE_CONTENT_HOSTNAME = "{{ pulp_scheme }}://pulp:{{ 443 if pulp_scheme == 'https' else 80 }}/pulp/content"
PRIVATE_KEY_PATH = "/etc/pulp/certs/token_private_key.pem"
PUBLIC_KEY_PATH = "/etc/pulp/certs/token_public_key.pem"
TOKEN_SERVER = "http://pulp:80/token/"
TOKEN_SERVER = "{{ pulp_scheme }}://pulp:{{ 443 if pulp_scheme == 'https' else 80 }}/token/"
TOKEN_SIGNATURE_ALGORITHM = "ES256"

{% if pulp_settings %}
Expand Down
8 changes: 4 additions & 4 deletions .ci/ansible/smash-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
"hostname": "pulp",
"roles": {
"api": {
"port": 80,
"scheme": "http",
"port": 443,
"scheme": "https",
"service": "nginx"
},
"content": {
"port": 80,
"scheme": "http",
"port": 443,
"scheme": "https",
"service": "pulp_content_app"
},
"pulp resource manager": {},
Expand Down
3 changes: 2 additions & 1 deletion .ci/ansible/start_container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@
- name: "Wait for Pulp"
uri:
url: "http://pulp/pulp/api/v3/status/"
follow_redirects: none
follow_redirects: all
validate_certs: no
register: result
until: result.status == 200
retries: 12
Expand Down
5 changes: 5 additions & 0 deletions .ci/scripts/cherrypick.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@

set -e

if [ ! -d CHANGES ]; then
echo "Error: no CHANGES directory detected. This script must be run from the project root."
exit 1
fi

if [ $# -lt 3 ]
then
echo "Usage: .ci/scripts/cherrypick.sh [commit-hash] [original-issue-id] [backport-issue-id]"
Expand Down
1 change: 1 addition & 0 deletions .github/template_gitref
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2021.04.08-95-gbf7866c
25 changes: 16 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@
#
# For more info visit https://github.com/pulp/plugin_template
---
name: Pulp CI
on:
pull_request:
branches:
- '*'

name: Python CI
on: {pull_request: {branches: ['*']}}
jobs:



lint:
runs-on: ubuntu-latest


steps:
- uses: actions/checkout@v2
Expand All @@ -25,7 +24,7 @@ jobs:

- uses: actions/setup-python@v2
with:
python-version: "3.7"
python-version: "3.8"

# dev_requirements contains tools needed for flake8, etc.
- name: Install requirements
Expand Down Expand Up @@ -74,7 +73,7 @@ jobs:

- uses: actions/setup-python@v2
with:
python-version: "3.7"
python-version: "3.8"

- name: Install httpie
run: |
Expand Down Expand Up @@ -116,15 +115,23 @@ jobs:
- name: Script
run: .github/workflows/scripts/script.sh
shell: bash
# env vars useful for post_script.sh when present
env:
GITHUB_PULL_REQUEST: ${{ github.event.number }}
GITHUB_BRANCH: ${{ github.head_ref }}
GITHUB_REPO_SLUG: ${{ github.repository }}

- name: After failure
if: failure()
run: |
echo "Need to debug? Please check: https://github.com/marketplace/actions/debugging-with-tmate"
http --timeout 30 --check-status --pretty format --print hb http://pulp/pulp/api/v3/status/ || true
http --timeout 30 --check-status --pretty format --print hb https://pulp/pulp/api/v3/status/ || true
docker images || true
docker ps -a || true
docker logs pulp || true
docker exec pulp ls -latr /etc/yum.repos.d/ || true
docker exec pulp cat /etc/yum.repos.d/* || true
docker exec pulp pip3 list



79 changes: 79 additions & 0 deletions .github/workflows/create-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# WARNING: DO NOT EDIT!
#
# This file was generated by plugin_template, and is managed by it. Please use
# './plugin-template --github pulp_python' to update this file.
#
# For more info visit https://github.com/pulp/plugin_template
---
name: Create New Release Branch
on:
workflow_dispatch:
inputs:
name:
description: "Branch name (e.g. 3.14)"
required: true

env:
RELEASE_WORKFLOW: true

jobs:
create-branch:
runs-on: ubuntu-latest

strategy:
fail-fast: false

steps:
- uses: actions/checkout@v2
with:
# by default, it uses a depth of 1
# this fetches all history so that we can read each commit
fetch-depth: 0

- uses: actions/setup-python@v2
with:
python-version: "3.8"

- name: Install python dependencies
run: |
echo ::group::PYDEPS
pip install bump2version
echo ::endgroup::

- name: Setting secrets
run: python3 .github/workflows/scripts/secrets.py "$SECRETS_CONTEXT"
env:
SECRETS_CONTEXT: ${{ toJson(secrets) }}

- name: Verify that branch name matches current version string on master branch
run: |
X_Y_VERSION=$(grep version setup.py | sed -rn 's/version="(.*)\.0\.dev",/\1/p' | awk '{$1=$1};1')
if [[ "$X_Y_VERSION" != "${{ github.event.inputs.name }}" ]]
then
echo "Branch name doesn't match the current version string $X_Y_VERSION."
exit 1
fi

- name: Create ${{ github.event.inputs.name }} release branch
run: |
git checkout -b ${{ github.event.inputs.name }}
git push origin ${{ github.event.inputs.name }}

- name: Bump version on master branch
run: |
git checkout master
bump2version --no-commit minor

- name: Make a PR with version bump
uses: peter-evans/create-pull-request@v3
with:
committer: pulpbot <pulp-infra@redhat.com>
author: pulpbot <pulp-infra@redhat.com>
branch: minor-version-bump
base: master
title: Bump minor version
body: '[noissue]'
commit-message: |
Bump minor version
[noissue]
delete-branch: true
28 changes: 25 additions & 3 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
# For more info visit https://github.com/pulp/plugin_template
---
name: Pulp Nightly CI/CD
name: Python Nightly CI/CD
on:
schedule:
# * is a special character in YAML so you have to quote this string
Expand Down Expand Up @@ -34,7 +34,7 @@ jobs:

- uses: actions/setup-python@v2
with:
python-version: "3.7"
python-version: "3.8"

- name: Install httpie
run: |
Expand Down Expand Up @@ -102,6 +102,17 @@ jobs:
name: docs.tar
path: docs/docs.tar

- name: After failure
if: failure()
run: |
http --timeout 30 --check-status --pretty format --print hb https://pulp/pulp/api/v3/status/ || true
docker images || true
docker ps -a || true
docker logs pulp || true
docker exec pulp ls -latr /etc/yum.repos.d/ || true
docker exec pulp cat /etc/yum.repos.d/* || true
docker exec pulp pip3 list

publish:
runs-on: ubuntu-latest
needs: test
Expand All @@ -118,7 +129,7 @@ jobs:

- uses: actions/setup-python@v2
with:
python-version: "3.7"
python-version: "3.8"

- uses: actions/setup-ruby@v1
with:
Expand Down Expand Up @@ -201,3 +212,14 @@ jobs:
tar -xvf docs.tar -C ./docs
.github/workflows/scripts/publish_docs.sh nightly ${GITHUB_REF##*/}


- name: After failure
if: failure()
run: |
http --timeout 30 --check-status --pretty format --print hb https://pulp/pulp/api/v3/status/ || true
docker images || true
docker ps -a || true
docker logs pulp || true
docker exec pulp ls -latr /etc/yum.repos.d/ || true
docker exec pulp cat /etc/yum.repos.d/* || true
docker exec pulp pip3 list
53 changes: 48 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ on:
release:
description: "Release tag (e.g. 3.2.1)"
required: true
before_script:
description: |
Bash code to run before script.sh is executed. This should only be used when re-running
a workflow to correct some aspect of the docs. e.g.: git checkout origin/3.14 CHANGES.rst
required: false

env:
RELEASE_WORKFLOW: true
Expand All @@ -32,12 +37,12 @@ jobs:

- uses: actions/setup-python@v2
with:
python-version: "3.7"
python-version: "3.8"

- name: Install python dependencies
run: |
echo ::group::PYDEPS
pip install bandersnatch bump2version gitpython python-redmine towncrier wheel
pip install bandersnatch bump2version gitpython python-redmine towncrier==19.9.0 wheel
echo ::endgroup::

- name: Configure Git with pulpbot name and email
Expand Down Expand Up @@ -82,7 +87,7 @@ jobs:

- uses: actions/setup-python@v2
with:
python-version: "3.7"
python-version: "3.8"
- uses: actions/setup-ruby@v1
with:
ruby-version: "2.6"
Expand Down Expand Up @@ -139,6 +144,10 @@ jobs:
if: ${{ env.TEST == 'bindings' || env.TEST == 'generate-bindings' }}
run: .github/workflows/scripts/install_ruby_client.sh

- name: Additional before_script
run: ${{ github.event.inputs.before_script }}
shell: bash

- name: Script
if: ${{ env.TEST != 'generate-bindings' }}
run: .github/workflows/scripts/script.sh
Expand Down Expand Up @@ -168,7 +177,7 @@ jobs:
- name: After failure
if: failure()
run: |
http --timeout 30 --check-status --pretty format --print hb http://pulp/pulp/api/v3/status/ || true
http --timeout 30 --check-status --pretty format --print hb https://pulp/pulp/api/v3/status/ || true
docker images || true
docker ps -a || true
docker logs pulp || true
Expand All @@ -192,12 +201,17 @@ jobs:

- uses: actions/setup-python@v2
with:
python-version: "3.7"
python-version: "3.8"

- uses: actions/setup-ruby@v1
with:
ruby-version: "2.6"

- name: Configure Git with pulpbot name and email
run: |
git config --global user.name 'pulpbot'
git config --global user.email 'pulp-infra@redhat.com'

- name: Untar repository
run: |
shopt -s dotglob
Expand All @@ -217,6 +231,12 @@ jobs:
env:
SECRETS_CONTEXT: ${{ toJson(secrets) }}

- name: Install python dependencies
run: |
echo ::group::PYDEPS
pip install gitpython python-redmine
echo ::endgroup::

- name: Push branch and tag to GitHub
run: bash .github/workflows/scripts/push_branch_and_tag_to_github.sh ${{ github.event.inputs.release }}
- name: Download built docs
Expand Down Expand Up @@ -251,5 +271,28 @@ jobs:
- name: Publish client to rubygems
run: bash .github/workflows/scripts/publish_client_gem.sh



- name: Create release on GitHub
run: bash .github/workflows/scripts/create_release_from_tag.sh ${{ github.event.inputs.release }}

- name: Cleanup repository before making changelog PR
run: rm -rf .lock generation pulp_python_client* *-client.tar pulp_python.tar todo web docs.tar

- name: Stage changelog for master branch
run: python .github/workflows/scripts/stage-changelog-for-master.py ${{ github.event.inputs.release }}

- name: Create Pull Request for Changelog
uses: peter-evans/create-pull-request@v3
with:
committer: pulpbot <pulp-infra@redhat.com>
author: pulpbot <pulp-infra@redhat.com>
branch: changelog/${{ github.event.inputs.release }}
base: master
title: 'Building changelog for ${{ github.event.inputs.release }}'
body: '[noissue]'
commit-message: |
Building changelog for ${{ github.event.inputs.release }}

[noissue]
delete-branch: true
Loading