Skip to content

Commit

Permalink
Improve and document the developer deployment process. (argoproj#37)
Browse files Browse the repository at this point in the history
Rather than require developers to change on disk files in the git index,
or create custom patching solutions, introduce a make target that allows
us to build, push, and deploy manifests in a single command.
  • Loading branch information
dgoodwin committed Sep 14, 2020
1 parent a66f2cc commit a705945
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
VERSION?=$(shell cat VERSION)
IMAGE_TAG?=v$(VERSION)
IMAGE_PREFIX?=argoprojlabs
IMAGE?=argoprojlabs/argocd-applicationset:v$(VERSION)
DOCKER_PUSH?=true

.PHONY: build
Expand All @@ -9,8 +8,13 @@ build:

.PHONY: image
image:
docker build -t $(IMAGE_PREFIX)/argocd-applicationset:$(IMAGE_TAG) .
@if [ "$(DOCKER_PUSH)" = "true" ] ; then docker push $(IMAGE_PREFIX)/argocd-applicationset:$(IMAGE_TAG) ; fi
docker build -t $(IMAGE) .
@if [ "$(DOCKER_PUSH)" = "true" ] ; then docker push $(IMAGE) ; fi

.PHONY: deploy
deploy:
kustomize build manifests/cluster-install | kubectl apply -f -
kubectl patch deployment -n argocd argocd-applicationset-controller --type='json' -p='[{"op": "replace", "path": "/spec/template/spec/containers/0/image", "value": "$(IMAGE)"}]'

# Generate manifests e.g. CRD, RBAC etc.
.PHONY: manifests
Expand Down
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,22 @@ compatibility are made, at least until merging into Argo CD proper.
## Proposal:
* https://docs.google.com/document/d/1juWGr20FQaJmuuTIS8mBFmWWDU422M_FQMuhp5c1jt4/edit?usp=sharing

## Development Instructions

The following assumes you have:

1. Installed a recent version of [kustomize](https://github.com/kubernetes-sigs/kustomize) (3.x+).
1. Created a container repository for your development image.
1. Deployed ArgoCD into the "argocd" namespace.

To build and push a container with your current code, and deploy Kubernetes manifests for the controller Deployment:

```bash
IMAGE="username/argocd-applicationset:v0.0.1" make image deploy
```

The ApplicationSet controller should now be running in the "argocd" namespace.

## Example Spec:

```yaml
Expand Down Expand Up @@ -40,3 +56,4 @@ spec:
```
Additional examples are available in the [examples](./examples) directory.

0 comments on commit a705945

Please sign in to comment.