forked from emissary-ingress/emissary
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify and document the build process.
- Loading branch information
Flynn
committed
Apr 26, 2017
1 parent
a6c65f1
commit c6df70f
Showing
12 changed files
with
159 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
Building Ambassador | ||
=================== | ||
|
||
If you just want to **use** Ambassador, check out the [README.md](README.md)! You don't need to build anything. | ||
|
||
If you really want to customize Ambassador, though, read on -- but **NOTE WELL**! This process will change soon. | ||
|
||
You'll need the following: | ||
|
||
- bash | ||
- make | ||
- docker | ||
- Python 3 | ||
- [bump2version](https://pypi.python.org/pypi/bump2version) | ||
|
||
(Honestly, you only need Python for `bump2version`.) | ||
|
||
Normal Workflow | ||
=============== | ||
|
||
0. `export DOCKER_REGISTRY=$registry` | ||
|
||
This sets the registry to which to push Docker images and is **mandatory** if you're not using Minikube. The `$registry` info should be the prefix for `docker push`: | ||
|
||
"dwflynn" will push to Dockerhub with user `dwflynn` | ||
"gcr.io/flynn" will push to GCR with user `flynn` | ||
|
||
You can separately tweak the registry from which images will be _pulled_ using `AMBASSADOR_REGISTRY` and `STATSD_REGISTRY`. See the files in `templates` for more here. | ||
|
||
1. Make changes. Commit. | ||
|
||
Hopefully this step is clear. | ||
|
||
2. `make new-$level` | ||
|
||
This will correctly set the version number everywhere, then build (and probably push) Docker images, then build YAML files for you. IT WILL NOT COMMIT OR TAG. | ||
|
||
`$level` must be one of "major", "minor", or "patch", using [semantic versioning](http://semver.org/): | ||
|
||
"major" is for major breaking changes. | ||
"minor" is for new functionality that's still backward compatible. | ||
"patch" is for bug fixes. | ||
|
||
(You can do "make artifacts" if you want to rebuild artifacts but not change the version, even though that's likely to not be a great idea.) | ||
|
||
3. `make tag` | ||
|
||
Do this once you're happy with everything. It will commit (if need be) and then create and push a Git tag for your version. | ||
|
||
What if I Don't Want to Push My Images? | ||
--------------------------------------- | ||
|
||
**NOTE WELL**: if you're not using Minikube, this is almost certainly a mistake. | ||
|
||
But suppose you are using Minikube. The Makefile (deliberately) requires you to set DOCKER_REGISTRY, so you can't just unset it -- instead, set it to "-" to prevent any pushes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/bash | ||
|
||
slashify () { | ||
thing="$1" | ||
|
||
if [ -n "$thing" ]; then | ||
case "$thing" in | ||
*/) ;; | ||
*) thing="$thing/" | ||
esac | ||
fi | ||
|
||
echo "$thing" | ||
} | ||
|
||
if [ -z "${DOCKER_REGISTRY}" ]; then | ||
echo "DOCKER_REGISTRY must be set" >&2 | ||
exit 1 | ||
fi | ||
|
||
if [ "$DOCKER_REGISTRY" == "-" ]; then | ||
unset DOCKER_REGISTRY | ||
fi | ||
|
||
DOCKER_REGISTRY=$(slashify "$DOCKER_REGISTRY") | ||
|
||
# Default to using DOCKER_REGISTRY, but allow overriding. | ||
AMREG=$(slashify "${AMBASSADOR_REGISTRY:-$DOCKER_REGISTRY}") | ||
|
||
# Default to using DOCKER_REGISTRY, but allow overriding. | ||
STREG=$(slashify "${STATSD_REGISTRY:-$DOCKER_REGISTRY}") | ||
|
||
cat <<EOF | ||
export DOCKER_REGISTRY="$DOCKER_REGISTRY" | ||
export AMREG="$AMREG" | ||
export STREG="$STREG" | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters