chore(tooling): add a Dockerfile along with some makefile container targets
This commit is contained in:
parent
7ef03c6f55
commit
7ac6c9c407
2 changed files with 45 additions and 2 deletions
26
GNUmakefile
26
GNUmakefile
|
@ -41,16 +41,38 @@ tidy: ## tidy up the code
|
|||
build: ## build the code
|
||||
CGO_ENABLED=0 go build -o $(OUTDIR)/ods ./
|
||||
|
||||
.PHONY: clean
|
||||
clean: ## clean the code
|
||||
rm -f $(OUTDIR)/ods
|
||||
|
||||
.PHONY: run
|
||||
run: ## run the code
|
||||
go run ./
|
||||
|
||||
##### Containers ###############################################################
|
||||
.PHONY: container-build
|
||||
container-build: ## build the container image
|
||||
podman build \
|
||||
-t $(CONTAINER_REGISTRY)/ods:$(CONTAINER_TAG) \
|
||||
.
|
||||
|
||||
.PHONY: container-push
|
||||
container-push: ## push the container image to the container registry
|
||||
podman push \
|
||||
$(CONTAINER_REGISTRY)/ods:$(CONTAINER_TAG)
|
||||
|
||||
.PHONY: container-run
|
||||
container-run: ## run the code inside podman
|
||||
podman run --rm -ti \
|
||||
-p 8090:8090 \
|
||||
$(CONTAINER_REGISTRY)/ods:$(CONTAINER_TAG)
|
||||
|
||||
##### Operations ###############################################################
|
||||
.PHONY: push
|
||||
push: tidy no-dirty check ## push changes to git remote
|
||||
git push git master
|
||||
|
||||
.PHONY: deploy
|
||||
deploy: check build ## deploy changes to the production server
|
||||
rsync -a --delete $(OUTDIR)/ods root@ods.adyxax.org:/srv/ods/
|
||||
deploy: ## deploy changes to the production server
|
||||
rsync $(OUTDIR)/ods root@ods.adyxax.org:/srv/ods/
|
||||
ssh root@ods.adyxax.org "systemctl restart ods"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue