-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (30 loc) · 1012 Bytes
/
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
CURRENT_DIR=$(shell basename $(CURRENT_PWD))
CURRENT_PWD=$(shell pwd)
DATE:=$(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
GIT_REVISION:=$(shell git rev-parse --short HEAD)
IMAGE_REGISTRY=ghcr.io
IMAGE_NAME=imobanco/python
IMAGE_TAG=latest
IMAGE=$(IMAGE_REGISTRY)/$(IMAGE_NAME):$(IMAGE_TAG)
CONTAINERFILE=Containerfile_3.8
print-% : ; @echo $($*)
build:
podman build --file $(CONTAINERFILE) --tag $(IMAGE) --label org.opencontainers.image.created=$(DATE) --label org.opencontainers.image.revision=$(GIT_REVISION) $(args) .
pull: login.registry
podman pull $(IMAGE)
push.to.registry:
podman push $(IMAGE)
login.IMAGE_REGISTRY:
podman login $(IMAGE_REGISTRY)
logout.IMAGE_REGISTRY:
podman logout $(IMAGE_REGISTRY)
build.and.push:
make build
make login.registry.stdin
make push.to.registry
login.registry:
podman login $(IMAGE_REGISTRY)
logout.registry:
podman logout $(IMAGE_REGISTRY)
login.registry.stdin:
@echo $(PASSWORD) | podman login --username $(USERNAME) --password-stdin $(IMAGE_REGISTRY)