Skip to content

Commit

Permalink
Keep linux binaries short (#331)
Browse files Browse the repository at this point in the history
Closes #330

Linux packages installs binaries to `/usr/local/bin`
and has names:

```
toxiproxy-server-linux-amd64
toxiproxy-cli-linux-amd64
```

It is not common way and different from previous releases.

Changes the binary destination path to `/usr/bin` and has short binary
names:

```
toxiproxy-server
toxiproxy-cli
```
  • Loading branch information
miry authored Oct 5, 2021
1 parent a26226e commit 2f31679
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 2 deletions.
22 changes: 22 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,18 @@ builds:
main: ./cli
binary: toxiproxy-cli-{{.Os}}-{{.Arch}}


- <<: *build_default
id: pkg-server
no_unique_dist_dir: false
binary: toxiproxy-server

- <<: *build_default
id: pkg-client
no_unique_dist_dir: false
main: ./cli
binary: toxiproxy-cli

checksum:
name_template: checksums.txt

Expand All @@ -56,6 +68,10 @@ nfpms:
maintainer: Shopify Opensource <opensource@shopify.com>
description: TCP proxy to simulate network and system conditions.
license: MIT
bindir: /usr/bin
builds:
- pkg-server
- pkg-client
formats:
- apk
- deb
Expand Down Expand Up @@ -132,6 +148,12 @@ archives:
id: archive_binaries
format: binary
name_template: "{{ .Binary }}"
builds:
- server
- client
-
id: archive_default
format: tar.gz
builds:
- pkg-server
- pkg-client
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# [Unreleased]

* Update linux packages to use `/usr/bin` folder as binary destination and change the executable names to
exclude ARCH and OS names. New pathes:
```
/usr/bin/toxiproxy-cli
/usr/bin/toxiproxy-server
```
(#331, @miry)

# [2.1.7]

* Set the valid version during the build process.
Expand Down
19 changes: 17 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,25 @@ release:

.PHONY: release-dry
release-dry:
goreleaser release --rm-dist --skip-publish --skip-validate

.PHONY: release-test
release-test: test bench e2e release-dry
version="$(shell git describe --abbrev=0 --tags)"
goreleaser build --rm-dist --single-target --skip-validate

docker run -v $(PWD)/dist:/dist --pull always --rm -it ubuntu bash -c "dpkg -i /dist/toxiproxy_*_linux_amd64.deb; ls -1 /usr/bin/toxiproxy-*; /usr/bin/toxiproxy-cli --version | grep \"toxiproxy-cli version $(version)\""
docker run -v $(PWD)/dist:/dist --pull always --rm -it centos bash -c "yum install -y /dist/toxiproxy_*_linux_amd64.rpm; ls -1 /usr/bin/toxiproxy-*; /usr/bin/toxiproxy-cli --version | grep \"toxiproxy-cli version $(version)\""
docker run -v $(PWD)/dist:/dist --pull always --rm -it alpine sh -c "apk add --allow-untrusted --no-cache /dist/toxiproxy_*_linux_amd64.apk; ls -1 /usr/bin/toxiproxy-*; /usr/bin/toxiproxy-cli --version | grep \"toxiproxy-cli version $(version)\""

tar -ztvf dist/toxiproxy_*_linux_amd64.tar.gz | grep toxiproxy-server
tar -ztvf dist/toxiproxy_*_linux_amd64.tar.gz | grep toxiproxy-cli

goreleaser build --rm-dist --single-target --skip-validate --id server
./dist/toxiproxy-server-* --help 2>&1 | grep "Usage of ./dist/toxiproxy-server"

goreleaser build --rm-dist --single-target --skip-validate --id client
./dist/toxiproxy-cli-* --version | grep "toxiproxy-cli version $(version)"
goreleaser release --rm-dist --skip-publish --skip-validate


.PHONY: setup
setup:
Expand Down

0 comments on commit 2f31679

Please sign in to comment.