-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
84 additions
and
55 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 |
---|---|---|
@@ -1,13 +1,20 @@ | ||
FROM python:3.10-slim | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y unixodbc libfbclient2 | ||
apt-get install -y unixodbc libfbclient2 gnupg curl ca-certificates apt-transport-https software-properties-common | ||
|
||
|
||
COPY install_ms_sql_driver.sh /tmp/install_ms_sql_driver.sh | ||
RUN chmod +x /tmp/install_ms_sql_driver.sh && \ | ||
/tmp/install_ms_sql_driver.sh && \ | ||
rm /tmp/install_ms_sql_driver.sh | ||
|
||
|
||
WORKDIR /usr/src/app | ||
|
||
COPY requirements.txt ./ | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
COPY . . | ||
COPY ./*.py . | ||
|
||
ENTRYPOINT ["python", "./sync.py"] |
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,50 +1,51 @@ | ||
firebird: | ||
db1: | ||
host: "localhost" | ||
host: localhost | ||
port: 3050 | ||
database: "/path/to/database1.fdb" | ||
user: "sysdba" | ||
password: "masterkey" | ||
database: /path/to/database1.fdb | ||
user: sysdba | ||
password: masterkey | ||
db2: | ||
host: "localhost" | ||
host: localhost | ||
port: 3050 | ||
database: "/path/to/database2.fdb" | ||
user: "sysdba" | ||
password: "masterkey" | ||
database: /path/to/database2.fdb | ||
user: sysdba | ||
password: masterkey | ||
|
||
mssql: | ||
db1: | ||
server: "localhost" | ||
database: "mydatabase1" | ||
user: "sa" | ||
password: "mypassword" | ||
server: localhost | ||
database: mydatabase1 | ||
user: sa | ||
password: mypassword | ||
trust_server_certificate: true | ||
db2: | ||
server: "localhost" | ||
database: "mydatabase2" | ||
user: "sa" | ||
password: "mypassword" | ||
server: localhost | ||
database: mydatabase2 | ||
user: sa | ||
password: mypassword | ||
|
||
frappe_auth: | ||
api_key: "your_api_key" | ||
api_secret: "your_api_secret" | ||
api_key: your_api_key | ||
api_secret: your_api_secret | ||
|
||
tasks: | ||
- endpoint: "http://frappe.example.com/api/resource/Doctype" | ||
query: "SELECT id, name FROM table" | ||
- endpoint: https://frappe.example.com/api/resource/Doctype | ||
query: SELECT id, name FROM table | ||
mapping: | ||
"frappe_field_1": "id" | ||
"frappe_field_2": "name" | ||
db_type: "firebird" | ||
db_name: "db1" | ||
direction: "db_to_frappe" | ||
key_fields: ["frappe_field_1"] | ||
frappe_field_1: id | ||
frappe_field_2: name | ||
db_type: firebird | ||
db_name: db1 | ||
direction: db_to_frappe | ||
key_fields: [frappe_field_1] | ||
|
||
- endpoint: "http://frappe.example.com/api/resource/OtherDoctype" | ||
table_name: "my_table" | ||
- endpoint: https://frappe.example.com/api/resource/OtherDoctype | ||
table_name: my_table | ||
mapping: | ||
"frappe_field_a": "code" | ||
"frappe_field_b": "description" | ||
db_type: "mssql" | ||
db_name: "db2" | ||
direction: "frappe_to_db" | ||
key_fields: ["code"] | ||
frappe_field_a: code | ||
frappe_field_b: description | ||
db_type: mssql | ||
db_name: db2 | ||
direction: frappe_to_db | ||
key_fields: [code] |
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,17 @@ | ||
set -e | ||
|
||
apt-get update | ||
apt-get install -y curl | ||
|
||
# Debian 12 | ||
curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg | ||
|
||
#Debian 12 | ||
curl https://packages.microsoft.com/config/debian/12/prod.list | tee /etc/apt/sources.list.d/mssql-release.list | ||
|
||
apt-get update | ||
ACCEPT_EULA=Y apt-get install -y msodbcsql18 | ||
# optional: for bcp and sqlcmd | ||
# ACCEPT_EULA=Y apt-get install -y mssql-tools18 | ||
# echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bashrc | ||
# source ~/.bashrc |