blob: 4ec89b03d0a9de8ab53fca07ba23fb265fd6bc24 [file] [log] [blame]
Giorgi Lekveishvili0ba5e402024-03-20 15:56:30 +04001repo_name ?= giolekva
2podman ?= docker
3ifeq ($(podman), podman)
4manifest_dest=docker://docker.io/$(repo_name)/pcloud-installer:latest
5endif
6
7clean:
8 rm -f server server_*
9
10build: clean
Giorgi Lekveishvilia09fad72024-03-21 15:24:35 +040011 /usr/local/go/bin/go build -o server *.go
Giorgi Lekveishvili0ba5e402024-03-20 15:56:30 +040012
13build_arm64: export CGO_ENABLED=0
14build_arm64: export GO111MODULE=on
15build_arm64: export GOOS=linux
16build_arm64: export GOARCH=arm64
17build_arm64:
Giorgi Lekveishvilia09fad72024-03-21 15:24:35 +040018 /usr/local/go/bin/go build -o server_arm64 *.go
Giorgi Lekveishvili0ba5e402024-03-20 15:56:30 +040019
20build_amd64: export CGO_ENABLED=0
21build_amd64: export GO111MODULE=on
22build_amd64: export GOOS=linux
23build_amd64: export GOARCH=amd64
24build_amd64:
Giorgi Lekveishvilia09fad72024-03-21 15:24:35 +040025 /usr/local/go/bin/go build -o server_amd64 *.go
Giorgi Lekveishvili0ba5e402024-03-20 15:56:30 +040026
27push_arm64: clean build_arm64
28 $(podman) build --platform linux/arm64 --tag=$(repo_name)/auth-proxy:arm64 .
29 $(podman) push $(repo_name)/auth-proxy:arm64
30
31push_amd64: clean build_amd64
32 $(podman) build --platform linux/amd64 --tag=$(repo_name)/auth-proxy:amd64 .
33 $(podman) push $(repo_name)/auth-proxy:amd64
34
35
36push: push_arm64 push_amd64
37 $(podman) manifest create $(repo_name)/auth-proxy:latest $(repo_name)/auth-proxy:arm64 $(repo_name)/auth-proxy:amd64
38 $(podman) manifest push $(repo_name)/auth-proxy:latest $(manifest_dest)
39 $(podman) manifest rm $(repo_name)/auth-proxy:latest