Skip to content

Commit

Permalink
Add task to build the API server binary
Browse files Browse the repository at this point in the history
  • Loading branch information
96malhar committed Dec 11, 2023
1 parent 2fb4d61 commit a81f90b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ tasks:
cmds:
- go run ./cmd/api -help

server:build:
desc: Build the Greenlight API server
cmds:
- go build -ldflags '-s' -o ./bin/api ./cmd/api

server:start:
desc: Start the Greenlight API server
cmds:
Expand Down
4 changes: 2 additions & 2 deletions load_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ cleanup() {

setup() {
# Build the Go binary
go build -o ./bin/server ./cmd/api
go build -o ./bin/api ./cmd/api

# Start the web server in the background and discard all output
./bin/server -limiter-enabled=false > /dev/null &
./bin/api -limiter-enabled=false > /dev/null &

# Capture the PID of the server process so we can kill it later
serverPid=$!
Expand Down
4 changes: 2 additions & 2 deletions smoke_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ cleanup() {
}

# Build the Go binary
go build -o ./bin/server ./cmd/api
go build -o ./bin/api ./cmd/api

# Start the web server in the background
./bin/server &
./bin/api &

# Capture the PID of the server process so we can kill it later
PID=$!
Expand Down

0 comments on commit a81f90b

Please sign in to comment.