github.com/cilium/cilium@v1.16.2/images/runtime/build-gops.sh (about)

     1  #!/usr/bin/env bash
     2  
     3  # Copyright Authors of Cilium
     4  # SPDX-License-Identifier: Apache-2.0
     5  
     6  set -o xtrace
     7  set -o errexit
     8  set -o pipefail
     9  set -o nounset
    10  
    11  # renovate: datasource=github-releases depName=google/gops
    12  gops_version="v0.3.27"
    13  
    14  mkdir -p /go/src/github.com/google
    15  cd /go/src/github.com/google
    16  
    17  git clone https://github.com/google/gops.git
    18  cd gops
    19  
    20  git checkout -b "${gops_version}" "${gops_version}"
    21  git --no-pager remote -v
    22  git --no-pager log -1
    23  
    24  for arch in amd64 arm64 ; do
    25    mkdir -p "/out/linux/${arch}/bin"
    26    GOARCH="${arch}" CGO_ENABLED=0 go build -ldflags "-s -w" -o "/out/linux/${arch}/bin/gops" github.com/google/gops
    27  done
    28  
    29  x86_64-linux-gnu-strip /out/linux/amd64/bin/gops
    30  aarch64-linux-gnu-strip /out/linux/arm64/bin/gops