github.com/bshelton229/agent@v3.5.4+incompatible/.buildkite/steps/build-debian-packages.sh (about)

     1  #!/bin/bash
     2  set -euo pipefail
     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  dry_run() {
    15    if [[ "${DRY_RUN:-}" == "false" ]] ; then
    16      "$@"
    17    else
    18      echo "[dry-run] $*"
    19    fi
    20  }
    21  
    22  echo "--- Installing dependencies"
    23  bundle
    24  
    25  # Make sure we have a clean deb folder
    26  rm -rf deb
    27  
    28  # Build the packages into deb/
    29  PLATFORM="linux"
    30  for ARCH in "amd64" "386" "arm" "armhf" "arm64"; do
    31    echo "--- Building debian package ${PLATFORM}/${ARCH}"
    32  
    33    BINARY="pkg/buildkite-agent-${PLATFORM}-${ARCH}"
    34  
    35    # Download the built binary artifact
    36    buildkite-agent artifact download "$BINARY" .
    37  
    38    # Make sure it's got execute permissions so we can extract the version out of it
    39    chmod +x "$BINARY"
    40  
    41    # Build the debian package using the architectre and binary, they are saved to deb/
    42    ./scripts/build-debian-package.sh "$ARCH" "$BINARY" "$AGENT_VERSION" "$BUILD_VERSION"
    43  done