Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Magefile #687

Closed
wants to merge 5 commits into from
Closed

feat: Magefile #687

wants to merge 5 commits into from

Conversation

sh0rez
Copy link
Member

@sh0rez sh0rez commented Jun 20, 2019

Adds a magefile.go as an exploratory effort whether it is worth it investing on that technology. Not intended to be merged yet. See #684 for reference

Progress overview:

  • all
  • assets
  • build-plugin
  • check_assets
  • check-generated-files
  • clean
  • cmd/docker-driver/docker-driver
  • cmd/docker-driver/docker-driver-debug
  • cmd/docker-driver/.uptodate
  • cmd/docker-driver/.uptodate-debug
  • cmd/logcli/logcli (renamed to build:logcli)
  • cmd/logcli/logcli-debug (renamed to DEBUG=true build:logcli)
  • cmd/logcli/.uptodate
  • cmd/logcli/.uptodate-debug
  • cmd/loki/loki (renamed to build:loki)
  • cmd/loki/loki-debug (renamed to DEBUG=true build:loki)
  • cmd/loki/.uptodate
  • cmd/loki/.uptodate-debug
  • cmd/promtail/promtail (renamed to build:logcli)
  • cmd/promtail/promtail-debug (renamed to DEBUG=true build:loki)
  • cmd/promtail/.uptodate
  • cmd/promtail/.uptodate-debug
  • debug
  • enable-plugin
  • helm (renamed to helm:build)
  • helm-clean
  • helm-install
  • helm-publish
  • helm-upgrade
  • images
  • lint
  • load-images
  • loki-build-image/.uptodate
  • pkg/logproto/logproto.pb.go
  • pkg/logql/expr.go
  • pkg/promtail/server/server.go
  • protos
  • push-images
  • push-latest
  • push-plugin
  • release-perform
  • release-prepare
  • save-images
  • shell
  • test
  • vendor/github.com/cortexproject/cortex/pkg/chunk/storage/caching_index_client.pb.go
  • vendor/github.com/cortexproject/cortex/pkg/ingester/client/cortex.pb.go
  • vendor/github.com/cortexproject/cortex/pkg/ring/ring.pb.go
  • yacc

sh0rez added 3 commits June 19, 2019 22:57
Adds Build namespace with compile targets for Loki, Promtail and LogCLI
Ports lint and test targets from Makefile
Ports all helm related targets from Makefile
@sh0rez sh0rez mentioned this pull request Jun 20, 2019
sh0rez and others added 2 commits June 20, 2019 11:56
Adds magefile libraries required to build the build-chain
Adding targets to Makefile to install and upgrade mage.
Experimenting with a `mage all` target
@slim-bean
Copy link
Collaborator

I'm liking this so far, my only gripe is that I wish you could default the -v flag as I like seeing output by default.

I think we should continue to build out functionality.

@sh0rez
Copy link
Member Author

sh0rez commented Jun 21, 2019

alias mage=mage -v?

@slim-bean
Copy link
Collaborator

yeah true :) really I want to impose -v on everyone, which we can do if we create make targets that call mage.

I think to keep the feel of loki similar to most go projects we should keep the makefile as a wrapper to mage, we can even go so far as adding the new mage target as a pre-req in make for all so the use of mage could be transparent to people.

I think we'd just have to figure out what targets to keep in the makefile

type Assets mg.Namespace

func (Assets) CheckAssets() error {
err := sh.Run("git", "diff", "--exit-code", "pkg/promtail/server/ui")
Copy link
Member Author

Choose a reason for hiding this comment

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

git() is available as a function (cmds.go)

@sh0rez sh0rez closed this Aug 2, 2019
@sh0rez sh0rez deleted the magefile branch August 2, 2019 09:26
@jpreese
Copy link

jpreese commented Jun 3, 2020

@sh0rez What was the end result of this experiment? We're contemplating investing in Mage to help with compatibility issues with Makefile and supporting devs on Windows/Max/Linux

@sh0rez
Copy link
Member Author

sh0rez commented Jun 3, 2020

We went with Makefiles instead, mostly because shelling out in Go is not optimal, as it requires error checking, etc.

But I am aware of many projects being very happy with Mage and it is by far the best Make alternative I have seen so far.

@jpreese
Copy link

jpreese commented Jun 3, 2020

Understood, thanks for the quick response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants