Skip to content

Commit be51e47

Browse files
authored
Merge pull request #602 from pulp/create-pull-request/main/patch
Update CI files from main branch
2 parents a22d9bb + f04319c commit be51e47

File tree

7 files changed

+35
-55
lines changed

7 files changed

+35
-55
lines changed

.github/template_gitref

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2021.08.26-198-g8f49b35
1+
2021.08.26-202-g6f2c165

.github/workflows/scripts/before_install.sh

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,8 @@ fi
3030
COMMIT_MSG=$(git log --format=%B --no-merges -1)
3131
export COMMIT_MSG
3232

33-
if [[ "$TEST" == "plugin-from-pypi" ]]; then
34-
COMPONENT_VERSION=$(http https://pypi.org/pypi/pulp-python/json | jq -r '.info.version')
35-
else
36-
COMPONENT_VERSION=$(sed -ne "s/\s*version.*=.*['\"]\(.*\)['\"][\s,]*/\1/p" setup.py)
37-
fi
33+
COMPONENT_VERSION=$(sed -ne "s/\s*version.*=.*['\"]\(.*\)['\"][\s,]*/\1/p" setup.py)
34+
3835
mkdir .ci/ansible/vars || true
3936
echo "---" > .ci/ansible/vars/main.yaml
4037
echo "legacy_component_name: pulp_python" >> .ci/ansible/vars/main.yaml
@@ -63,22 +60,10 @@ cd ..
6360

6461
git clone --depth=1 https://github.com/pulp/pulp-openapi-generator.git
6562

63+
pip install pulp-cli
6664

67-
if [ -f ../clitest_requirement.txt ]
68-
then
69-
pip install -r clitest_requirements.txt
70-
else
71-
pip install pulp-cli
72-
fi
73-
PULP_CLI_VERSION="$(python -c "from pulpcore.cli.common import __version__; print(__version__)")"
74-
git clone https://github.com/pulp/pulp-cli.git
75-
cd pulp-cli
76-
git checkout "$PULP_CLI_VERSION"
77-
78-
pulp config create --base-url https://pulp --location tests/cli.toml
79-
mkdir ~/.config/pulp
80-
cp tests/cli.toml ~/.config/pulp/cli.toml
81-
cd ..
65+
PULP_CLI_VERSION="$(pip freeze | sed -n -e 's/pulp-cli==//p')"
66+
git clone --depth 1 --branch "$PULP_CLI_VERSION" https://github.com/pulp/pulp-cli.git
8267

8368

8469
# Intall requirements for ansible playbooks

.github/workflows/scripts/before_script.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ tail -v -n +1 .ci/ansible/Containerfile
3636
cmd_prefix bash -c "echo '%wheel ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/nopasswd"
3737
cmd_prefix bash -c "usermod -a -G wheel pulp"
3838

39-
SCENARIOS=("pulp" "performance" "azure" "gcp" "s3" "stream" "plugin-from-pypi" "generate-bindings" "lowerbounds")
39+
SCENARIOS=("pulp" "performance" "azure" "gcp" "s3" "stream" "generate-bindings" "lowerbounds")
4040
if [[ " ${SCENARIOS[*]} " =~ " ${TEST} " ]]; then
4141
# Many functional tests require these
4242
cmd_prefix dnf install -yq lsof which
@@ -50,3 +50,7 @@ fi
5050
if [[ -f $POST_BEFORE_SCRIPT ]]; then
5151
source $POST_BEFORE_SCRIPT
5252
fi
53+
54+
# Lots of plugins try to use this path, and throw warnings if they cannot access it.
55+
cmd_prefix mkdir /.pytest_cache
56+
cmd_prefix chown pulp:pulp /.pytest_cache

.github/workflows/scripts/install.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ fi
2727

2828
cd .ci/ansible/
2929

30-
if [[ "$TEST" == "plugin-from-pypi" ]]; then
31-
PLUGIN_NAME=pulp_python
32-
elif [[ "${RELEASE_WORKFLOW:-false}" == "true" ]]; then
30+
if [[ "${RELEASE_WORKFLOW:-false}" == "true" ]]; then
3331
PLUGIN_NAME=./pulp_python/dist/pulp_python-$PLUGIN_VERSION-py3-none-any.whl
3432
else
3533
PLUGIN_NAME=./pulp_python
@@ -111,17 +109,20 @@ if [ "${PULP_API_ROOT:-}" ]; then
111109
sed -i -e '$a api_root: "'"$PULP_API_ROOT"'"' vars/main.yaml
112110
fi
113111

112+
pulp config create --base-url https://pulp --api-root "$PULP_API_ROOT"
113+
cp ~/.config/pulp/cli.toml "${REPO_ROOT}/../pulp-cli/tests/cli.toml"
114+
114115
ansible-playbook build_container.yaml
115116
ansible-playbook start_container.yaml
116117

117118
# .config needs to be accessible by the pulp user in the container, but some
118119
# files will likely be modified on the host by post/pre scripts.
119120
chmod 777 ~/.config/pulp_smash/
120121
chmod 666 ~/.config/pulp_smash/settings.json
121-
sudo chown -R 700:700 ~runner/.config
122122
# Plugins often write to ~/.config/pulp/cli.toml from the host
123-
sudo chmod 777 ~runner/.config/pulp
124-
sudo chmod 666 ~runner/.config/pulp/cli.toml
123+
chmod 777 ~/.config/pulp
124+
chmod 666 ~/.config/pulp/cli.toml
125+
sudo chown -R 700:700 ~/.config
125126
echo ::group::SSL
126127
# Copy pulp CA
127128
sudo docker cp pulp:/etc/pulp/certs/pulp_webserver.crt /usr/local/share/ca-certificates/pulp_webserver.crt

.github/workflows/scripts/publish_docs.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ touch ~/.ssh/pulp-infra
1717
chmod 600 ~/.ssh/pulp-infra
1818
echo "$PULP_DOCS_KEY" > ~/.ssh/pulp-infra
1919

20-
echo "docs.pulpproject.org,8.43.85.236 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGXG+8vjSQvnAkq33i0XWgpSrbco3rRqNZr0SfVeiqFI7RN/VznwXMioDDhc+hQtgVhd6TYBOrV07IMcKj+FAzg=" >> /home/runner/.ssh/known_hosts
21-
chmod 644 /home/runner/.ssh/known_hosts
20+
echo "docs.pulpproject.org,8.43.85.236 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGXG+8vjSQvnAkq33i0XWgpSrbco3rRqNZr0SfVeiqFI7RN/VznwXMioDDhc+hQtgVhd6TYBOrV07IMcKj+FAzg=" >> ~/.ssh/known_hosts
21+
chmod 644 ~/.ssh/known_hosts
2222

2323
pip3 install packaging
2424

.github/workflows/scripts/script.sh

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
#
99
# For more info visit https://github.com/pulp/plugin_template
1010

11+
set -mveuo pipefail
12+
1113
# make sure this script runs at the repo root
1214
cd "$(dirname "$(realpath -e "$0")")"/../../..
1315
REPO_ROOT="$PWD"
1416

15-
set -mveuo pipefail
16-
1717
source .github/workflows/scripts/utils.sh
1818

1919
export POST_SCRIPT=$PWD/.github/workflows/scripts/post_script.sh
@@ -44,10 +44,10 @@ if [[ "$TEST" = "docs" ]]; then
4444
exit
4545
fi
4646

47+
REPORTED_STATUS="$(pulp status)"
48+
4749
if [[ "${RELEASE_WORKFLOW:-false}" == "true" ]]; then
48-
STATUS_ENDPOINT="${PULP_URL}${PULP_API_ROOT}api/v3/status/"
49-
echo $STATUS_ENDPOINT
50-
REPORTED_VERSION=$(http $STATUS_ENDPOINT | jq --arg plugin python --arg legacy_plugin pulp_python -r '.versions[] | select(.component == $plugin or .component == $legacy_plugin) | .version')
50+
REPORTED_VERSION="$(echo $REPORTED_STATUS | jq --arg plugin python --arg legacy_plugin pulp_python -r '.versions[] | select(.component == $plugin or .component == $legacy_plugin) | .version')"
5151
response=$(curl --write-out %{http_code} --silent --output /dev/null https://pypi.org/project/pulp-python/$REPORTED_VERSION/)
5252
if [ "$response" == "200" ];
5353
then
@@ -56,11 +56,6 @@ if [[ "${RELEASE_WORKFLOW:-false}" == "true" ]]; then
5656
fi
5757
fi
5858

59-
if [[ "$TEST" == "plugin-from-pypi" ]]; then
60-
COMPONENT_VERSION=$(http https://pypi.org/pypi/pulp-python/json | jq -r '.info.version')
61-
git checkout ${COMPONENT_VERSION} -- pulp_python/tests/
62-
fi
63-
6459
echo "machine pulp
6560
login admin
6661
password password
@@ -69,12 +64,13 @@ password password
6964
cmd_user_stdin_prefix bash -c "chmod 600 ~pulp/.netrc"
7065

7166
cd ../pulp-openapi-generator
72-
./generate.sh pulp_python python
73-
cmd_prefix pip3 install /root/pulp-openapi-generator/pulp_python-client
74-
sudo rm -rf ./pulp_python-client
75-
./generate.sh pulpcore python
76-
cmd_prefix pip3 install /root/pulp-openapi-generator/pulpcore-client
77-
sudo rm -rf ./pulpcore-client
67+
for item in $(echo "$REPORTED_STATUS" | jq -r '.versions[].package|sub("-"; "_")')
68+
do
69+
./generate.sh "${item}" python
70+
cmd_prefix pip3 install "/root/pulp-openapi-generator/${item}-client"
71+
sudo rm -rf "./${item}-client"
72+
done
73+
7874
cd $REPO_ROOT
7975

8076
cat unittest_requirements.txt | cmd_stdin_prefix bash -c "cat > /tmp/unittest_requirements.txt"

template_config.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
# This config represents the latest values used when running the plugin-template. Any settings that
22
# were not present before running plugin-template have been added with their default values.
33

4-
# generated with [email protected]198-g8f49b35
4+
# generated with [email protected]202-g6f2c165
55

66
additional_repos: []
7-
aiohttp_fixtures_origin: 172.18.0.1
87
api_root: /pulp/
98
black: false
109
check_commit_message: true
1110
check_gettext: true
1211
check_manifest: true
13-
check_openapi_schema: true
1412
check_stray_pulpcore_imports: true
1513
ci_env: {}
1614
ci_trigger: '{pull_request: {branches: [''*'']}}'
1715
ci_update_branches: []
16+
cli_package: pulp-cli
17+
cli_repo: https://github.com/pulp/pulp-cli.git
1818
core_import_allowed: []
19-
coverage: false
2019
deploy_client_to_pypi: true
2120
deploy_client_to_rubygems: true
2221
deploy_to_pypi: true
@@ -52,9 +51,6 @@ pulp_settings_azure: null
5251
pulp_settings_gcp: null
5352
pulp_settings_s3: null
5453
pulp_settings_stream: null
55-
pulpcore_branch: main
56-
pulpcore_pip_version_specifier: null
57-
pulpcore_revision: null
5854
pulpprojectdotorg_key_id: null
5955
pydocstyle: true
6056
pypi_username: pulp
@@ -69,13 +65,11 @@ stalebot_days_until_stale: 90
6965
stalebot_limit_to_pulls: true
7066
sync_ci: true
7167
test_azure: true
72-
test_bindings: false
7368
test_cli: true
7469
test_deprecations: true
7570
test_gcp: false
7671
test_lowerbounds: true
7772
test_performance: false
78-
test_released_plugin_with_next_pulpcore_release: false
7973
test_reroute: true
8074
test_s3: true
8175
test_stream: false

0 commit comments

Comments
 (0)