Skip to content

Commit

Permalink
Merge pull request #1 from dirathea/bootstrap/global-properties-override
Browse files Browse the repository at this point in the history
Bootstrap/global properties override
  • Loading branch information
dirathea authored Feb 23, 2020
2 parents 6b11824 + 9f707b6 commit 5ddf57b
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
23 changes: 21 additions & 2 deletions executor/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,30 @@ activate()
echo "Searching for AZK_ environment variable"
compgen -A variable AZK_ | while read v; do
TARGET_PROPERTIES=$(echo ${v:4} | tr '[:upper:]' '[:lower:]' | tr '_' '.')
PROPERTIES_PATH="$conf/azkaban.properties"
echo "Replacing $TARGET_PROPERTIES to properties";
grep -q $TARGET_PROPERTIES $conf/azkaban.properties && sed -i "s/\($TARGET_PROPERTIES=\).*\$/\1${!v}/" $conf/azkaban.properties || \
echo "$TARGET_PROPERTIES=${!v}" >> $conf/azkaban.properties
grep -q $TARGET_PROPERTIES $PROPERTIES_PATH && sed -i "s/\($TARGET_PROPERTIES=\).*\$/\1${!v}/" $PROPERTIES_PATH || \
echo "$TARGET_PROPERTIES=${!v}" >> $PROPERTIES_PATH
done

echo "Searching for GLOBAL_ environment variable"
compgen -A variable GLOBAL_ | while read v; do
TARGET_PROPERTIES=$(echo ${v:7} | tr '[:upper:]' '[:lower:]' | tr '_' '.')
PROPERTIES_PATH="$conf/global.properties"
echo "Replacing $TARGET_PROPERTIES to properties";
grep -q $TARGET_PROPERTIES $PROPERTIES_PATH && sed -i "s/\($TARGET_PROPERTIES=\).*\$/\1${!v}/" $PROPERTIES_PATH || \
echo "$TARGET_PROPERTIES=${!v}" >> $PROPERTIES_PATH
done

if [[ ! -z "$ENABLE_MEMCHECK" ]]
then
echo "Set job memcheck value"
TARGET_PROPERTIES="memCheck.enabled"
PROPERTIES_PATH="$azkaban_dir/plugins/jobtypes/commonprivate.properties"
grep -q $TARGET_PROPERTIES $PROPERTIES_PATH && sed -i "s/\($TARGET_PROPERTIES=\).*\$/\1$ENABLE_MEMCHECK/" $PROPERTIES_PATH || \
echo "$TARGET_PROPERTIES=$ENABLE_MEMCHECK" >> $PROPERTIES_PATH
fi

activate &

echo "Starting Azkaban Process"
Expand Down
9 changes: 9 additions & 0 deletions solo-server/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,14 @@ compgen -A variable AZK_ | while read v; do
echo "$TARGET_PROPERTIES=${!v}" >> $conf/azkaban.properties
done

echo "Searching for GLOBAL_ environment variable"
compgen -A variable GLOBAL_ | while read v; do
TARGET_PROPERTIES=$(echo ${v:7} | tr '[:upper:]' '[:lower:]' | tr '_' '.')
PROPERTIES_PATH="$conf/global.properties"
echo "Replacing $TARGET_PROPERTIES to properties";
grep -q $TARGET_PROPERTIES $PROPERTIES_PATH && sed -i "s/\($TARGET_PROPERTIES=\).*\$/\1${!v}/" $PROPERTIES_PATH || \
echo "$TARGET_PROPERTIES=${!v}" >> $PROPERTIES_PATH
done

echo "Starting Azkaban Process"
azkaban
9 changes: 9 additions & 0 deletions web/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,14 @@ compgen -A variable AZK_ | while read v; do
echo "$TARGET_PROPERTIES=${!v}" >> $conf/azkaban.properties
done

echo "Searching for GLOBAL_ environment variable"
compgen -A variable GLOBAL_ | while read v; do
TARGET_PROPERTIES=$(echo ${v:7} | tr '[:upper:]' '[:lower:]' | tr '_' '.')
PROPERTIES_PATH="$conf/global.properties"
echo "Replacing $TARGET_PROPERTIES to properties";
grep -q $TARGET_PROPERTIES $PROPERTIES_PATH && sed -i "s/\($TARGET_PROPERTIES=\).*\$/\1${!v}/" $PROPERTIES_PATH || \
echo "$TARGET_PROPERTIES=${!v}" >> $PROPERTIES_PATH
done

echo "Starting Azkaban Process"
azkaban

0 comments on commit 5ddf57b

Please sign in to comment.