Skip to content

Commit

Permalink
Add make publish to allow easy docker publishing
Browse files Browse the repository at this point in the history
By setting `docker_prefix` in `hack/config.sh` a private repository can
be selected. Default is "kubevirt".

By setting `docker_tag` a release tag can be specified. Default is
"latest".

Change-Id: Ie39ab72140142784452610f96e4f9e7184c3a464
Signed-off-by: Roman Mohr <[email protected]>
  • Loading branch information
rmohr committed Oct 17, 2016
1 parent 12b51d8 commit 32ddbd0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ sync:
docker: build
./hack/build-docker.sh build ${WHAT}

publish: docker
./hack/build-docker.sh push ${WHAT}

contrib:
./hack/build-contrib.sh

.PHONY: build fmt test clean distclean sync docker contrib vet
.PHONY: build fmt test clean distclean sync docker contrib vet publish
6 changes: 4 additions & 2 deletions contrib/manifest/virt-controller.yaml.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,24 @@ metadata:
spec:
containers:
- name: virt-controller
image: {{ docker_prefix }}/virt-controller
image: {{ docker_prefix }}/virt-controller:{{ docker_tag }}
imagePullPolicy: IfNotPresent
command:
- "/virt-controller"
- "--api-server"
- "127.0.0.1:8001"
- "--docker-registry"
- "{{ docker_prefix }}"
- "--launcher-image"
- "virt-launcher:{{ docker_tag }}"
- "--port"
- "8182"
ports:
- containerPort: 8182
name: "virt-controller"
protocol: "TCP"
- name: kubectl
image: {{ docker_prefix }}/virt-controller
image: {{ docker_prefix }}/virt-controller:{{ docker_tag }}
imagePullPolicy: IfNotPresent
command:
- "kubectl"
Expand Down
6 changes: 5 additions & 1 deletion hack/build-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,9 @@ else
fi

for arg in $args; do
(cd $arg; docker $target -t ${docker_prefix}/$(basename $arg) .)
if [ "${target}" = "build" ]; then
(cd $arg; docker $target -t ${docker_prefix}/$(basename $arg):${docker_tag} .)
elif [ "${target}" = "push" ]; then
(cd $arg; docker $target ${docker_prefix}/$(basename $arg):${docker_tag})
fi
done
1 change: 1 addition & 0 deletions hack/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

binaries="cmd/virt-controller cmd/virt-launcher"
docker_prefix=kubevirt
docker_tag=latest
manifest_templates="`ls contrib/manifest/*.in`"

0 comments on commit 32ddbd0

Please sign in to comment.