Skip to content

Commit 86c2c16

Browse files
authored
fix(ci): make release rule to have prerequisites (#4141)
These changes ensure that the 'release' rule will require the other rules to be executed (splitting the commands into different rules). This way, if any some of the rules fail, the build will be aborted right away.
1 parent 6cc06b2 commit 86c2c16

File tree

1 file changed

+36
-15
lines changed

1 file changed

+36
-15
lines changed

builder/Makefile.release

Lines changed: 36 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -145,37 +145,58 @@ PUSH_DOCKER_REPO ?= aquasec/tracee
145145
.PHONY: release
146146
release: \
147147
$(OUTPUT_DIR) \
148+
build-tracee-btfhub \
149+
build-tracee-binary-static \
150+
build-tracee-binary-shared \
151+
archive \
148152
| .check_tree \
149153
.check_$(CMD_DOCKER) \
150154
.check_$(CMD_TAR) \
151155
.check_$(CMD_CHECKSUM) \
152156
.check_$(CMD_GITHUB)
153-
#
154-
# SNAPSHOT
155-
#
156157

157158
#
158-
# build official container image (CO-RE + BTFHUB).
159-
#
160-
$(MAKE) -f builder/Makefile.tracee-make alpine-prepare
161-
$(MAKE) -f builder/Makefile.tracee-make alpine-make ARG="clean"
159+
# build tracee
162160
#
161+
162+
.PHONY: alpine-prepare
163+
alpine-prepare:
164+
$(MAKE) -f builder/Makefile.tracee-make alpine-prepare && \
165+
$(MAKE) -f builder/Makefile.tracee-make alpine-prepare ARG="clean"
166+
167+
.PHONY: build-tracee-btfhub
168+
build-tracee-btfhub: alpine-prepare
169+
# build official container image (CO-RE + BTFHUB)
163170
BTFHUB=1 SNAPSHOT=$(SNAPSHOT) $(MAKE) -f builder/Makefile.tracee-container build-tracee
171+
164172
#
165173
# build binaries (tracee, tracee-ebpf, tracee-rules, rules)
166174
#
167-
$(MAKE) -f builder/Makefile.tracee-make ubuntu-prepare
168-
$(MAKE) -f builder/Makefile.tracee-make ubuntu-make ARG="clean"
175+
176+
.PHONY: ubuntu-prepare
177+
ubuntu-prepare:
178+
$(MAKE) -f builder/Makefile.tracee-make ubuntu-prepare && \
179+
$(MAKE) -f builder/Makefile.tracee-make ubuntu-make ARG="clean"
180+
181+
.PHONY: build-tracee-binary-static
182+
build-tracee-binary-static: ubuntu-prepare
169183
# static
170-
BTFHUB=0 STATIC=1 $(MAKE) -f builder/Makefile.tracee-make ubuntu-make ARG="tracee-ebpf"
171-
BTFHUB=0 STATIC=1 $(MAKE) -f builder/Makefile.tracee-make ubuntu-make ARG="tracee"
172-
$(CMD_MV) dist/tracee-ebpf dist/tracee-ebpf-static
173-
$(CMD_MV) dist/tracee dist/tracee-static
184+
BTFHUB=0 STATIC=1 $(MAKE) -f builder/Makefile.tracee-make ubuntu-make ARG="tracee-ebpf" && \
185+
BTFHUB=0 STATIC=1 $(MAKE) -f builder/Makefile.tracee-make ubuntu-make ARG="tracee" && \
186+
$(CMD_MV) dist/tracee-ebpf dist/tracee-ebpf-static
187+
$(CMD_MV) dist/tracee dist/tracee-static
188+
189+
.PHONY: build-tracee-binary-shared
190+
build-tracee-binary-shared: ubuntu-prepare
174191
# shared libs
175192
BTFHUB=0 STATIC=0 $(MAKE) -f builder/Makefile.tracee-make ubuntu-make ARG="all"
193+
194+
.PHONY: archive
195+
archive:
176196
# tarball
177-
$(CMD_TAR) -cvzf $(OUT_ARCHIVE) $(RELEASE_FILES)
178-
$(CMD_CHECKSUM) $(OUT_ARCHIVE) > $(OUT_CHECKSUMS)
197+
$(CMD_TAR) -cvzf $(OUT_ARCHIVE) $(RELEASE_FILES) && \
198+
$(CMD_CHECKSUM) $(OUT_ARCHIVE) > $(OUT_CHECKSUMS)
199+
179200
#
180201
# note: TAGS created by release-snapshot workflow
181202
#

0 commit comments

Comments
 (0)