Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: tanoda/chef-web-docs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: chef/chef-web-docs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Able to merge. These branches can be automatically merged.
Loading
Showing 5,048 changed files with 433,075 additions and 154,786 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 0 additions & 1 deletion .envrc

This file was deleted.

6 changes: 0 additions & 6 deletions .expeditor/build.habitat.yml

This file was deleted.

8 changes: 0 additions & 8 deletions .expeditor/buildkite/deploy.sh

This file was deleted.

4 changes: 2 additions & 2 deletions .expeditor/buildkite/hugo_lint.sh
Original file line number Diff line number Diff line change
@@ -2,14 +2,14 @@

set -euo pipefail

LINT_STATUS="$(grep -r -I --color=auto -o --with-filename -n -P '[^\x00-\x7F]' ./content &> /dev/null ; echo $?)"
LINT_STATUS="$(grep -r -I --color=auto -o --with-filename -n -P '[^\x00-\x7F]' ./content | grep -v '[✓|├|─|│|└]' &> /dev/null ; echo $?)"

if [ "$LINT_STATUS" == 1 ]; then
echo "Success!"
exit 0
else
echo "Failure!"
grep -r -I --color=auto -o --with-filename -n -P '[^\x00-\x7F]' ./content
grep -r -I --color=auto -o --with-filename -n -P '[^\x00-\x7F]' ./content | grep -v '[✓|├|─|│|└]'
if [ "$LINT_STATUS" == 0 ]; then
exit 1
else
36 changes: 36 additions & 0 deletions .expeditor/buildkite/hugo_lint_cookstyle_pages.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

# Verify that each Cookstyle YAML file in generated/_vendor/github.com/chef/cookstyle/docs-chef-io/assets/cookstyle
# has a matching Markdown file in generated/generated_content/workstation/cookstyle/cops.

# You can regenerate all the Cookstyle Markdown files by running `cd generated && make build && cd ../`.


set -euo pipefail

