Skip to content
Draft
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions .expeditor/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pipelines:

subscriptions:
# This will update version of the Chef product Hugo module
# that is used to build the docs when that product is promoted to stable.
# that's used to build the docs when that product is promoted to stable.
- workload: artifact_published:stable:chef-workstation:*
actions:
- bash:.expeditor/update_hugo_modules_artifact_published.sh
Expand All @@ -29,9 +29,9 @@ subscriptions:
- workload: chef/automate:main_completed:project_promoted:chef/automate:main:acceptance:*
actions:
- bash:.expeditor/update_hugo_modules_project_promoted.sh
- workload: habitat-sh/habitat:main_completed:project_promoted:habitat-sh/habitat:main:current:*
actions:
- bash:.expeditor/update_hugo_modules_project_promoted.sh
# - workload: habitat-sh/habitat:main_completed:project_promoted:habitat-sh/habitat:main:current:*
# actions:
# - bash:.expeditor/update_hugo_modules_project_promoted.sh
- workload: pull_request_merged:chef/effortless:main:*
actions:
- bash:.expeditor/update_hugo_modules_pull_request_merged.sh:
Expand Down
66 changes: 32 additions & 34 deletions .expeditor/update_hugo_modules_project_promoted.sh
Original file line number Diff line number Diff line change
@@ -1,34 +1,38 @@
#!/bin/bash

set -eoux pipefail
set -euo pipefail
set -x

# different chef product repos have their documentation in different subdirectories
# this variable has to be defined so we can copy content from the proper subdirectory
# that contains the docs content and properly execute the `hugo mod get` command.

if [[ "${EXPEDITOR_PROJECT}" == *"automate"* ]]; then
org="chef"
product_key="automate"
subdirectory="components/docs-chef-io"
manifest="https://packages.chef.io/files/${EXPEDITOR_TARGET_CHANNEL}/automate/latest/manifest_semver.json"
git_sha="$(curl -s $manifest | jq -r -c ".git_sha")"
elif [[ "${EXPEDITOR_PROJECT}" == *"habitat"* ]]; then
org="habitat-sh"
product_key="habitat"
subdirectory="components/docs-chef-io"
manifest="https://packages.chef.io/files/${EXPEDITOR_TARGET_CHANNEL}/habitat/latest/manifest.json"
git_sha="$(curl -s $manifest | jq -r -c ".sha")"
version="$(curl -s $manifest | jq -r -c ".version")"
fi

branch="expeditor/update_docs_${product_key}_${git_sha}"
git checkout -b "$branch"
case "${EXPEDITOR_PROJECT}" in
*"automate-private"*)
org="chef"
product_key="automate-private"
subdirectory="components/docs-chef-io"
;;
*"habitat"*)
org="habitat-sh"
product_key="habitat"
subdirectory="components/docs-chef-io"
;;
*)
echo "Unsupported EXPEDITOR_PROJECT: ${EXPEDITOR_PROJECT}" >&2
exit 1
;;
esac

timestamp="$(date '+%Y%m%d%H%M%S')"
branch="expeditor/update_docs_${product_key}_${timestamp}"
git checkout -B "$branch"

# Update the semver version of the documentation module that chef-web-docs will
# use to build the docs from.
# See https://gohugo.io/hugo-modules/use-modules/#update-one-module

hugo mod get "github.com/${org}/${product_key}/${subdirectory}@${git_sha}"
hugo mod get "github.com/${org}/${product_key}/${subdirectory}"
hugo mod tidy

# Update the vendored files in chef-web-docs
Expand All @@ -38,31 +42,25 @@ hugo mod vendor

# Clean the go.sum file

rm go.sum
rm -f go.sum
hugo mod clean

###
# Manage Habitat version numbers for release notes
###

# We use product version numbers for release notes.
# There's no list of Habitat versions on packages.chef.io, so we store one in assets/release-notes/habitat/release-versions.json
# This file is updated every time there's a new release of Hab

if [[ "${EXPEDITOR_PROJECT}" == *"habitat"* ]]; then
version_data="$(jq --arg version "$version" '. += [$version]' assets/release-notes/habitat/release-versions.json)" && \
echo -E "${version_data}" > assets/release-notes/habitat/release-versions.json
fi

# submit pull request to chef/chef-web-docs

git add .

if git diff --cached --quiet; then
echo "No documentation module updates found for ${product_key}."
git checkout -
git branch -D "$branch"
exit 0
fi

# give a friendly message for the commit and make sure it's noted for any future
# audit of our codebase that no DCO sign-off is needed for this sort of PR since
#it contains no intellectual property

dco_safe_git_commit "Bump Hugo module $product_key to latest $EXPEDITOR_TARGET_CHANNEL release ($git_sha)."
dco_safe_git_commit "Bump Hugo module ${product_key} to latest ${EXPEDITOR_TARGET_CHANNEL} release."

open_pull_request

Expand Down
71 changes: 68 additions & 3 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,68 @@
Documentation:
- changed-files:
- any-glob-to-any-file: '**/*'

"Component: Chef 360 Platform":
- changed-files:
- any-glob-to-any-file:
- content/360/**
- static/360/**
- content/release_notes/360.md
"Component: Chef Automate":
- changed-files:
- any-glob-to-any-file:
- content/automate/**
- _vendor/github.com/chef/automate-private/**
- static/automate/**
- content/release_notes/automate.md
"Component: Chef Compliance and Remediation":
- changed-files:
- any-glob-to-any-file:
- _vendor/github.com/chef/compliance-**
"Component: Chef Desktop":
- changed-files:
- any-glob-to-any-file:
- content/desktop/**
- _vendor/github.com/chef/desktop-config**
- static/desktop/**
"Component: Chef Habitat":
- changed-files:
- any-glob-to-any-file:
- content/habitat/**
- _vendor/github.com/habitat-sh/**
- static/habitat/**
- content/release_notes/habitat.md
"Component: Chef Infra Client":
- changed-files:
- any-glob-to-any-file:
- content/
- static/client/**
- content/release_notes/client.md
"Component: Chef Infra Server":
- changed-files:
- any-glob-to-any-file:
- content/server/**
- static/server/**
- content/release_notes/server.md
- _vendor/github.com/chef/chef-server
"Component: Chef InSpec":
- changed-files:
- any-glob-to-any-file:
- content/inspec/**
- static/inspec/**
- content/release_notes/inspec**

"Component: Expeditor":
- changed-files:
- any-glob-to-any-file: .expeditor/**
"Component: Supermarket":
- changed-files:
- any-glob-to-any-file:
- content/supermarket
- static/supermarket/**
- content/release_notes/supermarket.md
- _vendor/github.com/chef/supermarket
"Component: Chef Workstation":
- changed-files:
- any-glob-to-any-file:
- content/workstation/**
- static/workstation/**
- content/release_notes/workstation.md
- _vendor/github.com/chef/chef-workstation
2 changes: 2 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,5 @@ MD045: true
MD046:
style: fenced
MD047: true
MD049:
style: "underscore"

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading