Skip to content

Commit 4a00953

Browse files
authored
Merge pull request #421 from gerrod3/3.4.1_backports
3.4.1 backports
2 parents 2373267 + 1db8bb6 commit 4a00953

32 files changed

+419
-66
lines changed

.ci/ansible/Containerfile.j2

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM {{ ci_base | default("pulp/pulp-ci-centos:latest") }}
1+
FROM {{ ci_base | default("pulp/pulp-ci-centos:" + pulp_container_tag) }}
22

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

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

2930
ENTRYPOINT ["/init"]

.ci/ansible/settings.py.j2

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
CONTENT_ORIGIN = "http://pulp:80"
2-
ANSIBLE_API_HOSTNAME = "http://pulp:80"
3-
ANSIBLE_CONTENT_HOSTNAME = "http://pulp:80/pulp/content"
1+
CONTENT_ORIGIN = "{{ pulp_scheme }}://pulp:{{ 443 if pulp_scheme == 'https' else 80 }}"
2+
ANSIBLE_API_HOSTNAME = "{{ pulp_scheme }}://pulp:{{ 443 if pulp_scheme == 'https' else 80 }}"
3+
ANSIBLE_CONTENT_HOSTNAME = "{{ pulp_scheme }}://pulp:{{ 443 if pulp_scheme == 'https' else 80 }}/pulp/content"
44
PRIVATE_KEY_PATH = "/etc/pulp/certs/token_private_key.pem"
55
PUBLIC_KEY_PATH = "/etc/pulp/certs/token_public_key.pem"
6-
TOKEN_SERVER = "http://pulp:80/token/"
6+
TOKEN_SERVER = "{{ pulp_scheme }}://pulp:{{ 443 if pulp_scheme == 'https' else 80 }}/token/"
77
TOKEN_SIGNATURE_ALGORITHM = "ES256"
88

99
{% if pulp_settings %}

.ci/ansible/start_container.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@
7171
- name: "Wait for Pulp"
7272
uri:
7373
url: "http://pulp/pulp/api/v3/status/"
74-
follow_redirects: none
74+
follow_redirects: all
75+
validate_certs: no
7576
register: result
7677
until: result.status == 200
7778
retries: 12

.ci/scripts/cherrypick.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99

1010
set -e
1111

