Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
alinetskyi committed Jul 2, 2024
1 parent 335219e commit 2d38c6f
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ jobs:

- name: Build binary
run: |
make build
make build/arm64
make build/amd64
- name: Login to DockerHub
uses: docker/login-action@v2
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG TARGETARCH
WORKDIR /bdjuno
RUN apk update
RUN apk add postgresql
COPY ./build/bdjuno/bdjuno /usr/bin/bdjuno
COPY ./bin/.cache/bdjuno/docker.$TARGETOS.$TARGETARCH/bin/bdjuno /usr/bin/bdjuno
COPY database/schema /var/lib/postgresql/schema
RUN chmod a+rx /var/lib/postgresql && \
chmod a+rx /var/lib/postgresql/schema
Expand Down
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ test:
build:
$(BUILDER) build

.PHONY: build/arm64
build/arm64:
$(BUILDER) build/arm64

.PHONY: build/amd64
build/amd64:
$(BUILDER) build/amd64

.PHONY: images
images:
$(BUILDER) images
10 changes: 9 additions & 1 deletion build/bdjuno/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,19 @@ const (
binaryPath = "bin/" + binaryName
)

// Build builds faucet in docker.
// Build builds bdjuno in docker.
func Build(ctx context.Context, deps types.DepsFunc) error {
return buildBDJuno(ctx, deps, tools.TargetPlatformLinuxLocalArchInDocker)
}

func BuildAMD64(ctx context.Context, deps types.DepsFunc) error {
return buildBDJuno(ctx, deps, tools.TargetPlatformDarwinAMD64InDocker)
}

func BuildARM64(ctx context.Context, deps types.DepsFunc) error {
return buildBDJuno(ctx, deps, tools.TargetPlatformDarwinARM64InDocker)
}

func buildBDJuno(ctx context.Context, deps types.DepsFunc, targetPlatform tools.TargetPlatform) error {
return golang.Build(ctx, deps, golang.BinaryBuildConfig{
TargetPlatform: targetPlatform,
Expand Down
8 changes: 5 additions & 3 deletions build/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ import (

// Commands is a definition of commands available in build system.
var Commands = map[string]types.Command{
"build/me": {Fn: crust.BuildBuilder, Description: "Builds the builder"},
"build/znet": {Fn: crust.BuildZNet, Description: "Builds znet binary"},
"build": {Fn: bdjuno.Build, Description: "Builds bdjuno binary"},
"build/me": {Fn: crust.BuildBuilder, Description: "Builds the builder"},
"build/znet": {Fn: crust.BuildZNet, Description: "Builds znet binary"},
"build": {Fn: bdjuno.Build, Description: "Builds bdjuno binary"},
"build/amd64": {Fn: bdjuno.BuildAMD64, Description: "Builds bdjuno binary for arm64 platform"},
"build/arm64": {Fn: bdjuno.BuildARM64, Description: "Builds bdjuno binary for amd64 platform"},
"images": {Fn: func(ctx context.Context, deps types.DepsFunc) error {
deps(bdjuno.BuildDockerImage, hasura.BuildDockerImage)
return nil
Expand Down

0 comments on commit 2d38c6f

Please sign in to comment.