-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Decoupled zot registry from satellite
Added makefile to build and run zot and zli depending on host's OS and architecture (MacOS/Linux and ARM/Intel) Added source code for zot/zli as tar.gz Removed double execution of satellite in main.go Removed launch of zot in satellite.go
- Loading branch information
1 parent
06ccca6
commit 70e2ed7
Showing
6 changed files
with
83 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
HARBOR_USERNAME=admin | ||
HARBOR_PASSWORD=Harbor12345 | ||
HARBOR_PASSWORD=Harbor12345 | ||
ZOT_URL="127.0.0.1:8585/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
SOURCE_FILE=zot-2.0.4.tar.gz | ||
EXTRACTED_DIR=zot-2.0.4 | ||
BIN_DIR=../bin | ||
BIN=bin | ||
ZOT_BINARY=zot-darwin-arm64 | ||
ZLI_BINARY=zli-darwin-arm64 | ||
|
||
# Build calls the appropriate build function based on the OS | ||
build: | ||
@OS=$(shell uname | tr '[:upper:]' '[:lower:]'); \ | ||
ARCH=$(shell uname -m); \ | ||
if [ "$$OS" = "darwin" ] && [ "$$ARCH" = "arm64" ]; then \ | ||
echo "Building for macOS ARM..."; \ | ||
$(eval ZOT_BINARY := zot-darwin-arm64) \ | ||
$(MAKE) _build; \ | ||
elif [ "$$OS" = "darwin" ] && [ "$$ARCH" = "x86_64" ]; then \ | ||
echo "Building for macOS Intel..."; \ | ||
$(eval ZOT_BINARY := zot-darwin-amd64) \ | ||
$(MAKE) build-macos-amd64; \ | ||
elif [ "$$OS" = "linux" ] && ["$$ARCH" = "arm64" ] ; then \ | ||
echo "Building for Linux ARM..."; \ | ||
$(eval ZOT_BINARY := zot-linux-arm64) \ | ||
$(MAKE) build-linux; \ | ||
elif [ "$$OS" = "linux" ] && ["$$ARCH" = "x86_64" ] ; then \ | ||
echo "Building for Linux Intel..."; \ | ||
$(eval ZOT_BINARY := zot-linux-amd64) \ | ||
$(MAKE) build-linux; \ | ||
else \ | ||
echo "Unsupported OS."; \ | ||
exit 1; \ | ||
fi | ||
|
||
|
||
_build: | ||
@test -d $(BIN) || mkdir -p $(BIN) | ||
@if [ ! -f $(BIN)/$(ZOT_BINARY) ]; then \ | ||
tar -xzvf $(SOURCE_FILE); \ | ||
cd $(EXTRACTED_DIR) && make binary ; \ | ||
cp $(BIN)/$(ZOT_BINARY) ../$(BIN)/$(ZOT_BINARY); \ | ||
cp ../config.json ../$(BIN)/config.json; \ | ||
rm -rf ../$(EXTRACTED_DIR); \ | ||
echo "---------------------------------------------------------------------------" ; \ | ||
else \ | ||
echo "$(ZOT_BINARY) already exists, skipping build."; \ | ||
echo "---------------------------------------------------------------------------" ; \ | ||
fi | ||
|
||
@if [ ! -f $(BIN)/$(ZLI_BINARY) ]; then \ | ||
tar -xzvf $(SOURCE_FILE); \ | ||
cd $(EXTRACTED_DIR) && make cli; \ | ||
cp $(BIN)/$(ZLI_BINARY) ../$(BIN)/$(ZLI_BINARY); \ | ||
cp ../config.json ../$(BIN)/config.json; \ | ||
rm -rf ../$(EXTRACTED_DIR); \ | ||
else \ | ||
echo "$(ZLI_BINARY) already exists, skipping build."; \ | ||
fi | ||
|
||
run: | ||
@OS=$(shell uname | tr '[:upper:]' '[:lower:]'); \ | ||
ARCH=$(shell uname -m); \ | ||
if [ "$$OS" = "darwin" ] && [ "$$ARCH" = "arm64" ]; then \ | ||
echo "Running for MacOS ARM..."; \ | ||
$(BIN)/zot-darwin-arm64 serve ./config.json; \ | ||
elif [ "$$OS" = "darwin" ] && [ "$$ARCH" = "x86_64" ]; then \ | ||
echo "Running for MacOS Intel..."; \ | ||
$(BIN)/zot-darwin-amd64 serve ./config.json; \ | ||
elif [ "$$OS" = "linux" ] && [ "$$ARCH" = "arm64" ]; then \ | ||
echo "Running for Linux ARM..."; \ | ||
$(BIN)/zot-linux-arm64 serve ./config.json; \ | ||
elif [ "$$OS" = "linux" ] && [ "$$ARCH" = "x86_64" ]; then \ | ||
echo "Running for Linux Intel..."; \ | ||
$(BIN)/zot-linux-amd64 serve ./config.json; \ | ||
else \ | ||
echo "Unsupported OS or architecture."; \ | ||
exit 1; \ | ||
fi | ||
|
||
clean: | ||
rm -rf $(EXTRACTED_DIR) $(BIN) | ||
|
||
|
Binary file not shown.