update docker run to use --rm removing the container
This commit is contained in:
parent
cca1ec3e62
commit
ed1a4522f0
1 changed files with 15 additions and 6 deletions
21
Makefile
21
Makefile
|
|
@ -3,23 +3,32 @@ PUBDIR=tee.schottelius.org:/home/services/www/nico/www.nico.schottelius.org/www/
|
|||
BROWSER=conkeror
|
||||
IKIWIKI=ikiwiki
|
||||
|
||||
VERSION=$(shell git describe --always)
|
||||
VERSION=$(shell git describe --always --dirty)
|
||||
ARGOCD_HOME=$$HOME/vcs/k8s-config/cluster/p10/apps/templates/
|
||||
ARGOCD_YAML=staticweb-nico.yaml
|
||||
ARGOCD_APP=$(ARGOCD_HOME)/$(ARGOCD_YAML)
|
||||
|
||||
IMAGE_NAME=harbor.k8s.ungleich.ch/nico/www.nico.schottelius.org
|
||||
CONTAINER_NAME=$(IMAGE_NAME):$(VERSION)
|
||||
|
||||
all: argocd
|
||||
|
||||
gitpush:
|
||||
checkclean:
|
||||
echo $(VERSION) | grep -q dirty && exit 1
|
||||
|
||||
push-git:
|
||||
git push --mirror
|
||||
|
||||
container: gitpush
|
||||
docker build -t harbor.k8s.ungleich.ch/nico/www.nico.schottelius.org:$(VERSION) .
|
||||
docker push harbor.k8s.ungleich.ch/nico/www.nico.schottelius.org:$(VERSION)
|
||||
build-container:
|
||||
docker build -t $(CONTAINER_NAME) .
|
||||
|
||||
argocd: container
|
||||
push-container: build-container
|
||||
docker push $(CONTAINER_NAME)
|
||||
|
||||
run: build-container
|
||||
docker run --rm -p 8000:80 $(CONTAINER_NAME)
|
||||
|
||||
argocd: checkclean push-container push-git
|
||||
sed -i "s,$(IMAGE_NAME):.*,$(IMAGE_NAME):$(VERSION)," $(ARGOCD_APP)
|
||||
cd $(ARGOCD_HOME) && git add $(ARGOCD_YAML) && git commit -m "[staticweb] Update www.nico.schottelius.org to $(VERSION)" $(ARGOCD_YAML) && git push
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue