Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions scripts/local-tile-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/usr/bin/env bash

cd ..
set -e
echo "Local tile build script"

# Read current version from tile-history.yml
CURRENT_VERSION=$(grep '^version:' tile/tile-history.yml)

if [ -z "$CURRENT_VERSION" ]; then
echo "Could not read version from tile/tile-history.yml"
exit 1
fi

echo "Building version: $CURRENT_VERSION"

echo "Building Go binary..."
env GOOS=linux GOARCH=amd64 go build -o splunk-firehose-nozzle -ldflags "-X main.version=$CURRENT_VERSION" ./main.go

# Make sure binary is executable
chmod +x splunk-firehose-nozzle

# Check if tile command exists
if ! command -v tile &> /dev/null; then
echo "tile command not found. Installing tile-generator..."
pip3 install tile-generator
fi

# Check if bosh command exists (required by tile-generator)
if ! command -v bosh &> /dev/null; then
echo "bosh command not found. Please install bosh-cli:"
echo " brew install cloudfoundry/tap/bosh-cli"
echo " # or download from: https://github.com/cloudfoundry/bosh-cli/releases"
exit 1
fi

# Build the tile
echo "Building tile..."
cd tile
tile build $CURRENT_VERSION
cd ..

echo "Build completed!"
ls -la tile/product/*.pivotal
14 changes: 10 additions & 4 deletions splunknozzle/nozzle.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ package splunknozzle
import (
"context"
"fmt"
"github.com/cloudfoundry/go-cfclient/v3/resource"
"os"
"strings"
"time"

"github.com/cloudfoundry/go-cfclient/v3/resource"

"code.cloudfoundry.org/lager/v3"
"github.com/cloudfoundry-community/splunk-firehose-nozzle/cache"
"github.com/cloudfoundry-community/splunk-firehose-nozzle/eventrouter"
Expand Down Expand Up @@ -88,11 +89,16 @@ func (s *SplunkFirehoseNozzle) EventRouter(cache cache.Cache, eventSink eventsin

// CFClient creates a client object which can talk to Cloud Foundry
func (s *SplunkFirehoseNozzle) PCFClient() (*NozzleCfClient, error) {
var skipSSL config.Option
var cfConfig *config.Config
var err error

if s.config.SkipSSLCF {
skipSSL = config.SkipTLSValidation()
cfConfig, err = config.New(s.config.ApiEndpoint, config.ClientCredentials(s.config.ClientID, s.config.ClientSecret), config.SkipTLSValidation(), config.UserAgent(fmt.Sprintf("splunk-firehose-nozzle/%s", s.config.Version)))
} else {
cfConfig, err = config.New(s.config.ApiEndpoint, config.ClientCredentials(s.config.ClientID, s.config.ClientSecret), config.UserAgent(fmt.Sprintf("splunk-firehose-nozzle/%s", s.config.Version)))
}
if cfConfig, err := config.New(s.config.ApiEndpoint, config.ClientCredentials(s.config.ClientID, s.config.ClientSecret), skipSSL, config.UserAgent(fmt.Sprintf("splunk-firehose-nozzle/%s", s.config.Version))); err != nil {

if err != nil {
return nil, err
} else {
if cfClient, err := client.New(cfConfig); err != nil {
Expand Down
Loading