habitat-sh / core-plans

Core Habitat Plan definitions
130 stars 252 forks source link

Add a README to any core-plan that is missing one #1252

Open nellshamrell opened 6 years ago

nellshamrell commented 6 years ago

Check out the core plans README template to get started!

Here is the current list of core plans that are missing READMEs:

Services without READMEs

Libraries / Binaries without READMEs

We need READMEs added for each one of them (the README should include the information specified in CONTRIBUTING.md

For reference, here is the bash script I used to generate this list (I will periodically refresh it)

#!/bin/bash

services=()
non_services=()

# Helper to send messages to stderr
log() {
    >&2 echo $*
}

list_entry() {
    dir=${1}
    plan=$(basename $dir)
    echo "- [ ] [${plan}](http://github.com/habitat-sh/core-plans/tree/master/${plan})"
}

for dir in ~/src/habitat-sh/core-plans/*/
do
    dir=${dir%*/}
    plan=$(basename $dir)

    if [ "$plan" == "_RFCs" ]; then
        log "SKIPPING RFCS"
        continue
    fi

    if [ ! -e "${dir}/README.md" ]; then
        # Postgreqsl plans are special, since each individual version
        # sources a main plan, which has run info.
        #
        # No quotes around postgresql* is IMPORTANT
        if [[ "$plan" == postgresql* ]]; then
            log "Special handling of $plan; it's a service"
            services+=($dir)
            continue
        fi

        if [ -e "${dir}/hooks/run" ]; then
            log "Explicit run hook in $dir"
            services+=($dir)
            continue
        fi

        if [ -e "${dir}/plan.sh" ]; then
            if grep --quiet "pkg_svc_run" "${dir}/plan.sh"; then
                log "Implicit run hook for $dir"
                services+=("${dir}")
                continue
            fi
        elif [ -e "${dir}/plan.ps1" ]; then
            if grep "pkg_svc_run" "${dir}/plan.ps1"; then
                log "Implicit run hook for $dir"
                services+=("${dir}")
                continue
            fi
        fi

        # No README, no service
        non_services+=("${dir}")
    fi
done

echo "# Services without READMEs"
for dir in "${services[@]}"; do
    list_entry $dir
done
echo
echo "# Libraries / Binaries without READMEs"
for dir in "${non_services[@]}"; do
    list_entry $dir
done
srenatus commented 6 years ago
echo "- [ ] [${dir##*/}](http://github.com/core-plans/${dir##*/}"

I think this should be

echo "- [ ] [${dir##*/}](https://github.com/habitat-sh/core-plans/tree/master/${dir##*/})"

(...~but I haven't tried it, sorry 😄~ tried this locally, seems not too wrong)

nellshamrell commented 6 years ago

Links in the checklist have been fixed!

christophermaier commented 6 years ago

I updated the list of packages, splitting services apart from libraries / binaries, the latter of which we may be able to automate README generation for. I also updated the script used to generate this list in the issue message.

For posterity, the original list and script are as follows:

for dir in ~/Projects/core-plans/*/
do
    dir=${dir%*/}

    if ls ${dir}/README.md &>/dev/null
    then
       continue
    else
       echo "- [ ] [${dir##*/}](http://github.com/habitat-sh/core-plans/tree/master/${dir##*/})"
    fi

done
christophermaier commented 6 years ago

As soon as https://github.com/habitat-sh/core-plans/pull/1305 merges, I'll update the list above.

rsertelon commented 6 years ago

Updated OP's list of packages today: 2018-04-19

epcim commented 6 years ago

BTW some of them has README in a docs directory (like etcd)