-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add build workflow * Symlinking main.go * Trying to pull in a tag of operator sdk * Wrapping s2i script * Assemble moved to bin * Add GOBIN * Exit if dep install fails * Managing dependencies differently * trying to install dep with go * Stupid assemble script * Restoring curl command: * be explicit with gobin * Absolute path to dep * Debug * Use upstream assemble * Remove os import * Debug * Debug * Rename output binary * Convert build.yml to template, add deployment * Lock go-config to v0.8.0 * Fix resync misconfiguration * Change gobinary * Lock go-config to 0.7.0 * Change default config from yml to yaml * Improve error output when provider not found * Adding the necessary pieces to run locally * Add namespace param to rbac
- Loading branch information
Showing
18 changed files
with
266 additions
and
1,258 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 |
---|---|---|
@@ -0,0 +1,74 @@ | ||
#!/bin/bash | ||
|
||
# Install dep | ||
export GOBIN=/opt/app-root/src/go/bin | ||
mkdir -p $GOBIN | ||
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh | ||
|
||
set -e | ||
|
||
pushd /tmp/src | ||
|
||
if [[ `go list -f {{.Incomplete}}` == "true" ]]; then | ||
|
||
INSTALL_URL=${INSTALL_URL:-$IMPORT_URL} | ||
|
||
if [[ ! -z "$IMPORT_URL" ]]; then | ||
|
||
popd | ||
|
||
echo "Assembling GOPATH" | ||
|
||
export GOPATH=`realpath $HOME/go` | ||
|
||
mkdir -p $GOPATH/src/$IMPORT_URL | ||
|
||
mv /tmp/src/* $GOPATH/src/$IMPORT_URL | ||
|
||
if [[ -d /tmp/artifacts/pkg ]]; then | ||
|
||
echo "Restoring previous build artifacts" | ||
|
||
mv /tmp/artifacts/pkg $GOPATH | ||
|
||
fi | ||
|
||
# Resolve dependencies, ignore if vendor present | ||
|
||
if [[ ! -d $GOPATH/src/$INSTALL_URL/vendor ]]; then | ||
|
||
echo "Resolving dependencies" | ||
|
||
pushd $GOPATH/src/$INSTALL_URL | ||
|
||
$GOBIN/dep ensure | ||
|
||
popd | ||
|
||
fi | ||
|
||
# lets build | ||
|
||
pushd $GOPATH/src/$INSTALL_URL | ||
|
||
echo "Building" | ||
|
||
go install -i $INSTALL_URL | ||
|
||
mv $GOPATH/bin/$BINARY_NAME /opt/app-root/gobinary | ||
|
||
popd | ||
|
||
exit | ||
|
||
fi | ||
|
||
exec /$STI_SCRIPTS_PATH/usage | ||
|
||
else | ||
|
||
go build -o /opt/app-root/gobinary | ||
|
||
popd | ||
|
||
fi |
Oops, something went wrong.