Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update build.sh, remove COPY tests from Dockerfile.ci
- Loading branch information
1 parent
213c3c0
commit cbbd6ff
Showing
2 changed files
with
18 additions
and
15 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
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,27 +1,31 @@ | ||
#!/usr/bin/env bash | ||
|
||
if ! command -v go >/dev/null 2>&1; then | ||
echo 'go is required to build the helm template binding' | ||
exit 1 | ||
fi | ||
|
||
cd $(dirname "$0") | ||
pwd | ||
so_name=libtemplate.so | ||
|
||
go build -buildmode=c-shared -o $so_name template.go | ||
if [ -e $so_name ] | ||
then | ||
so_name="libtemplate.so" | ||
|
||
# Compile the binding if a Go runtime exists | ||
if [[ -z $(which go) ]]; then | ||
echo "[WARN] go is not available on this system -- skipping Helm binding build!" | ||
else | ||
go build -buildmode=c-shared -o $so_name template.go | ||
fi | ||
|
||
# Validate that the compiled binding exists | ||
if [[ -e $so_name ]]; then | ||
echo "$so_name built successfully" | ||
else | ||
echo "error building $so_name. Exiting" | ||
echo "[ERROR] $so_name does not exist!" | ||
exit 1 | ||
fi | ||
|
||
if ! command -v python3 >/dev/null 2>&1; then | ||
echo 'python3 is not available on this system. Skipping cffi build' | ||
exit 0 | ||
# Compile the Python ffi binding if Python is available | ||
if [[ -z $(which python3) ]]; then | ||
echo "[WARN] python3 is not available on this system -- skipping cffi build!" | ||
else | ||
echo 'Building the Python binding using cffi' | ||
echo "Building the Python binding using cffi" | ||
python3 cffi_build.py | ||
fi | ||
|
||
exit 0 |