-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* updated database to be an env * removed git modules add DBT_POSTGRES_HOST * initial script setup * began writing script for generating configuration files * completed building scripts waiting on adding tests * fixed script generation bug * removed unused variable * structuring docker bootstrap * removed all docker settings * fixed the docker startup bug in bootstrapper * about to pull in bug fix * production readygit add .git add . * fixed ci build bug * removed makefile because it's useless * added default database and version listing * updated documentation to give instructions on adding databases * added typescript to the dependencies * removed the wrong tsc compiler * escaped characters in .env * fixed dbt transformation issue * added postgres table to env templates * removed postgres table * added postgres table for dbt * added comments * Update README.md Co-authored-by: Lore <lorerod@gmail.com> * Update README.md Co-authored-by: Lore <lorerod@gmail.com> * Update env.template Co-authored-by: Lore <lorerod@gmail.com> * Update README.md Co-authored-by: Lore <lorerod@gmail.com> --------- Co-authored-by: Lore <lorerod@gmail.com>
- Loading branch information
1 parent
e563c35
commit cd10db0
Showing
20 changed files
with
4,484 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"env": { | ||
"es2021": true, | ||
"node": true | ||
}, | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended" | ||
], | ||
"overrides": [ | ||
], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": "latest", | ||
"sourceType": "module" | ||
}, | ||
"plugins": [ | ||
"@typescript-eslint" | ||
], | ||
"rules": { | ||
"indent": [ | ||
"error", | ||
"space" | ||
], | ||
"linebreak-style": [ | ||
"error", | ||
"unix" | ||
], | ||
"quotes": [ | ||
"error", | ||
"double" | ||
], | ||
"semi": [ | ||
"error", | ||
"always" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
.env | ||
node_modules | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM curlimages/curl | ||
|
||
WORKDIR /app | ||
|
||
COPY ./start.sh ./start.sh | ||
|
||
ENTRYPOINT ["/bin/sh", "/app/start.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from urllib import request | ||
import os | ||
import time | ||
import json | ||
import base64 | ||
import time | ||
import glob | ||
|
||
credentials = ('%s:%s' % (os.getenv("COUCHDB_USER"), os.getenv("COUCHDB_PASSWORD"))) | ||
encoded_credentials = base64.b64encode(credentials.encode('ascii')).decode("ascii") | ||
|
||
|
||
for db in os.getenv("COUCHDB_DBS").split(" "): | ||
url = os.path.join(os.getenv("COUCHDB_URL"), db) | ||
|
||
for doc_path in glob.glob(os.getenv("DOCS_PATH")+"/*.json"): | ||
with open(doc_path, "rb") as doc_file: | ||
doc = json.loads(doc_file.read()) | ||
|
||
req = request.Request( | ||
os.path.join(url, doc["_id"]), | ||
data=json.dumps(doc).encode("utf-8"), | ||
method='PUT' | ||
) | ||
|
||
req.add_header('Authorization', 'Basic %s' % encoded_credentials) | ||
|
||
try: | ||
res = request.urlopen(req) | ||
print(doc_path, res.info()) | ||
except Exception as e: | ||
print(e) | ||
time.sleep(2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!bin/bash | ||
|
||
curl -X PUT http://${COUCHDB_USER}:${COUCHDB_PASSWORD}@couchdb:5984/_users | ||
|
||
for DB in $COUCHDB_DBS; do | ||
curl -X PUT http://${COUCHDB_USER}:${COUCHDB_PASSWORD}@couchdb:5984/${DB} | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
|
||
input { | ||
couchdb_changes { | ||
always_reconnect => true | ||
db => "couchdb_sentinel" | ||
host => "${COUCHDB_HOST}" | ||
username => "${COUCHDB_USER}" | ||
password => "${COUCHDB_PASSWORD}" | ||
keep_id => true | ||
keep_revision => true | ||
secure => "${COUCHDB_SECURE}" | ||
port => "${COUCHDB_PORT}" | ||
sequence_path => "${COUCHDB_SEQ}" | ||
} | ||
} | ||
|
||
filter { | ||
json{ | ||
source => "message" | ||
} | ||
mutate { | ||
add_field => { "_id" => "%{[doc][_id]}" } | ||
add_field => { "_rev" => "%{[doc][_rev]}" } | ||
} | ||
} | ||
|
||
output { | ||
http { | ||
format => "json" | ||
http_method => "post" | ||
ignorable_codes => 409 | ||
url => "http://${HTTP_ENDPOINT}/couchdb_sentinel" | ||
} | ||
} |
Oops, something went wrong.