Skip to content
Merged
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.6/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
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
69 changes: 69 additions & 0 deletions .ci/scripts/cherrypick.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#!/bin/bash

# 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

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]"
echo " ex: .ci/scripts/cherrypick.sh abcd1234 1234 4567"
echo ""
echo "Note: make sure you are on a fork of the release branch before running this script."
exit
fi

commit="$(git rev-parse $1)"
issue="$2"
backport="$3"
commit_message=$(git log --format=%B -n 1 $commit)

if ! echo $commit_message | tr '[:upper:]' '[:lower:]' | grep -q "\[noissue\]"
then
if ! echo $commit_message | tr '[:upper:]' '[:lower:]' | grep -q -E "(fixes|closes).*#$issue"
then
echo "Error: issue $issue not detected in commit message." && exit 1
fi
fi

if [ "$4" = "--continue" ]
then
echo "Continue after manually resolving conflicts..."
elif [ "$4" = "" ]
then
if ! git cherry-pick --no-commit "$commit"
then
echo "Please resolve and add merge conflicts and restart this command with appended '--continue'."
exit 1
fi
else
exit 1
fi

for file in $(find CHANGES -name "$issue.*")
do
newfile="${file/$issue/$backport}"
git mv "$file" "$newfile"
sed -i -e "\$a (backported from #$issue)" "$newfile"
git add "$newfile"
done

commit_message="$(printf "$commit_message" | sed -E 's/(fixes|closes)/backports/i')"
commit_message="$commit_message

fixes #$backport

(cherry picked from commit $commit)"
git commit -m "$commit_message"

printf "\nSuccessfully backported commit $1.\n"
30 changes: 0 additions & 30 deletions .ci/scripts/redmine.py

This file was deleted.

33 changes: 0 additions & 33 deletions .ci/scripts/update_redmine.sh

This file was deleted.

11 changes: 7 additions & 4 deletions .ci/scripts/validate_commit_message.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,24 @@
# For more info visit https://github.com/pulp/plugin_template

import re

import subprocess
import sys
from pathlib import Path


import os
from github import Github

KEYWORDS = ["fixes", "closes"]

NO_ISSUE = "[noissue]"
CHANGELOG_EXTS = [".feature", ".bugfix", ".doc", ".removal", ".misc", ".deprecation"]


KEYWORDS = ["fixes", "closes"]

sha = sys.argv[1]
message = subprocess.check_output(["git", "log", "--format=%B", "-n 1", sha]).decode("utf-8")

g = Github()
g = Github(os.environ.get("GITHUB_TOKEN"))
repo = g.get_repo("pulp/pulp_python")


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-97-g74b81ba-dirty
35 changes: 23 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,15 @@
#
# For more info visit https://github.com/pulp/plugin_template
---
name: Pulp CI
on:
pull_request:
branches:
- '*'
push:
branches:
- '*'

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



lint:
runs-on: ubuntu-latest


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

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

# dev_requirements contains tools needed for flake8, etc.
- name: Install requirements
Expand All @@ -37,6 +33,7 @@ jobs:
- name: Check commit message
if: github.event_name == 'pull_request'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_CONTEXT: ${{ github.event.pull_request.commits_url }}
run: sh .github/workflows/scripts/check_commit.sh

Expand Down Expand Up @@ -66,7 +63,6 @@ jobs:
env:
- TEST: pulp
- TEST: docs
- TEST: s3

steps:
- uses: actions/checkout@v2
Expand All @@ -77,7 +73,7 @@ jobs:

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

- name: Install httpie
run: |
Expand All @@ -99,6 +95,13 @@ jobs:
ANSIBLE_FORCE_COLOR: '1'
shell: bash

- name: Install Python client
run: .github/workflows/scripts/install_python_client.sh

- name: Install Ruby client
if: ${{ env.TEST == 'bindings' }}
run: .github/workflows/scripts/install_ruby_client.sh

- name: Before Script
run: |
.github/workflows/scripts/before_script.sh
Expand All @@ -112,6 +115,11 @@ 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()
Expand All @@ -124,3 +132,6 @@ jobs:
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.6"

- 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
Loading