File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -74,11 +74,17 @@ VERSION_ENVTEST = release-0.19
74
74
# ####################################
75
75
OS =$(shell go env GOOS)
76
76
ARCH =$(shell go env GOARCH)
77
+
77
78
ifeq ($(OS ) ,darwin)
78
79
DATE_BIN = gdate
80
+ FIND_BIN = gfind
81
+ PASTE_BIN = gpaste
79
82
else
80
83
DATE_BIN = date
84
+ FIND_BIN = find
85
+ PASTE_BIN = paste
81
86
endif
87
+
82
88
BUILD_DATE = $(strip $(shell $(DATE_BIN ) +% FT% T) )
83
89
BUILD_TIMESTAMP = $(strip $(shell $(DATE_BIN ) -d "$(BUILD_DATE ) " +% s) )
84
90
COMMIT_HASH = $(strip $(shell git rev-parse --short HEAD) )
@@ -154,7 +160,7 @@ generate/chart: $(BIN_KUSTOMIZE) ## Generate a Helm Chart in a target folder. us
154
160
@$(call verify-essential-tool,$(REQ_BIN_YQ ) ,REQ_BIN_YQ)
155
161
@$(call kustomize-setup)
156
162
./hack/generate_chart.sh --bin_yq $(REQ_BIN_YQ ) --bin_kustomize $(BIN_KUSTOMIZE ) --bin_sed $(REQ_BIN_SED ) \
157
- --chart_version $(CHART_VERSION ) --target_folder $(CHART_TARGET )
163
+ --bin_find $( FIND_BIN ) --bin_paste $( PASTE_BIN ) -- chart_version $(CHART_VERSION ) --target_folder $(CHART_TARGET )
158
164
@$(call kustomize-cleanup)
159
165
160
166
# ###############################################
Original file line number Diff line number Diff line change @@ -26,6 +26,8 @@ transformers_folder=${transformers_folder:-hack/chart_transformers}
26
26
bin_yq=${bin_yq:- yq}
27
27
bin_kustomize=${bin_kustomize:- kustomize}
28
28
bin_sed=${bin_sed:- sed}
29
+ bin_find=${bin_find:- find}
30
+ bin_paste=${bin_paste:- paste}
29
31
app_version=${app_version:- $(<VERSION)}
30
32
31
33
# required named parameters
@@ -56,12 +58,12 @@ inject_helm_labels(){
56
58
}
57
59
58
60
# iterate over all base templates and route each to its transformer
59
- transformers=$( find " $transformers_folder " /* .sh -maxdepth 1 -type f -printf ' %f\n' )
61
+ transformers=$( $bin_find " $transformers_folder " /* .sh -maxdepth 1 -type f -printf ' %f\n' )
60
62
for temp_template in " $temp_folder " /templates/* .yml; do
61
63
kind=$( $bin_yq ' .kind' " $temp_template " )
62
64
apiVersion=$( $bin_yq ' .apiVersion' " $temp_template " )
63
65
if [[ " $apiVersion " = * " /" * ]]; then
64
- ver_dot_group=$( tr ' /' $' \n ' <<< " $apiVersion" | tac | paste -s -d ' .' )
66
+ ver_dot_group=$( tr ' /' $' \n ' <<< " $apiVersion" | tac | $bin_paste -s -d ' .' )
65
67
transformer_name=" $kind " ." $ver_dot_group " .sh
66
68
# i.e. Deployment transformer_name will be Deployment.v1.apps.sh
67
69
else
You can’t perform that action at this time.
0 commit comments