Skip to content

Commit

Permalink
Update build.sh, remove COPY tests from Dockerfile.ci
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshi-1224 committed Sep 11, 2019
1 parent 213c3c0 commit cbbd6ff
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
1 change: 0 additions & 1 deletion Dockerfile.ci
Expand Up @@ -54,5 +54,4 @@ RUN curl -L -o /usr/local/bin/kbld ${KBLD_URL} && chmod +x /usr/local/bin/kbld

COPY --from=go-env /go/bin/promtool /usr/local/bin/

COPY tests/test_resources /examples
CMD ["/bin/bash"]
32 changes: 18 additions & 14 deletions kapitan/inputs/helm/build.sh
@@ -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

0 comments on commit cbbd6ff

Please sign in to comment.