github.com/pquerna/agent@v2.1.8+incompatible/scripts/build-github-release.sh (about)

     1  #!/bin/bash
     2  set -e
     3  
     4  echo '--- Getting agent version from build meta data'
     5  
     6  export FULL_AGENT_VERSION=$(buildkite-agent meta-data get "agent-version-full")
     7  export AGENT_VERSION=$(buildkite-agent meta-data get "agent-version")
     8  export BUILD_VERSION=$(buildkite-agent meta-data get "agent-version-build")
     9  
    10  echo "Full agent version: $FULL_AGENT_VERSION"
    11  echo "Agent version: $AGENT_VERSION"
    12  echo "Build version: $BUILD_VERSION"
    13  
    14  echo '--- Downloading binaries'
    15  
    16  rm -rf pkg
    17  mkdir -p pkg
    18  buildkite-agent artifact download "pkg/*" .
    19  
    20  function build() {
    21    echo "--- Building release for: $1"
    22  
    23    ./scripts/utils/build-github-release.sh $1 $AGENT_VERSION
    24  }
    25  
    26  # Export the function so we can use it in xargs
    27  export -f build
    28  
    29  # Make sure the releases directory is empty
    30  rm -rf releases
    31  
    32  # Loop over all the binaries and build them
    33  ls pkg/* | xargs -I {} bash -c "build {}"