-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#208. Cleaned up instructions and Makefile. Fixed zarf missing error …
…on Mac. Updated prrtrwuidid. Change build-package in Makefile to package
- Loading branch information
1 parent
17841b0
commit 86bf65b
Showing
2 changed files
with
42 additions
and
21 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,24 +1,45 @@ | ||
PACKAGE_PATH=$(shell cd $(name) && pwd) | ||
SHA_SUM=$(shell sha256sum $(name)/zarf-package-$(name).tar.zst | cut -d " " -f1) | ||
build-package: | ||
# Figure out which Zarf binary we should use based on the operating system we are on | ||
ZARF_BIN := zarf | ||
UNAME_S := $(shell uname -s) | ||
UNAME_P := $(shell uname -p) | ||
ifneq ($(UNAME_S),Linux) | ||
ifeq ($(UNAME_S),Darwin) | ||
ZARF_BIN := $(addsuffix -mac,$(ZARF_BIN)) | ||
endif | ||
ifeq ($(UNAME_P),i386) | ||
ZARF_BIN := $(addsuffix -intel,$(ZARF_BIN)) | ||
endif | ||
ifeq ($(UNAME_P),arm64) | ||
ZARF_BIN := $(addsuffix -apple,$(ZARF_BIN)) | ||
endif | ||
endif | ||
|
||
PACKAGE_PATH := $(shell cd $(name) && pwd) | ||
|
||
.PHONY: default | ||
default: help | ||
|
||
.PHONY: build-package | ||
package: | ||
ifdef name | ||
@cd $(name) && zarf package create --confirm | ||
@echo "\nCreated $(name) add the sha and path to your zarf yaml components: " | ||
@cd $(name) && $(ZARF_BIN) package create --confirm | ||
@echo "\nCreated $(name) add the sha and path to your zarf yaml components: " | ||
@echo " - name: $(name)" | ||
@echo " files:" | ||
@echo " - source: \"$(PACKAGE_PATH)/zarf-package-$(name).tar.zst\"" | ||
@echo " shasum: $(SHA_SUM)" | ||
@echo " target: /usr/local/bin/zarf-package-$(name).tar.zst" | ||
@echo " scripts:" | ||
@echo " after:" | ||
@echo " files:" | ||
@echo " - source: \"$(PACKAGE_PATH)/zarf-package-$(name).tar.zst\"" | ||
@echo " shasum: `cd $(PACKAGE_PATH) && sha256sum zarf-package-$(name).tar.zst | cut -d " " -f1`" | ||
@echo " target: \"/usr/local/bin/zarf-package-$(name).tar.zst\"" | ||
@echo " scripts:" | ||
@echo " after:" | ||
@echo " - \"./zarf package deploy /usr/local/bin/zarf-package-$(name).tar.zst --confirm\"" | ||
else | ||
@echo "Please provide a valid package name. ie: make build-package name=flux" | ||
@echo "Please provide a valid package name. ie: make package name=flux" | ||
endif | ||
|
||
|
||
.PHONY: help | ||
help: | ||
@echo "\nAvailable commands: " | ||
@echo "\n build-package Builds a tar.zst given the name of the component you wish to create." | ||
@echo " example: make build-package name=flux" | ||
@echo "\n package Builds a tar.zst given the name of the component you wish to create." | ||
@echo " example: make build-package name=flux" | ||
@echo "\n help shows this menu." | ||
@echo |
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