Skip to content

Commit

Permalink
Merge branch 'ansible:devel' into faq-update-section-running-on-zos
Browse files Browse the repository at this point in the history
  • Loading branch information
ketankelkar authored Oct 21, 2024
2 parents 5b4f627 + 071f461 commit 79c4a5e
Show file tree
Hide file tree
Showing 224 changed files with 5,943 additions and 3,488 deletions.
4 changes: 4 additions & 0 deletions .codespellignorelines
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ see the `Active Directory Certificate Services documentation <https://docs.micro
role_type: ANS
# => "$6$43927$lQxPKz2M2X.NWO.gK.t7phLwOKQMcSq72XxDZQ0XzYV6DlL1OD72h417aj16OnHTGxNzhftXJQBcjbunLEepM0"
table#network-platform-table thead tr th.head {
# Following lines from the generated file docs/docsite/rst/reference_appendices/config.rst
:Description: This setting changes the behaviour of mismatched host patterns, it allows you to force a fatal error, a warning or just ignore it.
This setting changes the behaviour of mismatched host patterns, it allows you to force a fatal error, a warning or just ignore it.
/msg alis LIST #ansible* -min 5
181 changes: 149 additions & 32 deletions .github/workflows/build-package-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

name: Ansible package docs build
on:
schedule:
- cron: '17 5 * * *' # Run at 05:17 am
workflow_dispatch:
inputs:
repository-owner:
Expand All @@ -16,34 +18,31 @@ on:
description: Branch, tag, or commit SHA
required: true
default: devel
language:
type: choice
description: Language
required: true
default: english
options:
- english
- japanese
ansible-package-version:
type: choice
description: Version of the Ansible community package to build
description: Ansible community package version
required: true
default: devel
options:
- devel
- '11'
- '10'
- '9'
- '8'
- '7'
latest-symlink:
deploy:
type: boolean
description: Add latest symlink
description: Deploy the build
required: true

deployment-environment:
type: choice
description: Deployment environment
required: true
default: test
options:
- production
- test

env:
PACKAGE_VERSION: ${{ github.event.inputs.ansible-package-version }}
LANGUAGE: ${{ github.event.inputs.language }}
PACKAGE_VERSION: ${{ github.event.inputs.ansible-package-version || 'devel' }}

jobs:
build-package-docs:
Expand All @@ -54,11 +53,11 @@ jobs:
with:
repository: >-
${{
github.event.inputs.repository-owner
github.event.inputs.repository-owner || 'ansible'
}}/${{
github.event.inputs.repository-name
github.event.inputs.repository-name || 'ansible-documentation'
}}
ref: ${{ github.event.inputs.repository-branch }}
ref: ${{ github.event.inputs.repository-branch || 'devel' }}
path: build-directory

- name: Setup nox
Expand All @@ -81,30 +80,20 @@ jobs:
- name: Set the COLLECTION_LIST variable
if: env.PACKAGE_VERSION != 'devel'
run: >-
echo COLLECTION_LIST='"${PACKAGE_VERSION}"'
echo COLLECTION_LIST="${PACKAGE_VERSION}"
>> "${GITHUB_ENV}"
- name: Set the VERSION variable
run: |
if [ ${LANGUAGE} == "english" ]; then
echo VERSION="${PACKAGE_VERSION}" >> "${GITHUB_ENV}"
elif [ ${LANGUAGE} == "japanese" ]; then
echo VERSION="${PACKAGE_VERSION}_ja" >> "${GITHUB_ENV}"
fi
run: echo VERSION="${PACKAGE_VERSION}" >> "${GITHUB_ENV}"

- name: Build the Ansible community package docs
run: make webdocs ANSIBLE_VERSION="${COLLECTION_LIST}"
working-directory: build-directory/docs/docsite

- name: Create latest symlink
if: fromJSON(github.event.inputs.latest-symlink)
run: ln -s "${VERSION}" _build/html/latest
working-directory: build-directory/docs/docsite

- name: Create a tarball with the build contents
run: >-
tar -czvf
ansible-package-docs-html-"${PACKAGE_VERSION}"-$(date '+%Y-%m-%d')-${{
ansible-package-docs-html-"${PACKAGE_VERSION}"-"$(date '+%Y-%m-%d')"-${{
github.run_id
}}-${{
github.run_number
Expand All @@ -120,3 +109,131 @@ jobs:
name: package-docs-build
path: build-directory/docs/docsite/ansible-package-docs-html-*.tar.gz
retention-days: 7

check-deploy:
if: github.event_name == 'workflow_dispatch' && github.event.inputs.deploy == 'true'
needs: build-package-docs
runs-on: ubuntu-latest
steps:
- name: Log the workflow inputs if deployed
run: |
{
echo "## Deployment details :shipit:";
echo "Publish to: ${{ github.event.inputs.deployment-environment }}";
echo "Package version: ${{ github.event.inputs.ansible-package-version }}";
echo "Owner: ${{ github.event.inputs.repository-owner }}";
echo "Branch: ${{ github.event.inputs.repository-branch }}";
} >> "${GITHUB_STEP_SUMMARY}"
notify-build-failures:
if: failure()
needs: build-package-docs
runs-on: ubuntu-latest
env:
ROOM_URL: https://ansible-accounts.ems.host/_matrix/client/v3/rooms/!HJtetIFWYEIDBOXxFE:libera.chat/send/m.room.message
FAIL_MESSAGE: >-
Oh no! A community package docs build has failed.
Check this workflow run to see what went wrong:
https://github.com/ansible/ansible-documentation/actions/runs/${{ github.run_id }}
@orandon @samccann
steps:
- name: Set a transaction ID
run: echo "TX_ID=$(date +%s)" >> "${GITHUB_ENV}"

- name: Notify the DaWGs in Matrix
run: |
curl -X PUT "${{ env.ROOM_URL }}/${TX_ID}" \
-H "Authorization: Bearer ${{ secrets.DOCS_BOT_TOKEN }}" \
-H "Content-Type: application/json" \
-d '{"msgtype": "m.text", "body": "${{ env.FAIL_MESSAGE }}"}'
deploy-package-docs:
needs:
- check-deploy
runs-on: ubuntu-latest
environment:
name: deploy-package-docs
url: ${{ env.ENV_URL }}
env:
TARGET: ${{ github.event.inputs.deployment-environment }}
DEST_REPO: ansible-community/package-doc-builds
USER_EMAIL: "41898282+github-actions[bot]@users.noreply.github.com"
USER_NAME: "github-actions[bot]"
steps:
- name: Download the build archive
uses: actions/download-artifact@v4
with:
name: package-docs-build

- name: Extract the tarball
run: >-
tar -xvzf
ansible-package-docs-html-*.tar.gz
--one-top-level
- name: Set the production branch and url
if: env.TARGET == 'production'
env:
BRANCH_NAME: ${{ github.event.inputs.ansible-package-version }}
PROD_URL: https://ansible.readthedocs.io/projects/ansible
run: |
echo "BRANCH=${BRANCH_NAME}" >> "${GITHUB_ENV}"
echo "ENV_URL=${PROD_URL}/${BRANCH_NAME}" >> "${GITHUB_ENV}"
- name: Set the test branch and url
if: env.TARGET == 'test'
env:
TEST_URL: https://ansible-community.github.io/package-doc-builds
run: |
echo "BRANCH=gh-pages" >> "${GITHUB_ENV}"
echo "ENV_URL=${TEST_URL}" >> "${GITHUB_ENV}"
- name: Checkout the deploy directory
uses: actions/checkout@v4
with:
repository: ${{ env.DEST_REPO }}
ref: ${{ env.BRANCH }}
path: deploy-directory
fetch-depth: 0
ssh-key: ${{ secrets.DEPLOY_DOC_BUILD }}
persist-credentials: true

- name: Copy the generated HTML and assets for production
run: >-
rsync -av --delete --mkpath
ansible-package-docs-html-*/
deploy-directory/docs
- name: Create a norobots.txt file for the test site
if: env.TARGET == 'test'
run: |
touch norobots.txt
echo "User-agent: *" > norobots.txt
echo "Disallow: /" >> norobots.txt
working-directory: deploy-directory/docs

- name: Configure the git user
run: |
git config --local user.email "${USER_EMAIL}"
git config --local user.name "${USER_NAME}"
working-directory: deploy-directory

- name: Git add the generated HTML and assets
run: git add ./docs --all --force
working-directory: deploy-directory

- name: Commit generated HTML and assets
run: >-
git diff-index --quiet HEAD ||
git commit -m "Push docs build $(date '+%Y-%m-%d')-${{
github.run_id
}}-${{
github.run_number
}}-${{
github.run_attempt
}}"
working-directory: deploy-directory

- name: Push build to deploy repository
run: git push origin
working-directory: deploy-directory
17 changes: 17 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Ansible Docsite CI

on:
schedule:
# Daily
- cron: "23 7 * * *"
push:
branches-ignore:
- 'patchback/**'
Expand All @@ -11,3 +14,17 @@ on:
jobs:
nox:
uses: ./.github/workflows/reusable-nox.yml

check:
if: always()

needs:
- nox

runs-on: ubuntu-latest

steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
11 changes: 7 additions & 4 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,26 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Set up UV
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Setup venv
run: |
python -m venv venv
./venv/bin/pip install -r hacking/pr_labeler/requirements.txt
uv venv venv
uv pip install --python venv \
-e hacking/pr_labeler -c tests/pr_labeler.txt
- name: "Run the issue labeler"
if: "github.event.issue || inputs.type == 'issue'"
env:
event_json: "${{ toJSON(github.event) }}"
GITHUB_TOKEN: ${{ steps.create_token.outputs.token }}
number: "${{ github.event.issue.number || inputs.number }}"
run: |
./venv/bin/python hacking/pr_labeler/label.py issue "${number}"
./venv/bin/ad-triage issue "${number}"
- name: "Run the PR labeler"
if: "github.event.pull_request || inputs.type == 'pr'"
env:
event_json: "${{ toJSON(github.event) }}"
GITHUB_TOKEN: ${{ steps.create_token.outputs.token }}
number: "${{ github.event.number || inputs.number }}"
run: |
./venv/bin/python hacking/pr_labeler/label.py pr "${number}"
./venv/bin/ad-triage pr "${number}"
65 changes: 44 additions & 21 deletions .github/workflows/pip-compile-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,62 @@ name: "Refresh dev dependencies"
- cron: "0 0 * * 0"
workflow_dispatch:
inputs:
base-branch:
required: false
type: string
pr-branch:
required: false
type: string
reset-branch:
type: boolean
default: false
labels:
required: false
type: string
push:
branches:
- devel
paths:
- .github/workflows/reusable-pip-compile.yml
- ".github/workflows/pip-compile-dev.yml"
- "tests/*.in"

jobs:
refresh:
strategy:
fail-fast: false
matrix:
include:
- base-branch: devel
pr-branch: pip-compile/devel/dev
nox-args: >-
-e 'pip-compile-3.11(formatters)'
'pip-compile-3.11(typing)'
'pip-compile-3.11(static)'
'pip-compile-3.11(spelling)'
'pip-compile-3.11(tag)'
- base-branch: stable-2.17
pr-branch: pip-compile/stable-2.17/dev
nox-args: >-
-e 'pip-compile-3.10(formatters)'
'pip-compile-3.10(typing)'
'pip-compile-3.10(static)'
'pip-compile-3.10(spelling)'
- base-branch: stable-2.16
pr-branch: pip-compile/stable-2.16/dev
nox-args: >-
-e 'pip-compile-3.10(formatters)'
'pip-compile-3.10(typing)'
'pip-compile-3.10(static)'
'pip-compile-3.10(spelling)'
- base-branch: stable-2.15
pr-branch: pip-compile/stable-2.15/dev
nox-args: >-
-e 'pip-compile-3.10(formatters)'
'pip-compile-3.10(typing)'
'pip-compile-3.10(static)'
'pip-compile-3.10(spelling)'
- base-branch: stable-2.14
pr-branch: pip-compile/stable-2.14/dev
nox-args: >-
-e 'pip-compile-3.10(formatters)'
'pip-compile-3.10(typing)'
'pip-compile-3.10(static)'
'pip-compile-3.10(spelling)'
name: "Refresh dev dependencies"
uses: ./.github/workflows/reusable-pip-compile.yml
with:
message: "ci: refresh dev dependencies"
base-branch: "${{ inputs.base-branch || 'devel' }}"
pr-branch: "${{ inputs.pr-branch || 'pip-compile/devel/dev' }}"
nox-args: >-
-e 'pip-compile-3.10(formatters)'
'pip-compile-3.10(typing)'
'pip-compile-3.10(static)'
'pip-compile-3.10(spelling)'
base-branch: "${{ matrix.base-branch }}"
pr-branch: "${{ matrix.pr-branch }}"
nox-args: "${{ matrix.nox-args }}"
reset-branch: "${{ inputs.reset-branch || false }}"
labels: "${{ inputs.labels || 'backport-2.14,backport-2.15,backport-2.16,backport-2.17,tooling' }}"
labels: "${{ inputs.labels || 'no_backport,tooling' }}"
secrets: inherit
Loading

0 comments on commit 79c4a5e

Please sign in to comment.