Skip to content

Commit

Permalink
cephadm: allow execution from a relative path
Browse files Browse the repository at this point in the history
let the build script run from a relative path (e.g. build or qa dir)

Signed-off-by: Michael Fritch <[email protected]>
  • Loading branch information
mgfritch authored and phlogistonjohn committed Sep 13, 2022
1 parent 47834f0 commit a076983
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/cephadm/build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
#!/bin/bash -ex

set -ex
SCRIPT_NAME=$(basename ${BASH_SOURCE[0]})
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

clean_up() {
if [ -e ${buildir} ]; then
Expand All @@ -12,7 +13,7 @@ trap clean_up EXIT
PYTHON=$(which python3)

# Create build directory and install required dependencies
target_fpath="$(pwd)/cephadm"
target_fpath=${SCRIPT_DIR}/cephadm
if [ -n "$1" ]; then
target_fpath="$1"
fi
Expand All @@ -22,7 +23,7 @@ if [ -e "requirements.txt" ]; then
fi

# Make sure all newly created source files are copied here as well!
cp cephadm.py ${builddir}/__main__.py
cp ${SCRIPT_DIR}/cephadm.py ${builddir}/__main__.py

version=$($PYTHON --version)
if [[ "$version" =~ ^Python[[:space:]]([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)$ ]]; then
Expand Down

0 comments on commit a076983

Please sign in to comment.