dataDir=generated/_vendor/github.com/chef/cookstyle/docs-chef-io/assets/cookstyle/*
LINT_STATUS=0

for file in $dataDir
do mdFile="${file/.yml/.md}"
mdFile="${mdFile/cops_/}"
mdFile="${mdFile/generated\/_vendor\/github.com\/chef\/cookstyle\/docs-chef-io\/assets\/cookstyle/generated/generated_content/workstation/cookstyle/cops}"
if test ! -f "${mdFile}"; then
echo "${mdFile} is missing."
LINT_STATUS=1
fi
done

if test ! -f "generated/generated_content/workstation/cookstyle/cops/_index.md"; then
echo "content/workstation/cookstyle/cops.md is missing."
LINT_STATUS=1
fi

if [ "$LINT_STATUS" == 1 ]; then
echo -e "\nAt least one Cookstyle Markdown file is missing from generated/generated_content/workstation/cookstyle."
echo "Regenerate all Cookstyle Markdown files by running 'cd generated && make build && cd ../'."
exit 1
else
echo "Success! All Cookstyle Markdown files exist."
exit 0
fi
93 changes: 55 additions & 38 deletions .expeditor/config.yml
Original file line number Diff line number Diff line change
@@ -5,49 +5,66 @@ slack:

github:
delete_branch_on_merge: true
release_branch:
- master

release_branches:
- main

pipelines:
- verify:
description: Pull Request validation tests
public: true
- verify_private:
description: Pull Request validation tests requiring access keys
- habitat/build:
description: Build the Habitat packages
- deploy/acceptance:
definition: .expeditor/deploy.pipeline.yml
description: Deploy to docs-acceptance.cd.chef.co (i.e. docs-acceptance.chef.io)
env:
- CHANNEL: acceptance
- deploy/production:
definition: .expeditor/deploy.pipeline.yml
description: Deploy to docs-production.cd.chef.co (i.e. docs.chef.io)
env:
- CHANNEL: stable

merge_actions:
# These actions are taken, in order they are specified, anytime a Pull Request is merged.
- trigger_pipeline:habitat/build:
post_commit: true

promote:
actions:
- built_in:promote_habitat_packages
- trigger_pipeline:deploy/production:
only_if_conditions:
- value_one: "{{target_channel}}"
operator: equals
value_two: stable
channels:
- acceptance # docs-acceptance.cd.chef.co / docs-acceptance.chef.io
- stable # docs-production.cd.chef.co / docs.chef.io

subscriptions:
# These actions are taken, in order they are specified, after the Habitat packages are successfully built
- workload: buildkite_hab_build_group_published:{{agent_id}}:*
# This will update version of the Chef product Hugo module
# that is 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
- workload: artifact_published:stable:inspec:*
actions:
- bash:.expeditor/update_hugo_modules_artifact_published.sh
- workload: artifact_published:stable:chef-server:*
actions:
- bash:.expeditor/update_hugo_modules_artifact_published.sh
- workload: artifact_published:stable:supermarket:*
actions:
- bash:.expeditor/update_hugo_modules_artifact_published.sh
- 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: pull_request_merged:chef/effortless:main:*
actions:
- bash:.expeditor/update_hugo_modules_pull_request_merged.sh:
only_if_modified:
- docs-chef-io/*
- workload: chef/cookstyle:main_completed:project_promoted:chef/cookstyle:main:*
actions:
- bash:.expeditor/update_hugo_modules_cookstyle.sh
- workload: pull_request_merged:inspec/inspec-aws:main:*
actions:
- bash:.expeditor/update_hugo_modules_pull_request_merged.sh:
only_if_modified:
- docs-chef-io/static/release-notes/inspec-aws/*
- workload: pull_request_merged:inspec/inspec-azure:main:*
actions:
- bash:.expeditor/update_hugo_modules_pull_request_merged.sh:
only_if_modified:
- docs-chef-io/static/release-notes/inspec-azure/*
- workload: pull_request_merged:inspec/inspec-k8s:main:*
actions:
- bash:.expeditor/update_hugo_modules_pull_request_merged.sh:
only_if_modified:
- docs-chef-io/static/release-notes/inspec-k8s/*
- workload: pull_request_merged:chef/compliance-remediation-2022:main:*
actions:
- bash:.expeditor/update_hugo_modules_pull_request_merged.sh:
only_if_modified:
- docs-chef-io/*
- workload: pull_request_merged:chef/compliance-profiles:main:*
actions:
- built_in:promote_habitat_packages
- trigger_pipeline:deploy/acceptance:
post_commit: true
- bash:.expeditor/update_hugo_modules_pull_request_merged.sh:
only_if_modified:
- docs-chef-io/*
11 changes: 0 additions & 11 deletions .expeditor/deploy.pipeline.yml

This file was deleted.

70 changes: 70 additions & 0 deletions .expeditor/update_hugo_modules_artifact_published.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#!/bin/bash

set -eoux pipefail

branch="expeditor/update_docs_${EXPEDITOR_PRODUCT_KEY}_${EXPEDITOR_VERSION}"
git checkout -b "$branch"

# 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_PRODUCT_KEY}" == "chef-workstation" ]; then
subdirectory="docs-chef-io"
org="chef"
tag_prefix=""
tag_suffix=""
elif [ "${EXPEDITOR_PRODUCT_KEY}" == "inspec" ]; then
subdirectory="docs-chef-io"
org="inspec"
tag_prefix="v"
tag_suffix="^{}"
elif [ "${EXPEDITOR_PRODUCT_KEY}" == "chef-server" ]; then
subdirectory="docs-chef-io"
org="chef"
tag_prefix=""
tag_suffix="^{}"
elif [ "${EXPEDITOR_PRODUCT_KEY}" == "supermarket" ]; then
subdirectory="docs-chef-io"
org="chef"
tag_prefix=""
tag_suffix=""
fi

# Return the commit SHA that matches the product tag.

git_sha="$(git ls-remote https://github.com/${org}/${EXPEDITOR_PRODUCT_KEY}.git rev-list --refs -n 1 ${tag_prefix}${EXPEDITOR_VERSION}${tag_suffix} | cut -f 1)"

# Update the repository commit that chef-web-docs will
# use to build the InSpec or Workstation documentation.
# See https://gohugo.io/hugo-modules/use-modules/#update-one-module

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

# Update the vendored files in chef-web-docs
# See https://gohugo.io/hugo-modules/use-modules/#vendor-your-modules

hugo mod vendor

# Clean the go.sum file

rm go.sum
hugo mod clean

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

git add .

# 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 $EXPEDITOR_PRODUCT_KEY to $EXPEDITOR_VERSION."

open_pull_request

# Get back to main and cleanup the leftovers - any changed files left over at
# the end of this script will get committed to main.
git checkout -
git branch -D "$branch"
49 changes: 49 additions & 0 deletions .expeditor/update_hugo_modules_cookstyle.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/bin/bash

set -eoux pipefail

# Create a new branch and checkout that branch.

branch="expeditor/update_docs_cookstyle"
git checkout -b "$branch"

## Cookstyle data files are stored in the generated dir.
cd generated

# Update the go.mod and go.sum for chef/cookstyle

hugo mod get "github.com/chef/cookstyle"
hugo mod get "github.com/chef/cookstyle/docs-chef-io"
hugo mod tidy

# Update the vendored files in chef-web-docs.
# See https://gohugo.io/hugo-modules/use-modules/#vendor-your-modules

hugo mod vendor

# Clean the go.sum file

rm go.sum
hugo mod clean

## Generate new Cookstyle cop MD pages.
make build

cd ../

# Submit pull request to chef/chef-web-docs.

git add .

# 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 ${EXPEDITOR_PROJECT} to latest ${EXPEDITOR_TARGET_CHANNEL}."

open_pull_request

# Get back to main and cleanup the leftovers - any changed files left over at
# the end of this script will get committed to main.
git checkout -
git branch -D "$branch"
Loading