Skip to content

Commit 49d6d75

Browse files
Merge pull request #113 from AdRoll/host-build-arg
Added hologram host arg to allow pre-configured internal-use installers
2 parents 32db47c + bf23591 commit 49d6d75

File tree

5 files changed

+13
-4
lines changed

5 files changed

+13
-4
lines changed

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ RUN apt-get update && apt-get install -y \
1414
rsyslog \
1515
ruby \
1616
zlib1g-dev \
17-
ruby-dev
17+
ruby-dev \
18+
jq
1819

1920
RUN gem install fpm
2021

buildscripts/build_osx_pkgs.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ install -m 0644 ${HOLOGRAM_DIR}/agent/support/darwin/com.adroll.hologram-me.plis
2323
install -m 0755 ${HOLOGRAM_DIR}/agent/support/darwin/postinstall.sh /hologram-build/darwin/scripts/postinstall
2424
install -m 0755 ${HOLOGRAM_DIR}/agent/support/darwin/preinstall.sh /hologram-build/darwin/scripts/preinstall
2525

26+
# Special handling for custom host override
27+
if [[ -n "$HOLOGRAM_HOST" ]]
28+
then
29+
cat "${HOLOGRAM_DIR}/config/agent.json" | jq ". + {\"host\": \"$HOLOGRAM_HOST\"}" > /hologram-build/darwin/root/etc/hologram/agent.json
30+
fi
31+
2632
NUM_FILES=$(find /hologram-build/darwin/root | wc -l)
2733
INSTALL_KB_SIZE=$(du -k -s /hologram-build/darwin/root | awk '{print $1}')
2834

buildscripts/compile_hologram.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ source ${HOLOGRAM_DIR}/buildscripts/returncodes.sh
77
export GIT_TAG=$(git describe --tags --long)
88

99
echo "Compiling for linux..."
10-
GOOS=linux go install -ldflags="-X 'main.Version=${GIT_TAG}'" github.com/AdRoll/hologram/... || exit ${ERRCOMPILE}
10+
GOOS=linux go install -ldflags="-X 'main.Version=${GIT_TAG}'" github.com/AdRoll/hologram/... || exit ${ERRCOMPILE}
1111

1212
echo "Compiling for osx"
1313
GOOS=darwin go install -ldflags="-X 'main.Version=${GIT_TAG}'" github.com/AdRoll/hologram/... || exit ${ERRCOMPILE}

buildscripts/start.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ source ${HOLOGRAM_DIR}/buildscripts/returncodes.sh
44

55
rsyslogd # Believe it or not you need syslog to test hologram
66

7+
export HOLOGRAM_HOST="$2"
8+
79
if [ "$1" == "build_linux" ]; then
810
compile_hologram.sh --deps || exit $?
911
build_linux_pkgs.sh || exit $?

hologram.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/bash
2-
#docker build -t adroll/hologram_env .
3-
docker run --rm -t -i -v $(pwd):/go/src/github.com/AdRoll/hologram adroll/hologram_env $1
2+
docker build -t adroll/hologram_env .
3+
docker run --rm -t -i -v $(pwd):/go/src/github.com/AdRoll/hologram adroll/hologram_env $1 $2

0 commit comments

Comments
 (0)