Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
H
heroku-buildpack-nodejs
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Python-Dev
heroku-buildpack-nodejs
Commits
2abb8cc7
Unverified
Commit
2abb8cc7
authored
May 01, 2019
by
Jeremy Morrell
Committed by
GitHub
May 01, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new make rule for smaller go binaries (#660)
Running upx on go binaries reduces binary size ~ from 7MB -> 1.5MB
parent
84432143
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
README.md
README.md
+5
-0
makefile
makefile
+8
-0
No files found.
README.md
View file @
2abb8cc7
...
@@ -86,3 +86,8 @@ make test-heroku-16
...
@@ -86,3 +86,8 @@ make test-heroku-16
The tests are run via the vendored
The tests are run via the vendored
[
shunit2
](
https://github.com/kward/shunit2
)
[
shunit2
](
https://github.com/kward/shunit2
)
test framework.
test framework.
## Updating go binaries
If you would like to develop and update the go binaries you will need to install
[
go 1.12
](
https://golang.org/doc/install#install
)
and
[
upx
](
https://upx.github.io/
)
makefile
View file @
2abb8cc7
...
@@ -4,6 +4,14 @@ build:
...
@@ -4,6 +4,14 @@ build:
@
GOOS
=
darwin
GOARCH
=
amd64 go build
-ldflags
=
"-s -w"
-v
-o
./vendor/resolve-version-darwin ./cmd/resolve-version
@
GOOS
=
darwin
GOARCH
=
amd64 go build
-ldflags
=
"-s -w"
-v
-o
./vendor/resolve-version-darwin ./cmd/resolve-version
@
GOOS
=
linux
GOARCH
=
amd64 go build
-ldflags
=
"-s -w"
-v
-o
./vendor/resolve-version-linux ./cmd/resolve-version
@
GOOS
=
linux
GOARCH
=
amd64 go build
-ldflags
=
"-s -w"
-v
-o
./vendor/resolve-version-linux ./cmd/resolve-version
build-production
:
# build go binaries and then compress them
@
GOOS
=
darwin
GOARCH
=
amd64 go build
-ldflags
=
"-s -w"
-v
-o
./vendor/resolve-version-darwin ./cmd/resolve-version
@
GOOS
=
linux
GOARCH
=
amd64 go build
-ldflags
=
"-s -w"
-v
-o
./vendor/resolve-version-linux ./cmd/resolve-version
# https://blog.filippo.io/shrink-your-go-binaries-with-this-one-weird-trick/
upx
--brute
vendor/resolve-version-linux
upx
--brute
vendor/resolve-version-darwin
test-binary
:
test-binary
:
go
test
-v
./cmd/...
-tags
=
integration
go
test
-v
./cmd/...
-tags
=
integration
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment