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
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
3 changes: 2 additions & 1 deletion .ci/scripts/validate_commit_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from pathlib import Path


import os
from github import Github


Expand All @@ -22,7 +23,7 @@

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
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.6"

# dev_requirements contains tools needed for flake8, etc.
- name: Install requirements
Expand All @@ -34,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 @@ -63,7 +63,6 @@ jobs:
env:
- TEST: pulp
- TEST: docs
- TEST: s3

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

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

- name: Install httpie
run: |
Expand Down Expand Up @@ -116,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 @@ -128,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.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
34 changes: 30 additions & 4 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 All @@ -22,7 +22,6 @@ jobs:
env:
- TEST: pulp
- TEST: docs
- TEST: s3
- TEST: generate-bindings

steps:
Expand All @@ -34,7 +33,7 @@ jobs:

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

- name: Install httpie
run: |
Expand All @@ -49,6 +48,11 @@ jobs:
run: .github/workflows/scripts/before_install.sh
shell: bash

- uses: ruby/setup-ruby@v1
if: ${{ env.TEST == 'bindings' || env.TEST == 'generate-bindings' }}
with:
ruby-version: "2.6"

- name: Install
run: .github/workflows/scripts/install.sh
env:
Expand Down Expand Up @@ -97,6 +101,17 @@ jobs:
name: docs.tar
path: docs/docs.tar

- name: After failure
if: failure()
run: |
http --timeout 30 --check-status --pretty format --print hb http://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 @@ -113,7 +128,7 @@ jobs:

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

- uses: actions/setup-ruby@v1
with:
Expand Down Expand Up @@ -196,3 +211,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 http://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
Loading