Skip to content

Commit

Permalink
feat: initialize db task.
Browse files Browse the repository at this point in the history
  • Loading branch information
l-monninger committed Jan 24, 2024
1 parent 0e59811 commit 1d81896
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,9 @@ jobs:
run: |
cd aws/lambda/log_status_ship
docker buildx build --platform linux/amd64,linux/arm64 -t mvlbs/log-status-lambda-ship:latest --push .
- name: Build and push Docker image (aws/lambda/log_status_ship)
run: |
cd tasks/initialize-db
docker buildx build --platform linux/amd64,linux/arm64 -t mvlbs/log-status-initialize-db:latest --push .
3 changes: 3 additions & 0 deletions tasks/initialize-db/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM postgres:latest
COPY init-db.sql /docker-entrypoint-initdb.d/init-db.sql
CMD ["psql", "-f", "/docker-entrypoint-initdb.d/init-db.sql"]
11 changes: 11 additions & 0 deletions tasks/initialize-db/init-db.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
CREATE TABLE IF NOT EXISTS LatestHealthChecks (
PRIMARY KEY (health_check, "group"),
health_check VARCHAR(255),
"group" VARCHAR(255),
status BOOLEAN,
reason TEXT
);

-- Add health checks
INSERT INTO LatestHealthChecks (health_check, "group", status, reason) VALUES
('log-table-creation', 'LogStatus', true, 'Pipeline was able to initialize LogStatus table.'),

0 comments on commit 1d81896

Please sign in to comment.