Skip to content

Commit

Permalink
build-local to speed up local tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fmartingr committed May 13, 2024
1 parent 00b0a30 commit 9438166
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,18 @@ styles-check:
build: clean
GIN_MODE=$(GIN_MODE) goreleaser build --clean --snapshot

## Build binary for current targer
build-local:
GIN_MODE=$(GIN_MODE) goreleaser build --clean --snapshot --single-target

## Build docker image using Buildx
.PHONY: buildx
buildx:
buildx: clean
$(info: Make: Buildx)
@bash scripts/buildx.sh

## Build docker image for local development
buildx-local:
buildx-local: build-local
$(info: Make: Build image locally)
CONTAINER_BUILDX_OPTIONS="-t shiori:localdev --output type=docker" BUILDX_PLATFORMS=$(LOCAL_BUILD_PLATFORM) scripts/buildx.sh

Expand Down
9 changes: 7 additions & 2 deletions scripts/buildx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@ if [ "$CONTAINER_RUNTIME" == "docker" ]; then
fi
fi

cp -r dist/shiori_linux_arm_7 dist/shiori_linux_armv7
cp -r dist/shiori_linux_amd64_v1 dist/shiori_linux_amd64
if [ -d dist/shiori_linux_arm_7 ]; then
cp -r dist/shiori_linux_arm_7 dist/shiori_linux_armv7
fi

if [ -d dist/shiori_linux_amd64_v1 ]; then
cp -r dist/shiori_linux_amd64_v1 dist/shiori_linux_amd64
fi

$CONTAINER_RUNTIME buildx build \
-f ${CONTAINERFILE_NAME} \
Expand Down

0 comments on commit 9438166

Please sign in to comment.