-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·169 lines (129 loc) · 5.3 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
.PHONY: all link clean zsh bash build prod_build profile run push pull update/go update/ngt
include Makefile.d/version.mk
ROOTDIR = $(eval ROOTDIR := $(or $(shell git rev-parse --show-toplevel), $(PWD)))$(ROOTDIR)
all: prod_build login push profile git_push
run:
source ./alias && devrun
link:
mkdir -p ${HOME}/.config/nvim/colors
mkdir -p ${HOME}/.config/nvim/syntax
ln -sfv $(dir $(abspath $(lastword $(MAKEFILE_LIST))))init.vim $(HOME)/.config/nvim/init.vim
# ln -sfv $(dir $(abspath $(lastword $(MAKEFILE_LIST))))starship.toml $(HOME)/.config/starship.toml
# ln -sfv $(dir $(abspath $(lastword $(MAKEFILE_LIST))))efm-lsp-conf.yaml $(HOME)/.config/nvim/efm-lsp-conf.yaml
ln -sfv $(dir $(abspath $(lastword $(MAKEFILE_LIST))))coc-settings.json $(HOME)/.config/nvim/coc-settings.json
ln -sfv $(dir $(abspath $(lastword $(MAKEFILE_LIST))))monokai.vim $(HOME)/.config/nvim/colors/monokai.vim
# ln -sfv $(dir $(abspath $(lastword $(MAKEFILE_LIST))))go.vim $(HOME)/.config/nvim/syntax/go.vim
ln -sfv $(dir $(abspath $(lastword $(MAKEFILE_LIST))))zshrc $(HOME)/.zshrc
ln -sfv $(dir $(abspath $(lastword $(MAKEFILE_LIST))))editorconfig $(HOME)/.editorconfig
ln -sfv $(dir $(abspath $(lastword $(MAKEFILE_LIST))))alias $(HOME)/.aliases
ln -sfv $(dir $(abspath $(lastword $(MAKEFILE_LIST))))gitconfig $(HOME)/.gitconfig
ln -sfv $(dir $(abspath $(lastword $(MAKEFILE_LIST))))gitattributes $(HOME)/.gitattributes
ln -sfv $(dir $(abspath $(lastword $(MAKEFILE_LIST))))gitignore $(HOME)/.gitignore
ln -sfv $(dir $(abspath $(lastword $(MAKEFILE_LIST))))tmux.conf $(HOME)/.tmux.conf
ln -sfv $(dir $(abspath $(lastword $(MAKEFILE_LIST))))tmux-kube $(HOME)/.tmux-kube
# ln -sfv $(dir $(abspath $(lastword $(MAKEFILE_LIST))))tmux.new-session $(HOME)/.tmux.new-session
clean:
# sed -e "/\[\ \-f\ \$HOME\/\.aliases\ \]\ \&\&\ source\ \$HOME\/\.aliases/d" ~/.zshrc
unlink $(HOME)/.config/nvim/init.vim
# unlink $(HOME)/.config/starship.toml
# unlink $(HOME)/.config/nvim/efm-lsp-conf.yaml
unlink $(HOME)/.config/nvim/coc-settings.json
unlink $(HOME)/.config/nvim/colors/monokai.vim
# unlink $(HOME)/.config/nvim/syntax/go.vim
unlink $(HOME)/.zshrc
unlink $(HOME)/.editorconfig
unlink $(HOME)/.aliases
unlink $(HOME)/.gitconfig
unlink $(HOME)/.gitattributes
unlink $(HOME)/.gitignore
unlink $(HOME)/.tmux.conf
unlink $(HOME)/.tmux-kube
# unlink $(HOME)/.tmux.new-session
zsh: link
[ -f $(HOME)/.zshrc ] && echo "[ -f $$HOME/.aliases ] && source $$HOME/.aliases" >> $(HOME)/.zshrc
bash: link
[ -f $(HOME)/.bashrc ] && echo "[ -f $$HOME/.aliases ] && source $$HOME/.aliases" >> $(HOME)/.bashrc
build:
docker build -t vankichi/dev:latest .
docker_build:
docker build ${ARGS} --squash -t ${IMAGE_NAME}:latest -f ${DOCKERFILE} .
# docker buildx build --squash -t ${IMAGE_NAME}:latest -f ${DOCKERFILE} .
docker_push:
docker push ${IMAGE_NAME}:latest
prod_build:
@make DOCKERFILE="./Dockerfile" IMAGE_NAME="vankichi/dev" docker_build
build_go:
@make DOCKERFILE="./dockers/go.Dockerfile" IMAGE_NAME="vankichi/go" ARGS="--build-arg=GO_VERSION=$(shell cat ./versions/GO_VERSION)" docker_build
build_rust:
@make DOCKERFILE="./dockers/rust.Dockerfile" IMAGE_NAME="vankichi/rust" docker_build
build_nim:
@make DOCKERFILE="./dockers/nim.Dockerfile" IMAGE_NAME="vankichi/nim" docker_build
build_dart:
@make DOCKERFILE="./dockers/dart.Dockerfile" IMAGE_NAME="vankichi/dart" ARGS="--build-arg=FLUTTER_VERSION=$(shell cat ./versions/FLUTTER_VERSION)" docker_build
build_docker:
@make DOCKERFILE="./dockers/docker.Dockerfile" IMAGE_NAME="vankichi/docker" docker_build
build_base:
@make DOCKERFILE="./dockers/base.Dockerfile" IMAGE_NAME="vankichi/dev-base" docker_build
build_env:
@make DOCKERFILE="./dockers/env.Dockerfile" IMAGE_NAME="vankichi/env" ARGS="--build-arg=NGT_VERSION=$(shell cat ./versions/NGT_VERSION) --build-arg=TENSORFLOW_C_VERSION=$(shell cat ./versions/TENSORFLOW_C_VERSION)" docker_build
build_gcloud:
@make DOCKERFILE="./dockers/gcloud.Dockerfile" IMAGE_NAME="vankichi/gcloud" docker_build
build_k8s:
@make DOCKERFILE="./dockers/k8s.Dockerfile" IMAGE_NAME="vankichi/kube" docker_build
build_glibc:
@make DOCKERFILE="./dockers/glibc.Dockerfile" IMAGE_NAME="vankichi/glibc" docker_build
prod_push:
@make IMAGE_NAME="vankichi/dev" docker_push
push_go:
@make IMAGE_NAME="vankichi/go" docker_push
push_rust:
@make IMAGE_NAME="vankichi/rust" docker_push
push_nim:
@make IMAGE_NAME="vankichi/nim" docker_push
push_dart:
@make IMAGE_NAME="vankichi/dart" docker_push
push_docker:
@make IMAGE_NAME="vankichi/docker" docker_push
push_base:
@make IMAGE_NAME="vankichi/dev-base" docker_push
push_env:
@make IMAGE_NAME="vankichi/env" docker_push
push_gcloud:
@make IMAGE_NAME="vankichi/gcloud" docker_push
push_k8s:
@make IMAGE_NAME="vankichi/kube" docker_push
push_glibc:
@make IMAGE_NAME="vankichi/glibc" docker_push
build_all: \
build_base \
build_env \
build_docker \
build_go \
build_k8s \
build_rust \
build_dart \
prod_build
echo "done"
push_all: \
push_base \
push_env \
push_docker \
push_go \
push_k8s \
push_rust \
push_dart \
prod_push
echo "done"
profile:
rm -f analyze.txt
type dlayer >/dev/null 2>&1 && docker save vankichi/dev:latest | dlayer >> analyze.txt
login:
docker login -u vankichi
push:
docker push vankichi/dev:latest
pull:
docker pull vankichi/dev:latest
git_push:
git add -A
git commit -m fix
git push