Skip to content

Commit

Permalink
Merge pull request #113 from AdRoll/host-build-arg
Browse files Browse the repository at this point in the history
Added hologram host arg to allow pre-configured internal-use installers
  • Loading branch information
joshua-mullins-nextroll authored Aug 23, 2022
2 parents 32db47c + bf23591 commit 49d6d75
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ RUN apt-get update && apt-get install -y \
rsyslog \
ruby \
zlib1g-dev \
ruby-dev
ruby-dev \
jq

RUN gem install fpm

Expand Down
6 changes: 6 additions & 0 deletions buildscripts/build_osx_pkgs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ install -m 0644 ${HOLOGRAM_DIR}/agent/support/darwin/com.adroll.hologram-me.plis
install -m 0755 ${HOLOGRAM_DIR}/agent/support/darwin/postinstall.sh /hologram-build/darwin/scripts/postinstall
install -m 0755 ${HOLOGRAM_DIR}/agent/support/darwin/preinstall.sh /hologram-build/darwin/scripts/preinstall

# Special handling for custom host override
if [[ -n "$HOLOGRAM_HOST" ]]
then
cat "${HOLOGRAM_DIR}/config/agent.json" | jq ". + {\"host\": \"$HOLOGRAM_HOST\"}" > /hologram-build/darwin/root/etc/hologram/agent.json
fi

NUM_FILES=$(find /hologram-build/darwin/root | wc -l)
INSTALL_KB_SIZE=$(du -k -s /hologram-build/darwin/root | awk '{print $1}')

Expand Down
2 changes: 1 addition & 1 deletion buildscripts/compile_hologram.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ source ${HOLOGRAM_DIR}/buildscripts/returncodes.sh
export GIT_TAG=$(git describe --tags --long)

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

echo "Compiling for osx"
GOOS=darwin go install -ldflags="-X 'main.Version=${GIT_TAG}'" github.com/AdRoll/hologram/... || exit ${ERRCOMPILE}
Expand Down
2 changes: 2 additions & 0 deletions buildscripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ source ${HOLOGRAM_DIR}/buildscripts/returncodes.sh

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

export HOLOGRAM_HOST="$2"

if [ "$1" == "build_linux" ]; then
compile_hologram.sh --deps || exit $?
build_linux_pkgs.sh || exit $?
Expand Down
4 changes: 2 additions & 2 deletions hologram.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
#docker build -t adroll/hologram_env .
docker run --rm -t -i -v $(pwd):/go/src/github.com/AdRoll/hologram adroll/hologram_env $1
docker build -t adroll/hologram_env .
docker run --rm -t -i -v $(pwd):/go/src/github.com/AdRoll/hologram adroll/hologram_env $1 $2

0 comments on commit 49d6d75

Please sign in to comment.