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

Add bss-init to initialize Postgres DB #13

Merged
merged 21 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
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
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ RUN set -ex \
&& apk -U upgrade \
&& apk add --no-cache curl

# Get the boot-script-service from the builder stage.
# Get the boot-script-service and bss-init from the builder stage.
COPY boot-script-service /usr/local/bin/
COPY bss-init /usr/local/bin/
COPY migrations/* /migrations/
COPY .version /

# nobody 65534:65534
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# Service
NAME ?= bss
VERSION ?= $(shell cat .version)
BINARIES = boot-script-service
BINARIES = boot-script-service bss-init


all : image unittest ct snyk ct_image
Expand Down
6 changes: 0 additions & 6 deletions cmd/boot-script-service/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -473,12 +473,6 @@ func main() {
log.Fatalf("Access to Postgres database at %s:%d failed: %v\n", sqlHost, sqlPort, err)
}
defer sqlClose()

// Create database and tables (if they do not exist).
err = bssdb.CreateDB(bssdbName)
if err != nil {
log.Fatalf("Creating Postgres database %q and tables failed: %v\n", bssdbName, err)
}
} else {
err = kvOpen(datastoreBase, svcOpts, kvRetryCount, kvRetryWait)
if err != nil {
Expand Down
Loading