Skip to content

Commit

Permalink
Test module docs on Shippable. (ansible#4921)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattclay authored Sep 19, 2016
1 parent f2c2ddd commit 600228c
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
2 changes: 2 additions & 0 deletions shippable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ matrix:
- env: TEST=integration PLATFORM=osx VERSION=10.11

- env: TEST=sanity INSTALL_DEPS=1

- env: TEST=docs
build:
pre_ci_boot:
options: "--privileged=false --net=bridge"
Expand Down
2 changes: 2 additions & 0 deletions test/utils/shippable/docs-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
jinja2
pyyaml
55 changes: 55 additions & 0 deletions test/utils/shippable/docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/bin/bash -eux

set -o pipefail

ansible_repo_url="https://github.com/ansible/ansible.git"

build_dir="${SHIPPABLE_BUILD_DIR}"
repo="${REPO_NAME}"

case "${repo}" in
"ansible-modules-core")
this_module_group="core"
other_module_group="extras"
;;
"ansible-modules-extras")
this_module_group="extras"
other_module_group="core"
;;
*)
echo "Unsupported repo name: ${repo}"
exit 1
;;
esac

modules_tmp_dir="${build_dir}.tmp"
this_modules_dir="${build_dir}/lib/ansible/modules/${this_module_group}"
other_modules_dir="${build_dir}/lib/ansible/modules/${other_module_group}"

cd /
mv "${build_dir}" "${modules_tmp_dir}"
git clone "${ansible_repo_url}" "${build_dir}"
cd "${build_dir}"
rmdir "${this_modules_dir}"
mv "${modules_tmp_dir}" "${this_modules_dir}"
mv "${this_modules_dir}/shippable" "${build_dir}"
git submodule init "${other_modules_dir}"
git submodule sync "${other_modules_dir}"
git submodule update "${other_modules_dir}"

pip install -r lib/ansible/modules/${this_module_group}/test/utils/shippable/docs-requirements.txt --upgrade
pip list

source hacking/env-setup

PAGER=/bin/cat \
ANSIBLE_DEPRECATION_WARNINGS=false \
bin/ansible-doc -l \
2>/tmp/ansible-doc.err

if [ -s /tmp/ansible-doc.err ]; then
# report warnings as errors
echo "Output from 'ansible-doc -l' on stderr is considered an error:"
cat /tmp/ansible-doc.err
exit 1
fi

0 comments on commit 600228c

Please sign in to comment.