Skip to content

fix: Wait for server start in scripts/develop.sh #2573

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

Closed
wants to merge 1 commit into from
Closed
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
10 changes: 6 additions & 4 deletions scripts/develop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ echo '== Without these binaries, workspaces will fail to start!'
CODERV2_HOST=http://127.0.0.1:3000 INSPECT_XSTATE=true yarn --cwd=./site dev &
go run -tags embed cmd/coder/main.go server --in-memory --tunnel &

# Just a minor sleep to ensure the first user was created to make the member.
sleep 2
# Ensure the API is up before logging in.
while ! curl -s --fail localhost:3000/api/v2/ >/dev/null; do
sleep 0.5
done

# create the first user, the admin
# Create the first user, the admin.
go run cmd/coder/main.go login http://127.0.0.1:3000 --username=admin --email=admin@coder.com --password=password || true

# || yes to always exit code 0. If this fails, whelp.
go run cmd/coder/main.go users create --email=member@coder.com --username=member --password="${CODER_DEV_ADMIN_PASSWORD}" || true
go run cmd/coder/main.go users create --email=member@coder.com --username=member --password=password || true
wait
)