12+
if [ ! -d CHANGES ]; then
13+
echo "Error: no CHANGES directory detected. This script must be run from the project root."
14+
exit 1
15+
fi
16+
1217
if [ $# -lt 3 ]
1318
then
1419
echo "Usage: .ci/scripts/cherrypick.sh [commit-hash] [original-issue-id] [backport-issue-id]"

.ci/scripts/validate_commit_message.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from pathlib import Path
1212

1313

14+
import os
1415
from github import Github
1516

1617

@@ -22,7 +23,7 @@
2223

2324
sha = sys.argv[1]
2425
message = subprocess.check_output(["git", "log", "--format=%B", "-n 1", sha]).decode("utf-8")
25-
g = Github()
26+
g = Github(os.environ.get("GITHUB_TOKEN"))
2627
repo = g.get_repo("pulp/pulp_python")
2728

2829

.github/template_gitref

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2021.04.08-97-g74b81ba

.github/workflows/ci.yml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,15 @@
55
#
66
# For more info visit https://github.com/pulp/plugin_template
77
---
8-
name: Pulp CI
9-
on:
10-
pull_request:
11-
branches:
12-
- '*'
13-
8+
name: Python CI
9+
on: {pull_request: {branches: ['*']}}
1410
jobs:
1511

12+
13+
1614
lint:
1715
runs-on: ubuntu-latest
16+
1817

1918
steps:
2019
- uses: actions/checkout@v2
@@ -25,7 +24,7 @@ jobs:
2524

2625
- uses: actions/setup-python@v2
2726
with:
28-
python-version: "3.7"
27+
python-version: "3.6"
2928

3029
# dev_requirements contains tools needed for flake8, etc.
3130
- name: Install requirements
@@ -34,6 +33,7 @@ jobs:
3433
- name: Check commit message
3534
if: github.event_name == 'pull_request'
3635
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3737
GITHUB_CONTEXT: ${{ github.event.pull_request.commits_url }}
3838
run: sh .github/workflows/scripts/check_commit.sh
3939

@@ -63,7 +63,6 @@ jobs:
6363
env:
6464
- TEST: pulp
6565
- TEST: docs
66-
- TEST: s3
6766

6867
steps:
6968
- uses: actions/checkout@v2
@@ -74,7 +73,7 @@ jobs:
7473

7574
- uses: actions/setup-python@v2
7675
with:
77-
python-version: "3.7"
76+
python-version: "3.6"
7877

7978
- name: Install httpie
8079
run: |
@@ -116,6 +115,11 @@ jobs:
116115
- name: Script
117116
run: .github/workflows/scripts/script.sh
118117
shell: bash
118+
# env vars useful for post_script.sh when present
119+
env:
120+
GITHUB_PULL_REQUEST: ${{ github.event.number }}
121+
GITHUB_BRANCH: ${{ github.head_ref }}
122+
GITHUB_REPO_SLUG: ${{ github.repository }}
119123

120124
- name: After failure
121125
if: failure()
@@ -128,3 +132,6 @@ jobs:
128132
docker exec pulp ls -latr /etc/yum.repos.d/ || true
129133
docker exec pulp cat /etc/yum.repos.d/* || true
130134
docker exec pulp pip3 list
135+
136+
137+
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# WARNING: DO NOT EDIT!
2+
#
3+
# This file was generated by plugin_template, and is managed by it. Please use
4+
# './plugin-template --github pulp_python' to update this file.
5+
#
6+
# For more info visit https://github.com/pulp/plugin_template
7+
---
8+
name: Create New Release Branch
9+
on:
10+
workflow_dispatch:
11+
inputs:
12+
name:
13+
description: "Branch name (e.g. 3.14)"
14+
required: true
15+
16+
env:
17+
RELEASE_WORKFLOW: true
18+
19+
jobs:
20+
create-branch:
21+
runs-on: ubuntu-latest
22+
23+
strategy:
24+
fail-fast: false
25+
26+
steps:
27+
- uses: actions/checkout@v2
28+
with:
29+
# by default, it uses a depth of 1
30+
# this fetches all history so that we can read each commit
31+
fetch-depth: 0
32+
33+
- uses: actions/setup-python@v2
34+
with:
35+
python-version: "3.8"
36+
37+
- name: Install python dependencies
38+
run: |
39+
echo ::group::PYDEPS
40+
pip install bump2version
41+
echo ::endgroup::
42+
43+
- name: Setting secrets
44+
run: python3 .github/workflows/scripts/secrets.py "$SECRETS_CONTEXT"
45+
env:
46+
SECRETS_CONTEXT: ${{ toJson(secrets) }}
47+
48+
- name: Verify that branch name matches current version string on master branch
49+
run: |
50+
X_Y_VERSION=$(grep version setup.py | sed -rn 's/version="(.*)\.0\.dev",/\1/p' | awk '{$1=$1};1')
51+
if [[ "$X_Y_VERSION" != "${{ github.event.inputs.name }}" ]]
52+
then
53+
echo "Branch name doesn't match the current version string $X_Y_VERSION."
54+
exit 1
55+
fi
56+
57+
- name: Create ${{ github.event.inputs.name }} release branch
58+
run: |
59+
git checkout -b ${{ github.event.inputs.name }}
60+
git push origin ${{ github.event.inputs.name }}
61+
62+
- name: Bump version on master branch
63+
run: |
64+
git checkout master
65+
bump2version --no-commit minor
66+
67+
- name: Make a PR with version bump
68+
uses: peter-evans/create-pull-request@v3
69+
with:
70+
committer: pulpbot <pulp-infra@redhat.com>
71+
author: pulpbot <pulp-infra@redhat.com>
72+
branch: minor-version-bump
73+
base: master
74+
title: Bump minor version
75+
body: '[noissue]'
76+
commit-message: |
77+
Bump minor version
78+
[noissue]
79+
delete-branch: true

.github/workflows/nightly.yml

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#
66
# For more info visit https://github.com/pulp/plugin_template
77
---
8-
name: Pulp Nightly CI/CD
8+
name: Python Nightly CI/CD
99
on:
1010
schedule:
1111
# * is a special character in YAML so you have to quote this string
@@ -22,7 +22,6 @@ jobs:
2222
env:
2323
- TEST: pulp
2424
- TEST: docs
25-
- TEST: s3
2625
- TEST: generate-bindings
2726

2827
steps:
@@ -34,7 +33,7 @@ jobs:
3433

3534
- uses: actions/setup-python@v2
3635
with:
37-
python-version: "3.7"
36+
python-version: "3.6"
3837

3938
- name: Install httpie
4039
run: |
@@ -49,6 +48,11 @@ jobs:
4948
run: .github/workflows/scripts/before_install.sh
5049
shell: bash
5150

51+
- uses: ruby/setup-ruby@v1
52+
if: ${{ env.TEST == 'bindings' || env.TEST == 'generate-bindings' }}
53+
with:
54+
ruby-version: "2.6"
55+
5256
- name: Install
5357
run: .github/workflows/scripts/install.sh
5458
env:
@@ -97,6 +101,17 @@ jobs:
97101
name: docs.tar
98102
path: docs/docs.tar
99103

104+
- name: After failure
105+
if: failure()
106+
run: |
107+
http --timeout 30 --check-status --pretty format --print hb http://pulp/pulp/api/v3/status/ || true
108+
docker images || true
109+
docker ps -a || true
110+
docker logs pulp || true
111+
docker exec pulp ls -latr /etc/yum.repos.d/ || true
112+
docker exec pulp cat /etc/yum.repos.d/* || true
113+
docker exec pulp pip3 list
114+
100115
publish:
101116
runs-on: ubuntu-latest
102117
needs: test
@@ -113,7 +128,7 @@ jobs:
113128

114129
- uses: actions/setup-python@v2
115130
with:
116-
python-version: "3.7"
131+
python-version: "3.6"
117132

118133
- uses: actions/setup-ruby@v1
119134
with:
@@ -196,3 +211,14 @@ jobs:
196211
tar -xvf docs.tar -C ./docs
197212
.github/workflows/scripts/publish_docs.sh nightly ${GITHUB_REF##*/}
198213
214+
215+
- name: After failure
216+
if: failure()
217+
run: |
218+
http --timeout 30 --check-status --pretty format --print hb http://pulp/pulp/api/v3/status/ || true
219+
docker images || true
220+
docker ps -a || true
221+
docker logs pulp || true
222+
docker exec pulp ls -latr /etc/yum.repos.d/ || true
223+
docker exec pulp cat /etc/yum.repos.d/* || true
224+
docker exec pulp pip3 list

0 commit comments

Comments
 (0)