update makefile

This commit is contained in:
DataHearth 2022-02-20 22:18:57 +01:00
parent 3d3970b524
commit 92415b25e7
No known key found for this signature in database
GPG Key ID: E88FD356ACC5F3C4
1 changed files with 5 additions and 1 deletions

View File

@ -1,24 +1,28 @@
DOCKER_IMG := datahearth/clear-docker-images
GHCR_IMG := ghcr.io/${DOCKER_IMG}
.PHONY: initialize-linux-build
initialize-linux-build:
@brew install FiloSottile/musl-cross/musl-cross
@rustup target add x86_64-unknown-linux-musl
@echo 'add these lines to your "~/.cargo":'
@printf '\n[target.x86_64-unknown-linux-musl]\nlinker = "x86_64-linux-musl-gcc"\n'
.PHONY: build-docker
build-docker:
@docker build --tag ${DOCKER_IMG}:${VERSION} .
@docker tag ${DOCKER_IMG}:${VERSION} ${GHCR_IMG}:${VERSION}
@docker tag ${DOCKER_IMG}:${VERSION} ${DOCKER_IMG}:latest
@docker tag ${DOCKER_IMG}:latest ${GHCR_IMG}:latest
.PHONY: build-binaries
build-binaries:
@echo "Building Linux MUSL binary..."
@cargo build --release --target x86_64-unknown-linux-musl
@echo "Building MacOS darwin"
@cargo build --release --target x86_64-apple-darwin
push-docker-images:
.PHONY: push-docker-images
push-docker-images: build-docker
@docker push --all-tags ${GHCR_IMG}
@docker push --all-tags ${DOCKER_IMG}