github.com/mysteriumnetwork/node@v0.0.0-20240516044423-365054f76801/bin/helpers/functions.sh (about)

     1  #!/bin/bash
     2  
     3  # Map environment variables to flags for Golang linker's -ldflags usage
     4  function get_linker_ldflags {
     5      [ -n "$BUILD_BRANCH" ] && echo -n "-X 'github.com/mysteriumnetwork/node/metadata.BuildBranch=${BUILD_BRANCH}' "
     6      [ -n "$BUILD_COMMIT" ] && echo -n "-X 'github.com/mysteriumnetwork/node/metadata.BuildCommit=${BUILD_COMMIT}' "
     7      [ -n "$BUILD_NUMBER" ] && echo -n "-X 'github.com/mysteriumnetwork/node/metadata.BuildNumber=${BUILD_NUMBER}' "
     8      [ -n "$BUILD_VERSION" ] && echo -n "-X 'github.com/mysteriumnetwork/node/metadata.Version=${BUILD_VERSION}' "
     9  }
    10  
    11  function copy_config {
    12      local OS_DIR=$1
    13      local DST_DIR=$2
    14      cp -vrp "bin/package/config/common/" ${DST_DIR}/config
    15      if [[ -d "bin/package/config/${OS_DIR}/" ]]; then
    16          cp -vrp "bin/package/config/${OS_DIR}/." ${DST_DIR}/config
    17      fi
    18  }