Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unbound variable issue in docker-build script #1146

Merged
merged 1 commit into from
Jun 18, 2018
Merged
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
11 changes: 6 additions & 5 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,13 @@ In development you can run:
bin/go-run cli check
```

### Building CLI for development
### Building the CLI for development

When Conduit's CLI is built using `bin/docker-build` it always creates binaries for all three platforms.
For local development and fast edit-build-test cycle you might want to avoid that. For those situations
you can use the fast-build option, that will skip the docker build altogether and will build CLI
locally using `go build`.
When Conduit's CLI is built using `bin/docker-build` it always creates binaries
for all three platforms. For local development and a faster edit-build-test
cycle you might want to avoid that. For those situations you can use the
`bin/fast-build` script, which builds the CLI using the local Go toolchain
outside of Docker.

```bash
bin/fast-build
Expand Down
3 changes: 1 addition & 2 deletions bin/docker-build
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ bindir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
$bindir/docker-build-controller
$bindir/docker-build-web
$bindir/docker-build-proxy-init
if [ $CONDUIT_SKIP_CLI_CONTAINER -ne 1 ]; then
if [ -z "${CONDUIT_SKIP_CLI_CONTAINER:-}" ]; then
$bindir/docker-build-cli-bin
fi
$bindir/docker-build-grafana

$bindir/docker-build-proxy
13 changes: 8 additions & 5 deletions bin/fast-build
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ bindir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
rootdir="$( cd $bindir/.. && pwd )"
. $bindir/_tag.sh

CONDUIT_SKIP_CLI_CONTAINER=1 bin/docker-build
CONDUIT_SKIP_CLI_CONTAINER=1 $bindir/docker-build
current_platform=$(uname)
host_platform="windows"
if [ "${current_platform}" = 'Darwin' ]; then
Expand All @@ -18,7 +18,10 @@ elif [ "${current_platform}" = 'Linux' ]; then
host_platform="linux"
fi

./bin/dep ensure -vendor-only -v
target="$rootdir/target/cli/${host_platform}/conduit"
CGO_ENABLED=0 go build -installsuffix cgo -o $target -ldflags "-s -w -X github.com/runconduit/conduit/pkg/version.Version=$($bindir/root-tag)" ./cli
echo "$target"
(
cd $rootdir
$bindir/dep ensure -vendor-only -v
target="target/cli/${host_platform}/conduit"
CGO_ENABLED=0 go build -installsuffix cgo -o $target -ldflags "-s -w -X github.com/runconduit/conduit/pkg/version.Version=$($bindir/root-tag)" ./cli
echo "$target"
)