1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-02-09 13:36:56 +02:00

Merge branch 'master' into github-enterprise

This commit is contained in:
Carlos Alexandro Becker 2017-09-26 18:25:11 -03:00
commit 9ddf723c4e
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940
4 changed files with 18 additions and 8 deletions

View File

@ -171,6 +171,7 @@ type Docker struct {
Image string `yaml:",omitempty"`
Dockerfile string `yaml:",omitempty"`
Latest bool `yaml:",omitempty"`
Files []string `yaml:"extra_files,omitempty"`
// Capture all undefined fields and should be empty after loading
XXX map[string]interface{} `yaml:",inline"`

View File

@ -52,6 +52,10 @@ dockers:
dockerfile: Dockerfile
# Also tag and push myuser/myimage:latest
latest: true
# If your dockerfile copies more files other than the binary itself,
# you should list them here as well.
extra_files:
- config.yml
```
These settings should allow you to generate multiple docker images, using

View File

@ -5,7 +5,7 @@ title: Links
- Follow the progress on [GitHub repository](https://github.com/goreleaser/goreleaser)
- Follow [@caarlos0](https://twitter.com/caarlos0) on Twitter for updates
- [Slack](https://gophers.slack.com/messages/goreleaser/) to chat about GoReleaser,
quetions and etc. Join using [this link](https://invite.slack.golangbridge.org/).
questions and etc. Join using [this link](https://invite.slack.golangbridge.org/).
- [Contributing Guidelines](https://github.com/goreleaser/goreleaser/blob/master/CONTRIBUTING.md)
This project adheres to the Contributor Covenant

View File

@ -71,6 +71,11 @@ func process(ctx *context.Context, folder string, docker config.Docker, binary c
if err := os.Link(docker.Dockerfile, dockerfile); err != nil {
return errors.Wrap(err, "failed to link dockerfile")
}
for _, file := range docker.Files {
if err := os.Link(file, filepath.Join(root, filepath.Base(file))); err != nil {
return errors.Wrapf(err, "failed to link extra file '%s'", file)
}
}
if err := dockerBuild(root, dockerfile, image); err != nil {
return err
}