Bläddra i källkod

Script + resources for generating README.md with "Issues and Contributing" section

Joe Ferguson 11 år sedan
förälder
incheckning
6fa41bd15a
4 ändrade filer med 77 tillägg och 0 borttagningar
  1. 26 0
      README-footer.md
  2. 30 0
      gen-docs.sh
  3. 20 0
      postgres/README-content.md
  4. 1 0
      postgres/mailing-list.md

+ 26 - 0
README-footer.md

@@ -0,0 +1,26 @@
+
+# Issues and Contributing
+
+We are always thrilled to receive pull requests, and do our best to process them as fast as possible. Not sure if that typo is worth a pull request? Do it! We will appreciate it.
+
+If your pull request is not accepted on the first try, don't be discouraged! If there's a problem with the implementation, hopefully you received feedback on what to improve.
+
+We recommend discussing your plans %%MAILING_LIST%% through a [GitHub issue](https://github.com/docker-library/%%REPO%%/issues) before starting to code - especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give feedback on your design, and maybe point out if someone else is working on the same thing.
+
+Any significant improvement should be documented as a GitHub issue before anybody starts working on it. Please take a moment to check that an issue doesn't already exist documenting your bug report or improvement proposal. If it does, it never hurts to add a quick "+1" or "I have this problem too". This will help prioritize the most common problems and requests.
+
+## Conventions
+
+Fork the repository and make changes on your fork in a feature branch.
+
+Update this documentation when creating or modifying features. Test your documentation changes for clarity, concision, and correctness.
+
+Pull requests descriptions should be as clear as possible and include a reference to all the issues that they address.
+
+Commit messages should start with a capitalized and short summary (max. 50 chars) written in the imperative, followed by an optional, more detailed explanatory text which is separated from the summary by an empty line.
+
+Code review comments may be added to your pull request. Discuss, then make the suggested modifications and force push amended commits to your feature branch. Be sure to post a comment after pushing. The changed commits will show up in the pull request automatically, but the reviewers will not be notified unless you comment.
+
+Before the pull request is merged, make sure that you squash your commits into logical units of work using `git rebase -i` and `git push -f`. Include documentation changes in the same commit so that a revert would remove all traces of the feature or fix.
+
+Commits that fix or close an issue should include a reference like Closes #XXXX or Fixes #XXXX, which will automatically close the issue when merged.

+ 30 - 0
gen-docs.sh

@@ -0,0 +1,30 @@
+#!/bin/bash
+set -e
+
+cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
+
+repos=( "$@" )
+if [ ${#repos[@]} -eq 0 ]; then
+	repos=( */ )
+fi
+repos=( "${repos[@]%/}" )
+
+for repo in "${repos[@]}"; do
+	if [ -e "$repo/README-content.md" ]; then
+		mailingList="$(cat "$repo/mailing-list.md" 2>/dev/null |  sed 's/[\/&]/\\&/g' || true)"
+		if [ "$mailingList" ]; then
+			mailingList=" $mailingList "
+		else
+			mailingList=' '
+		fi
+		
+		(
+			echo "cat $repo/README-content.md README-footer.md > $repo/README.md"
+			cat "$repo/README-content.md" "README-footer.md" > "$repo/README.md"
+			set -x
+			sed -ri 's/\s*%%MAILING_LIST%%\s*/'"$mailingList"'/g; s/%%REPO%%/'"$repo"'/g' "$repo/README.md"
+		)
+	else
+		echo "skipping $repo: repo/README-content.md"
+	fi
+done

+ 20 - 0
postgres/README-content.md

@@ -0,0 +1,20 @@
+# What is PostgreSQL?
+PostgreSQL, often simply "Postgres", is an object-relational database management system (ORDBMS) with an emphasis on extensibility and standards-compliance. As a database server, its primary function is to store data, securely and supporting best practices, and retrieve it later, as requested by other software applications, be it those on the same computer or those running on another computer across a network (including the Internet). It can handle workloads ranging from small single-machine applications to large Internet-facing applications with many concurrent users. Recent versions also provide replication of the database itself for security and scalability.
+
+PostgreSQL implements the majority of the SQL:2011 standard, is ACID-compliant and transactional (including most DDL statements) avoiding locking issues using multiversion concurrency control (MVCC), provides immunity to dirty reads and full serializability; handles complex SQL queries using many indexing methods that are not available in other databases; has updateable views and materialized views, triggers, foreign keys; supports functions and stored procedures, and other expandability, and has a large number of extensions written by third parties. In addition to the possibility of working with the major proprietary and open source databases, PostgreSQL supports migration from them, by its extensive standard SQL support and available migration tools. And if proprietary extensions had been used, by its extensibility that can emulate many through some built-in and third-party open source compatibility extensions, such as for Oracle.
+
+> [wikipedia.org/wiki/PostgreSQL](https://en.wikipedia.org/wiki/PostgreSQL)
+
+# How to use this image
+
+## start a postgres instance
+    docker run --name some-postgres -d postgres
+
+This image includes `EXPOSE 5432` (the postgres port), so standard container linking will make it automatically available to the linked containers. The default `postgres` user and database are created in the entrypoint with `initdb`.
+> The postgres database is a default database meant for use by users, utilities and third party applications. [postgresql.org/docs](http://www.postgresql.org/docs/9.3/interactive/app-initdb.html)
+
+## connect to it from an application
+    docker run --name some-app --link some-postgres:postgres -d application-that-uses-postgres
+
+## ... or via `psql`
+    docker run -it --link some-postgres:postgres --rm postgres sh -c 'exec psql -h "$POSTGRES_PORT_5432_TCP_ADDR" -p "$POSTGRES_PORT_5432_TCP_PORT" -U postgres'

+ 1 - 0
postgres/mailing-list.md

@@ -0,0 +1 @@
+on the [mailing list](http://www.postgresql.org/community/lists/subscribe/) or