Skip to content

Commit fbc5fa1

Browse files
committed
purging color and exit status prettiness in favor of communication
1 parent 0496787 commit fbc5fa1

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

Makefile

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
OPERATOR_NAME = example-operator
33
OPERATOR_CATALOG_DIR = catalog/$(OPERATOR_NAME)
44
OPERATOR_CATALOG_CONTRIBUTION = $(OPERATOR_CATALOG_DIR)/catalog.yaml
5-
STEP_PASS = \033[0;32m
6-
STEP_FAIL = \033[0;31m
7-
NO_COLOR = \033[0m
85
YQ = bin/yq
96

107

@@ -65,39 +62,32 @@ semver: bin/opm semver-veneer.yaml clean
6562
# all FBC must pass opm validation in order to be able to be used in a catalog
6663
.PHONY: sanity
6764
sanity: bin/opm $(OPERATOR_CATALOG_CONTRIBUTION) preverify
68-
@bin/opm validate catalog; \
69-
if [ $$? -ne 0 ] ; then \
70-
echo "opm validate catalog $(STEP_FAIL)[FAIL]$(NO_COLOR)\n"; \
71-
else \
72-
echo "opm validate catalog $(STEP_PASS)[PASS]$(NO_COLOR)\n"; \
73-
fi
65+
bin/opm validate catalog
66+
7467

7568
# preverify target ensures that the operator name is consistent between the destination directory and the generated catalog
7669
# since the veneer will be modified outside the build process but needs to be consistent with the directory name
7770
.PHONY: preverify
7871
preverify: $(YQ) $(OPERATOR_CATALOG_CONTRIBUTION)
79-
@./sanity.sh -q -n $(OPERATOR_NAME) -f $(OPERATOR_CATALOG_CONTRIBUTION); \
80-
if [ $$? -ne 0 ] ; then \
81-
echo "operator name MISMATCH in catalog contribution and Makefile $(STEP_FAIL)[FAIL]$(NO_COLOR)"; \
82-
false; \
83-
else \
84-
echo "operator name matches in catalog contribution and Makefile $(STEP_PASS)[PASS]$(NO_COLOR)"; \
85-
fi
72+
./sanity.sh -n $(OPERATOR_NAME) -f $(OPERATOR_CATALOG_CONTRIBUTION)
8673

8774

8875
.PHONY: clean
8976
clean:
9077
rm -rf catalog
9178

79+
9280
OS=$(shell uname -s | tr '[:upper:]' '[:lower:]')
9381
ARCH=$(shell uname -m | sed 's/x86_64/amd64/')
9482
OPM_VERSION ?= v1.26.1
9583
bin/opm:
9684
mkdir -p bin
9785
curl -sLO https://github.com/operator-framework/operator-registry/releases/download/$(OPM_VERSION)/$(OS)-$(ARCH)-opm && chmod +x $(OS)-$(ARCH)-opm && mv $(OS)-$(ARCH)-opm bin/opm
9886

87+
9988
YQ_VERSION=v4.22.1
10089
YQ_BINARY=yq_$(OS)_$(ARCH)
10190
$(YQ):
10291
if [ ! -e bin ] ; then mkdir -p bin; fi
10392
wget https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/${YQ_BINARY} -O bin/${YQ_BINARY} && mv -f bin/${YQ_BINARY} $(YQ) && chmod +x $(YQ)
93+

0 commit comments

Comments
 (0)