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

Deprecate Makefile #1813

Closed
mrueg opened this Issue Oct 12, 2016 · 6 comments

Comments

Projects
5 participants
@mrueg
Contributor

mrueg commented Oct 12, 2016

Currently the Makefile assumes that GOPATH is set to a single directory, instead there could be multiple directories it could be set to concatenated with :

https://github.com/drone/drone/blob/master/Makefile#L49

Can the GOPATH be replaced with anything that works also for this case? Thanks!

@bradrydzewski bradrydzewski added this to To Do in Version 0.7 May 11, 2017

@bradrydzewski

This comment has been minimized.

Show comment
Hide comment
@bradrydzewski

bradrydzewski May 11, 2017

Member

I'm re-naming the issue. I think the ideal solution would be to make drone go gettable so that we don't need a makefile or scripts that rely on the GOPATH for the build process.

For this to work we will need to commit generated files to the repository. I am planning to improve the file format for embedded content to make it a bit more git / diff friendly.

Member

bradrydzewski commented May 11, 2017

I'm re-naming the issue. I think the ideal solution would be to make drone go gettable so that we don't need a makefile or scripts that rely on the GOPATH for the build process.

For this to work we will need to commit generated files to the repository. I am planning to improve the file format for embedded content to make it a bit more git / diff friendly.

@bradrydzewski bradrydzewski changed the title from Don't assume GOPATH is a single directory to Deprecate Makefile May 11, 2017

@tboerger

This comment has been minimized.

Show comment
Hide comment
@tboerger

tboerger May 11, 2017

Member

I would suggest fileb0x instead of bindata :)

Member

tboerger commented May 11, 2017

I would suggest fileb0x instead of bindata :)

@appleboy

This comment has been minimized.

Show comment
Hide comment
@appleboy
Member

appleboy commented May 12, 2017

@bradrydzewski bradrydzewski moved this from To Do to In Progress in Version 0.7 May 12, 2017

@metalmatze

This comment has been minimized.

Show comment
Hide comment
@metalmatze

metalmatze May 12, 2017

Member

I'm using https://github.com/gobuffalo/packr lately. Just to put it on the list too.

Member

metalmatze commented May 12, 2017

I'm using https://github.com/gobuffalo/packr lately. Just to put it on the list too.

@bradrydzewski

This comment has been minimized.

Show comment
Hide comment
@bradrydzewski

bradrydzewski May 13, 2017

Member

Thanks, I will definitely check out packr and filebox for drone-ui 😄

For drone core we actually don't store any binary assets. They are all text assets related to database queries, migration and templates. So I'm using https://github.com/bradrydzewski/togo

This is a tool of my own creation that handles embedding plain text files as plain text (strings) and generating the relevant template, migration, sql code. This is easier to read and is diff friendly.

Example of generated template code:

package template

import "html/template"

// list of embedded template files.
var files = []struct {
	name string
	data string
}{
	{
		name: "en.tmpl",
		data: en,
	}, {
		name: "es.tmpl",
		data: es,
	},
}

// T exposes the embedded templates.
var T *template.Template

func init() {
	T = template.New("_").Funcs(funcMap)
	for _, file := range files {
		T = template.Must(
			T.New(file.name).Parse(file.data),
		)
	}
}

//
// embedded template files.
//

// files/en.tmpl
var en = `<html>
<body>
Hello world
</body>
</html>
`

// files/es.tmpl
var es = `<html>
<body>
Hola Mundo
</body>
</html>
`
Member

bradrydzewski commented May 13, 2017

Thanks, I will definitely check out packr and filebox for drone-ui 😄

For drone core we actually don't store any binary assets. They are all text assets related to database queries, migration and templates. So I'm using https://github.com/bradrydzewski/togo

This is a tool of my own creation that handles embedding plain text files as plain text (strings) and generating the relevant template, migration, sql code. This is easier to read and is diff friendly.

Example of generated template code:

package template

import "html/template"

// list of embedded template files.
var files = []struct {
	name string
	data string
}{
	{
		name: "en.tmpl",
		data: en,
	}, {
		name: "es.tmpl",
		data: es,
	},
}

// T exposes the embedded templates.
var T *template.Template

func init() {
	T = template.New("_").Funcs(funcMap)
	for _, file := range files {
		T = template.Must(
			T.New(file.name).Parse(file.data),
		)
	}
}

//
// embedded template files.
//

// files/en.tmpl
var en = `<html>
<body>
Hello world
</body>
</html>
`

// files/es.tmpl
var es = `<html>
<body>
Hola Mundo
</body>
</html>
`

@bradrydzewski bradrydzewski moved this from In Progress to Done in Version 0.7 May 14, 2017

@bradrydzewski

This comment has been minimized.

Show comment
Hide comment
@bradrydzewski
Member

bradrydzewski commented May 14, 2017

merged #2040

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment