Skip to content

Commit

Permalink
Merge pull request #1953 from dimagi/dmr/standardize-ansible-help-text
Browse files Browse the repository at this point in the history
Standardize help cache generation across environments
  • Loading branch information
dannyroberts authored Jul 24, 2018
2 parents 1c096b5 + 5b02b4c commit 69675d7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
all : src/commcare_cloud/help_cache/ansible.txt src/commcare_cloud/help_cache/ansible-playbook.txt docs/commcare-cloud/commands/index.md


# The length of the home directory affects
# how help text gets wrapped in ansible/ansible-playbook -h output.
# Pick a standard (but arbitrary) value for $HOME to be used across all environments.
# Make it short but unlikely to occur otherwise, so that we can safely find/replace it with ~.
# (Directly using escaped '~' does not work.)
STANDARD_HOME=/!

src/commcare_cloud/help_cache/ansible.txt:
ansible -h | sed "s|${HOME}|~|g" > src/commcare_cloud/help_cache/ansible.txt
COLUMNS=80 HOME="${STANDARD_HOME}" ansible -h | sed "s|${STANDARD_HOME}|~|g" > src/commcare_cloud/help_cache/ansible.txt

src/commcare_cloud/help_cache/ansible-playbook.txt:
ansible-playbook -h | sed "s|${HOME}|~|g" > src/commcare_cloud/help_cache/ansible-playbook.txt
COLUMNS=80 HOME="${STANDARD_HOME}" ansible-playbook -h | sed "s|${STANDARD_HOME}|~|g" > src/commcare_cloud/help_cache/ansible-playbook.txt

docs/commcare-cloud/commands/index.md : src/commcare_cloud/* src/commcare_cloud/*/* src/commcare_cloud/*/*/*
manage-commcare-cloud make-docs > docs/commcare-cloud/commands/index.md
Expand Down

0 comments on commit 69675d7

Please sign in to comment.