Skip to content

Commit e321173

Browse files
author
Aaron Schlesinger
committed
doc(README.md): filling out the development section
1 parent 7dfbbf5 commit e321173

1 file changed

Lines changed: 24 additions & 33 deletions

File tree

README.md

Lines changed: 24 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -22,49 +22,38 @@ The Deis project welcomes contributions from all developers. The high level proc
2222
- If your PR fixes any [issues][issues], make sure you write Fixes #1234 in your PR description (where #1234 is the number of the issue you're closing)
2323
- The Deis core contributors will review your code. After each of them sign off on your code, they'll label your PR with LGTM1 and LGTM2 (respectively). Once that happens, you may merge.
2424

25+
## Prerequisites
2526

26-
## Deploying
27+
In order to develop and test this component in a Deis cluster, you'll need the following:
2728

28-
To build a dev release of this image, you will also need your own registry, but DockerHub or
29-
[Quay](https://quay.io/) will do fine here. To build, run:
29+
* [GNU Make](https://www.gnu.org/software/make/)
30+
* [Docker](https://www.docker.com/) installed, configured and running
31+
* A working Kubernetes cluster and `kubectl` installed and configured to talk to the cluster
32+
* If you don't have this setup, please see [the installation instructions][install-k8s]
3033

31-
```bash
32-
$ export DEIS_REGISTRY=myregistry.com:5000
33-
$ make docker-build docker-push
34-
```
35-
36-
This will compile the Docker image and push it to your registry.
34+
## Testing Your Code
3735

38-
After that, run
39-
40-
```
41-
$ make deploy
42-
```
36+
Once you have all the aforementioned prerequisites, you can build and (optionally) push a new Docker image with your changes.
4337

44-
Which will deploy the component to kubernetes. After a while, you should see one pod up with one
45-
running:
38+
This project has a [Makefile](https://github.com/deis/postgres/blob/master/Makefile) that makes these tasks significantly easier. It requires the following environment variables to be set:
4639

47-
```
48-
NAME READY STATUS RESTARTS AGE
49-
postgres-6wy8o 1/1 Running 0 32s
50-
```
40+
* `DEIS_REGISTRY` - A Docker registry that you have push access to and your Kubernetes cluster can pull from
41+
* If this is [Docker Hub](https://hub.docker.com/), leave this variable empty
42+
* Otherwise, ensure it has a trailing `/`. For example, if you're using [Quay.io](https://quay.io), use `quay.io/`
43+
* `IMAGE_PREFIX` - The organization in the Docker repository. This defaults to `deis`, but if you don't have access to that organization, set this to one you have push access to.
44+
* `SHORT_NAME` (optional) - The name of the image. This defaults to `controller`
45+
* `VERSION` (optional) - The tag of the Docker image. This defaults to the current Git SHA (the output of `git rev-parse --short HEAD`)
5146

52-
You can then query this pod as you would with any other Kubernetes pod:
47+
Assuming you have these variables set correctly, run `make docker-build` to build the new image, and `make docker-push` to push it. Here is an example command that would push to `quay.io/arschles/postgres:devel`:
5348

54-
```
55-
$ kubectl logs -f postgres-6wy8o
56-
$ kubectl exec -it postgres-6wy8o psql
57-
```
58-
59-
60-
## Testing
61-
62-
You can run the test suite with
63-
64-
```
65-
$ make test
49+
```console
50+
export DEIS_REGISTRY=quay.io/
51+
export IMAGE_PREFIX=arschles
52+
export VERSION=devel
53+
make docker-build docker-push
6654
```
6755

56+
Note that you'll have to push your image to a Docker repository (`make docker-push`) in order for your Kubernetes cluster to pull the image. This is important for testing in your cluster.
6857

6958
## License
7059

@@ -82,3 +71,5 @@ limitations under the License.
8271

8372
[prs]: https://github.com/deis/postgres/pulls
8473
[issues]: https://github.com/deis/postgres/issues
74+
[install-k8s]: http://kubernetes.io/gettingstarted/
75+

0 commit comments

Comments
 (0)