Skip to content

Commit ac557e0

Browse files
authored
clean site/out and enforce make bin (#2604)
1 parent 4eda703 commit ac557e0

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ bin: $(shell find . -not -path './vendor/*' -type f -name '*.go') go.mod go.sum
2020

2121
mkdir -p ./dist
2222
rm -rf ./dist/coder-slim_*
23+
rm -f ./site/out/bin/coder*
2324
./scripts/build_go_slim.sh \
25+
--compress 6 \
2426
--version "$(VERSION)" \
2527
--output ./dist/ \
2628
linux:amd64,armv7,arm64 \
@@ -31,6 +33,7 @@ bin: $(shell find . -not -path './vendor/*' -type f -name '*.go') go.mod go.sum
3133
build: site/out/index.html $(shell find . -not -path './vendor/*' -type f -name '*.go') go.mod go.sum $(shell find ./examples/templates)
3234
rm -rf ./dist
3335
mkdir -p ./dist
36+
rm -f ./site/out/bin/coder*
3437

3538
# build slim artifacts and copy them to the site output directory
3639
./scripts/build_go_slim.sh \

scripts/develop.sh

+10-3
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,15 @@ dependencies curl git go make yarn
1717
curl --fail http://127.0.0.1:3000 >/dev/null 2>&1 && echo '== ERROR: something is listening on port 3000. Kill it and re-run this script.' && exit 1
1818
curl --fail http://127.0.0.1:8080 >/dev/null 2>&1 && echo '== ERROR: something is listening on port 8080. Kill it and re-run this script.' && exit 1
1919

20-
echo '== Run "make build" before running this command to build binaries.'
21-
echo '== Without these binaries, workspaces will fail to start!'
20+
if [[ ! -e ./site/out/bin/coder.sha1 && ! -e ./site/out/bin/coder.tar.zst ]]; then
21+
log
22+
log "======================================================================="
23+
log "== Run 'make bin' before running this command to build binaries. =="
24+
log "== Without these binaries, workspaces will fail to start! =="
25+
log "======================================================================="
26+
log
27+
exit 1
28+
fi
2229

2330
# Run yarn install, to make sure node_modules are ready to go
2431
"$PROJECT_ROOT/scripts/yarn_install.sh"
@@ -28,7 +35,7 @@ echo '== Without these binaries, workspaces will fail to start!'
2835
# https://stackoverflow.com/questions/3004811/how-do-you-run-multiple-programs-in-parallel-from-a-bash-script
2936
(
3037
SCRIPT_PID=$$
31-
cd "${PROJECT_ROOT}"
38+
cdroot
3239
CODERV2_HOST=http://127.0.0.1:3000 INSPECT_XSTATE=true yarn --cwd=./site dev || kill -INT -${SCRIPT_PID} &
3340
go run -tags embed cmd/coder/main.go server --address 127.0.0.1:3000 --in-memory --tunnel || kill -INT -${SCRIPT_PID} &
3441

0 commit comments

Comments
 (0)