-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
77 lines (59 loc) · 1.82 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# Onur is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Onur is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Onur. If not, see <https://www.gnu.org/licenses/>.
# DEPS: fzf podman bash:5.5
.DEFAULT_GOAL := test
RUNNER ?= podman
NAME := onur
VERSION := $(shell gawk -F '"' '/version/ { print $$2; exit}' Cargo.toml)
CONTAINER_IMAGE := registry.gitlab.com/${USER}/${NAME}-rust:${VERSION}
# ================================= TASKS
.PHONY: local.build
local.build:
cargo build --release --verbose
.PHONY: local.test
local.test:
cargo test --verbose
.PHONY: local.deps
local.deps:
cargo build
.PHONY: local.fmt
local.fmt:
cargo fmt
.PHONY: local.lint
local.lint:
cargo clippy
.PHONY: local.pub
local.pub:
cargo publish
.PHONY: local.install
local.install: build
cp ./target/release/onur ${HOME}/.local/bin/
# ================================= CONTAINER
.PHONY: image.build
image.build:
${RUNNER} build --file ./Containerfile --tag ${CONTAINER_IMAGE} --env ONUR_VERSION=${VERSION}
.PHONY: image.repl
image.repl:
${RUNNER} run --rm -it \
--volume ${PWD}:/app:Z \
--workdir /home/easbarba/app \
${CONTAINER_IMAGE} bash
.PHONY: image.publish
image.publish:
${RUNNER} push ${CONTAINER_IMAGE}
.PHONY: image.commands
image.commands:
${RUNNER} run --rm -it \
--volume ${PWD}:/app:Z \
--workdir /home/easbarba/app \
${CONTAINER_IMAGE} bash -c "$(shell cat ./container-commands | fzf)"