Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
.vagrant
_obj
Dockerfile
.status.*
26 changes: 16 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
TARGETS=go1.10 go1.11 go1.12 go1.13 go1.14

build: status=".status.build"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you only need .SHELLFLAGS = -ec this will stop make on the first failure

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.ONESHELL : also can work

Copy link
Copy Markdown
Member Author

@v1v v1v Nov 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think fail fast might not be ideal for this particular use case, since the build takes a while, I'd prefer to run and then evaluate the outcome to provide as many details as possible, what do you think?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you know what happens when you allow keeping things broken 😄

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error should be reported and fail the build always but at the end, so that's what I meant

build:
@echo '0' > ${status}
@$(foreach var,$(TARGETS), \
$(MAKE) -C $(var) $@; \
$(MAKE) -C $(var) -f Makefile.debian7 $@; \
$(MAKE) -C $(var) -f Makefile.debian8 $@; \
$(MAKE) -C $(var) -f Makefile.debian9 $@;)
@make -C fpm $@
$(MAKE) -C $(var) $@ || echo '1' > ${status}; \
$(MAKE) -C $(var) -f Makefile.debian7 $@ || echo '1' > ${status}; \
$(MAKE) -C $(var) -f Makefile.debian8 $@ || echo '1' > ${status}; \
$(MAKE) -C $(var) -f Makefile.debian9 $@ || echo '1' > ${status};)
@make -C fpm $@ || echo '1' > ${status}
exit $$(cat ${status})

# Requires login at https://docker.elastic.co:7000/.
push: status=".status.push"
push:
@echo '0' > ${status}
@$(foreach var,$(TARGETS), \
$(MAKE) -C $(var) $@; \
$(MAKE) -C $(var) -f Makefile.debian7 $@; \
$(MAKE) -C $(var) -f Makefile.debian8 $@; \
$(MAKE) -C $(var) -f Makefile.debian9 $@;)
@make -C fpm $@
$(MAKE) -C $(var) $@ || echo '1' > ${status}; \
$(MAKE) -C $(var) -f Makefile.debian7 $@ || echo '1' > ${status}; \
$(MAKE) -C $(var) -f Makefile.debian8 $@ || echo '1' > ${status}; \
$(MAKE) -C $(var) -f Makefile.debian9 $@ || echo '1' > ${status};)
@make -C fpm $@ || echo '1' > ${status}
exit $$(cat ${status})

.PHONY: build push