Skip to content

Commit

Permalink
deployment: update get-envoy script and release hooks (pomerium#2111)
Browse files Browse the repository at this point in the history
  • Loading branch information
travisgroth committed Apr 21, 2021
1 parent 3b1e5a9 commit 2b59db2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 21 deletions.
7 changes: 5 additions & 2 deletions .github/goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,13 @@ builds:
- -X github.com/pomerium/pomerium/internal/version.ProjectURL=https://wwww.pomerium.io

hooks:
pre:
- cmd: ./scripts/get-envoy.bash
env:
- TARGET={{ .Os }}-{{ .Arch }}
- DIR={{ dir .Path }}
post:
- cmd: ./scripts/embed-envoy.bash {{ .Path }}
env: # e.g. darwin_amd64
- TARGET={{ .Target }}

- id: pomerium-cli
main: ./cmd/pomerium-cli
Expand Down
22 changes: 3 additions & 19 deletions scripts/get-envoy.bash
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,8 @@ PATH="$PATH:$(go env GOPATH)/bin"
export PATH

_envoy_version=1.17.1
_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)/../bin"
_target="${TARGET:-"$(go env GOOS)_$(go env GOARCH)"}"

if [[ "${_target}" == darwin_* ]]; then
_envoy_platform="darwin"
elif [[ "${_target}" == linux_* ]]; then
_envoy_platform="linux_glibc"
else
echo "unsupported TARGET: ${_target}"
exit 1
fi
_dir="${DIR:-"$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)/../bin"}"
_target="${TARGET:-"$(go env GOOS)-$(go env GOARCH)"}"

is_command() {
command -v "$1" >/dev/null
Expand All @@ -42,13 +33,6 @@ hash_sha256() {
}

mkdir -p "$_dir"

if [ "$_target" == "linux_arm64" ]; then
mkdir -p "$_dir"
curl -L -o "$_dir/envoy" https://github.com/pomerium/envoy-binaries/releases/download/v${_envoy_version}/envoy-linux-arm64
else
env HOME="$_dir" getenvoy fetch standard:${_envoy_version}/${_envoy_platform}
cp -f "$_dir/.getenvoy/builds/standard/${_envoy_version}/${_envoy_platform}/bin/envoy" "$_dir/envoy"
fi
curl -L -o "$_dir/envoy" "https://github.com/pomerium/envoy-binaries/releases/download/v${_envoy_version}/envoy-${_target}"

hash_sha256 "$_dir/envoy" >"$_dir/envoy.sha256"

0 comments on commit 2b59db2

Please sign in to comment.