-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtasks.py
30 lines (23 loc) · 895 Bytes
/
tasks.py
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
"""emacs build file."""
import os
from datetime import datetime
from invoke import task
def tag(n):
"""Create tag command."""
t_str = datetime.now().strftime("%Y_%m_%d_%H_%M_%S")
return ("--tag nakkaya/" + n + ":latest " +
"--tag ghcr.io/nakkaya/" + n + ":latest " +
"--tag nakkaya/" + n + ":" + t_str + " ")
@task
def build(c, march=False):
"""Build Multi Arch CPU Image."""
os.chdir("devops/docker/")
def cmd(builder):
return "docker " + builder + " -f Dockerfile " + tag("emacs") + " "
if march:
c.run("docker build -f Dockerfile " + tag("emacs") + " .")
else:
# c.run("docker buildx build --push -f Dockerfile " + tag("emacs") +
# " --platform linux/amd64 .")
c.run("docker buildx build --push -f Dockerfile " + tag("emacs") +
" --platform linux/amd64,linux/arm64 .")