Skip to content

Commit 6e0f4d6

Browse files
committed
build: Cleaned up the Makefile
1 parent a7f30a0 commit 6e0f4d6

File tree

1 file changed

+5
-31
lines changed

1 file changed

+5
-31
lines changed

Makefile

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
11
# SPDX-FileCopyrightText: 2023 Sayantan Santra <sayantan.santra689@gmail.com>
22
# SPDX-License-Identifier: MIT
33

4-
# .env file has the variables $podman_USERNAME and $PASSWORD defined
54
include .env
65

7-
.PHONY: clean test setup build-dev podman-local podman-stop podman-test build-release tag audit
6+
.PHONY: clean test setup build podman-build podman-stop podman-test build-release tag audit
87

98
setup:
10-
# cargo install cross
119
rustup target add x86_64-unknown-linux-musl
12-
# podman buildx create --use --platform=linux/arm64,linux/amd64,linux/arm/v7 --name multi-platform-builder
1310
podman buildx inspect --bootstrap
1411

15-
build-dev:
12+
build:
1613
cargo build --release --locked --manifest-path=actix/Cargo.toml --target x86_64-unknown-linux-musl
1714

18-
podman-local: build-dev
15+
podman-build: build
1916
podman build --tag chhoto-url --build-arg TARGETARCH=amd64 -f Dockerfile.alpine .
2017

2118
podman-stop:
@@ -28,18 +25,10 @@ test: audit
2825
audit:
2926
cargo audit --file actix/Cargo.lock
3027

31-
podman-test: podman-local podman-stop test
28+
podman-test: test podman-build podman-stop
3229
podman run -t -p ${port}:${port} --name chhoto-url --env-file ./.env -v "${db_dir}:/data" -d chhoto-url
3330
podman logs chhoto-url -f
3431

35-
# podman-dev: test build-dev
36-
# podman build --push --tag ghcr.io/${github_username}/chhoto-url:dev --build-arg TARGETARCH=amd64 -f Dockerfile.alpine .
37-
38-
# build-release: test
39-
# cross build --release --locked --manifest-path=actix/Cargo.toml --target aarch64-unknown-linux-musl
40-
# cross build --release --locked --manifest-path=actix/Cargo.toml --target armv7-unknown-linux-musleabihf
41-
# cross build --release --locked --manifest-path=actix/Cargo.toml --target x86_64-unknown-linux-musl
42-
4332
conf_tag := $(shell cat actix/Cargo.toml | sed -rn 's/^version = "(.+)"$$/\1/p')
4433
last_tag := $(shell git tag -l | tail -1)
4534
bumped := $(shell git log -1 --pretty=%B | grep "build: Bumped version to " | wc -l)
@@ -56,21 +45,6 @@ else
5645
false;
5746
endif
5847

59-
# v_patch := $(shell cat actix/Cargo.toml | sed -rn 's/^version = "(.+)"$$/\1/p')
60-
# v_minor := $(shell cat actix/Cargo.toml | sed -rn 's/^version = "(.+)\..+"$$/\1/p')
61-
# v_major := $(shell cat actix/Cargo.toml | sed -rn 's/^version = "(.+)\..+\..+"$$/\1/p')
62-
# podman-release: tag build-release
63-
# minify -rsi resources/
64-
# podman buildx build --push --tag ${podman_username}/chhoto-url:${v_major} --tag ${podman_username}/chhoto-url:${v_minor} \
65-
# --tag ${podman_username}/chhoto-url:${v_patch} --tag ${podman_username}/chhoto-url:latest \
66-
# --platform linux/amd64,linux/arm64,linux/arm/v7 -f Dockerfile.alpine .
67-
# podman buildx build --push --tag ghcr.io/${github_username}/chhoto-url:${v_major} --tag ghcr.io/${github_username}/chhoto-url:${v_minor} \
68-
# --tag ghcr.io/${github_username}/chhoto-url:${v_patch} --tag ghcr.io/${github_username}/chhoto-url:latest \
69-
# --platform linux/amd64,linux/arm64,linux/arm/v7 -f Dockerfile.scratch .
70-
# git restore resources/
71-
72-
clean:
73-
podman ps -q --filter "name=chhoto-url" | xargs -r podman stop
74-
podman ps -aq --filter "name=chhoto-url" | xargs -r podman rm
48+
clean: podman-stop
7549
cargo clean --manifest-path=actix/Cargo.toml
7650

0 commit comments

Comments
 (0)