Skip to content

Commit

Permalink
asd
Browse files Browse the repository at this point in the history
  • Loading branch information
dbarrosop committed Aug 16, 2023
1 parent 9ae8f85 commit 7c77099
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 18 deletions.
19 changes: 17 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,27 @@ build-docker-image: ## Build docker container for native architecture
./build/nix-docker-image.sh
docker tag hasura-storage:$(VERSION) hasura-storage:dev

.PHONY: build-docker-image-clamav
build-docker-image-clamav: ## Build docker container for clamav
.PHONY: build-docker-image-clamav-dev
build-docker-image-clamav-dev: ## Build dev docker container for clamav
@echo $(VERSION) > VERSION
./build/nix-docker-image.sh clamavDockerImage
docker tag clamav:$(VERSION) clamav:dev

.PHONY: build-docker-image-clamav
build-docker-image-clamav: ## Build docker container for clamav
@echo $(VERSION) > VERSION
./build/nix-docker-image.sh clamavDockerImage aarch64-linux
docker tag clamav:$(VERSION) nhost/clamav:$(VERSION)-aarch64
./build/nix-docker-image.sh clamavDockerImage x86_64-linux
docker tag clamav:$(VERSION) nhost/clamav:$(VERSION)-x86_64
docker push nhost/clamav:$(VERSION)-aarch64
docker push nhost/clamav:$(VERSION)-x86_64
docker manifest create \
nhost/clamav:$(VERSION) \
--amend nhost/clamav:$(VERSION)-aarch64 \
--amend nhost/clamav:$(VERSION)-x86_64
docker manifest push nhost/clamav:$(VERSION)


.PHONY: dev-env-up-short
dev-env-up-short: ## Starts development environment without hasura-storage
Expand Down
2 changes: 1 addition & 1 deletion build/dev/docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ services:

clamd:
container_name: hasura-storage-clamd
image: clamav:0.0.0-dev
image: nhost/clamav:0.0.1
restart: unless-stopped
ports:
- '3310:3310'
21 changes: 12 additions & 9 deletions build/nix-docker-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,19 @@
which nix > /dev/null

IMAGE=${1:-"dockerImage"}
SYSTEM=${2:-""}

if [[ $NIX_BUILD_NATIVE -eq 1 ]]; then
case $(uname -m) in
"arm64")
SYSTEM="aarch64-linux"
;;
*)
SYSTEM="x86_64-linux"
;;
esac
if [[ -z $SYSTEM ]]; then
case $(uname -m) in
"arm64")
SYSTEM="aarch64-linux"
;;
*)
SYSTEM="x86_64-linux"
;;
esac
fi

nix build .\#packages.${SYSTEM}.$IMAGE --print-build-logs && docker load < result
exit $?
Expand All @@ -30,4 +33,4 @@ docker run --rm -it \
-w /build \
--entrypoint sh \
dbarroso/nix:2.6.0 \
-c "nix build .\\#$IMAGE --print-build-logs && docker load < result"
-c "nix build .\\#packages.$IMAGE --print-build-logs && docker load < result"
6 changes: 0 additions & 6 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,6 @@

};

apps = flake-utils.lib.flattenTree {
hasuraStorage = self.packages.${system}.hasuraStorage;
golangci-lint = pkgs.golangci-lint;
default = self.packages.${system}.hasuraStorage;
};

}


Expand Down

0 comments on commit 7c77099

Please sign in to comment.