Skip to content

Commit

Permalink
packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
cjimti committed Apr 23, 2019
1 parent 7d5f987 commit 3dd3df6
Show file tree
Hide file tree
Showing 2 changed files with 137 additions and 0 deletions.
129 changes: 129 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# Build customization
build:
# Path to main.go file.
# Default is `main.go`
main: ./cmd/query.go
binary: tm

env:
- GO111MODULE=on
- GOPROXY=https://gocenter.io
- CGO_ENABLED=0

# GOOS list to build in.
# For more info refer to https://golang.org/doc/install/source#environment
# Defaults are darwin and linux
goos:
- linux
- darwin
- arm
- windows

# GOARCH to build in.
# For more info refer to https://golang.org/doc/install/source#environment
# Defaults are 386 and amd64
goarch:
- amd64
- arm

ldflags: -s -w -X main.Version={{.Version}}

release:
# Repo in which the release will be created.
# Default is extracted from the origin remote URL.
github:
owner: txn2
name: query

# If set to true, will not auto-publish the release.
# Default is false.
draft: false

# If set to true, will mark the release as not ready for production.
# Default is false.
prerelease: false

# You can change the name of the GitHub release.
# Default is ``
name_template: "{{.ProjectName}}-v{{.Version}} {{.Env.USER}}"

# You can disable this pipe in order to not upload any artifacts to
# GitHub.
# Defaults to false.
disable: false

nfpm:
name_template: '{{ .ProjectName }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
homepage: https://github.com/txn2/tm
description: TXN2 query system.
maintainer: Craig Johnston <[email protected]>
license: Apache 2.0
vendor: TXN2
formats:
- deb
- rpm
recommends:
- rpm

# Archive customization
archive:
# You can change the name of the archive.
# This is parsed with Golang template engine and the following variables.
name_template: "{{.ProjectName}}_{{.Os}}_{{.Arch}}"

# Archive format. Valid options are `tar.gz` and `zip`.
# Default is `zip`
format: tar.gz

# Replacements for GOOS and GOARCH on the archive name.
# The keys should be valid GOOS or GOARCH values followed by your custom
# replacements.
# By default, `replacements` replace GOOS and GOARCH values with valid outputs
# of `uname -s` and `uname -m` respectively.
replacements:
amd64: amd64
386: 386
darwin: macOS
linux: linux

format_overrides:
- goos: windows
format: zip

# Additional files you want to add to the archive.
# Defaults are any files matching `LICENCE*`, `LICENSE*`,
# `README*` and `CHANGELOG*` (case-insensitive)
files:
- LICENSE


dockers:
-
goos: linux
goarch: amd64
goarm: ''
binaries:
- query
dockerfile: Dockerfile
image_templates:
- "txn2/query:latest"
- "txn2/query:{{ .Tag }}"
- "txn2/query:amd64-{{ .Tag }}"
build_flag_templates:
- "--label=org.label-schema.schema-version=1.0"
- "--label=org.label-schema.version={{.Version}}"
- "--label=org.label-schema.name={{.ProjectName}}"
-
goos: linux
goarch: arm
goarm: 6
binaries:
- query
dockerfile: Dockerfile
image_templates:
- "txn2/query:armv6-latest"
- "txn2/query:armv6-{{ .Tag }}"
build_flag_templates:
- "--label=org.label-schema.schema-version=1.0"
- "--label=org.label-schema.version={{.Version}}"
- "--label=org.label-schema.name={{.ProjectName}}"
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM scratch
ENV PATH=/bin

COPY query /bin/

WORKDIR /

ENTRYPOINT ["/bin/query"]

0 comments on commit 3dd3df6

Please sign in to comment.