forked from hashicorp-demoapp/product-api-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
38 lines (33 loc) · 1.15 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
CONTAINER_NAME=hashicorpdemoapp/product-api
DB_CONTAINER_NAME=hashicorpdemoapp/product-api-db
CONTAINER_VERSION=v0.0.23
test_functional:
shipyard run ./blueprint
cd ./functional_tests && go test -v -run.test true ./..
shipyard destroy
build_db:
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker buildx create --name multi-db || true
docker buildx use multi-db
docker buildx inspect --bootstrap
docker buildx build --platform linux/arm64,linux/amd64 \
-t ${DB_CONTAINER_NAME}:${CONTAINER_VERSION} \
-f ./database/Dockerfile \
./database \
--push
docker buildx rm multi-db
build_linux:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ./bin/amd64/product-api
build_arm64:
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o bin/arm64/product-api
build_docker: build_linux build_arm64
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker buildx create --name multi || true
docker buildx use multi
docker buildx inspect --bootstrap
docker buildx build --platform linux/arm64,linux/amd64 \
-t ${CONTAINER_NAME}:${CONTAINER_VERSION} \
-f ./Dockerfile \
./bin \
--push
docker buildx rm multi