-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
145c0b8
commit e76f0b9
Showing
4 changed files
with
44 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,4 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
# ############################################################### | ||
# Integration variables | ||
root_dir=$1 | ||
integration_dir="${root_dir}/exporters/powerdns" | ||
integration_bin_dir="${integration_dir}/target/bin" | ||
|
||
# ############################################################### | ||
# Clone exporter | ||
tmp_dir=$(mktemp -d) | ||
git clone --no-checkout "${EXPORTER_REPO_URL}" "${tmp_dir}" | ||
cd "${tmp_dir}" | ||
|
||
if [[ -z "${EXPORTER_TAG}" ]] | ||
then | ||
git -c advice.detachedHead=false checkout "${EXPORTER_COMMIT}" | ||
else | ||
git checkout "${EXPORTER_TAG}" -d | ||
fi | ||
|
||
IFS=',' read -r -a goarchs <<< "$PACKAGE_LINUX_GOARCHS" | ||
for goarch in "${goarchs[@]}" | ||
do | ||
echo "Build exporter Linux ${goarch}" | ||
GOARCH=${goarch} make build | ||
mkdir -p "${integration_bin_dir}/linux_${goarch}" | ||
cp "${tmp_dir}/powerdns_exporter" "${integration_bin_dir}/linux_${goarch}/powerdns-exporter" | ||
done | ||
location=$(dirname "${BASH_SOURCE[0]}") | ||
${location}/build-exporter.sh "linux" "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
# ############################################################### | ||
# Integration variables | ||
os="$1" | ||
root_dir="$2" | ||
integration_dir="${root_dir}/exporters/powerdns" | ||
integration_bin_dir="${integration_dir}/target/bin" | ||
download_url="https://github.com/newrelic-forks/prometheus-powerdns_exporter/releases/download" | ||
|
||
# ############################################################### | ||
# Validate variables | ||
if ! [ -z "$EXPORTER_COMMIT" ]; then | ||
echo "This script does not support to build by commit anymore." | ||
exit 1 | ||
fi | ||
|
||
if [ -z "$EXPORTER_TAG" ]; then | ||
echo "This script requires .exporter_tag to download the exporter." | ||
exit 2 | ||
fi | ||
|
||
if [ "$os" != "linux" ] && [ "$os" != "windows" ]; then | ||
echo "os not supported: $os." | ||
exit 3 | ||
fi | ||
|
||
# ############################################################### | ||
# Download the exporter | ||
IFS=',' read -r -a goarchs <<< "$PACKAGE_LINUX_GOARCHS" | ||
for goarch in "${goarchs[@]}" | ||
do | ||
echo "Downloading exporter for ${os} ${goarch}" | ||
mkdir -p "${integration_bin_dir}/${os}_${goarch}" | ||
curl -qsLo "${integration_bin_dir}/${os}_${goarch}/powerdns-exporter" "${download_url}/${EXPORTER_TAG}/prometheus-powerdns_exporter_${EXPORTER_TAG}_${os}_${goarch}" | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters