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

#25 - Documentation enhancements #37

Merged
merged 1 commit into from
Jul 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 .driver/config.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
configuration:
compress-output: true
test:
value: unknown
value: unknown
43 changes: 43 additions & 0 deletions .driver/connections.yaml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
connections:
database: mysql # Currently, this is the only supported engine.
webhooks: # OPTIONAL
post-url: # When the process is complete, Driver will ping this URL.
transform-url: # During the transformation process, Driver will ping this URL with connection information.
# You could write your own scripts to be executed at this URL.
auth:
user: # For HTTP basic authentication
password: # For HTTP basic authentication
mysql: # Source database connection information
database: # REQUIRED: database name
charset: # defaults to utf8
engine: mysql
port: # defaults to 3306
host: # defaults to 127.0.0.1
user: # REQUIRED: database username
password: # REQUIRED: database password
dump-path: # Where to put the dumps while they are transitioning between the server and RDS, defaults to /tmp
s3:
engine: s3
key: # REQUIRED: your S3 login key (can be the same as RDS if both access policies are allowed)
secret: # REQUIRED: your S3 login secret
bucket: # REQUIRED: which bucket would like this dumped into?
region: # defaults to us-east-1
compressed-file-key: # name in the bucket for a compressed file, e.g. dump{{environment}}.sql.gz
uncompressed-file-key: # name for an uncompressed file, e.g. dump{{environment}}.sql
# It is recommended to include {{environment}} in the filename to avoid multiple environments overwriting the file.
rds:
key: # REQUIRED: your RDS login key
secret: # REQUIRED: your RDS login secret
region: #defaults to us-east-1
## BEGIN NEW RDS INSTANCE:
instance-type: # defaults to db.t3.medium, other options can be found at https://aws.amazon.com/rds/instance-types/
engine: # defaults to MySQL
storage-type: # defaults to gp2
## END NEW RDS INSTANCE
## BEGIN EXISTING RDS INSTANCE:
instance-identifier:
instance-username:
instance-password:
instance-db-name:
security-group-name:
## END EXISTING RDS INSTANCE
24 changes: 24 additions & 0 deletions .driver/connections.yaml.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
connections:
database: mysql
mysql:
engine: mysql
host: localhost
database: some_db
user: some_user
password: "sdf93mSDF,os,of3Spwer/df"
s3:
engine: s3
key: SDF83K0N3IDSL29ZMEIH
secret: "kF9kwnf,mo3fFoaow+3mda/439a,Dlwommw9021m"
bucket: some-bucket
compressed-file-key: dump{{environment}}.sql.gz
uncompressed-file-key: dump{{environment}}.sql
region: us-east-2
rds:
key: SDF83K0N3IDSL29ZMEIH
secret: "kF9kwnf,mo3fFoaow+3mda/439a,Dlwommw9021m"
region: us-east-2
ec2:
key: SDF83K0N3IDSL29ZMEIH
secret: "kF9kwnf,mo3fFoaow+3mda/439a,Dlwommw9021m"
region: us-east-2
14 changes: 14 additions & 0 deletions .driver/environments.yaml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
environments:
ENVIRONMENT_NAME: # Change ENVIRONMENT_NAME to some concrete name like "local", you can define multiple environments.
sort: # REQUIRED: numeric value, lower runs sooner, higher runs later.
transformations: # OPTIONAL
TABLE_NAME: # Change TABLE_NAME to real name of database table you would like to transform with SQL query.
# You can define multiple tables.
- "UPDATE {{table_name}} SET value = 'example' WHERE path = 'id';" # You can list here multiple UPDATE queries.
# The {{table_name}} is substituted for the `TABLE_NAME` reference above.
# Driver will look for a table that ends with `TABLE_NAME`.
# For example, if your `TABLE_NAME` is `core_config_data`, Driver will search for a table in the database that
# ends with `core_config_data`. Thus, `core_config_data` and `sample_core_config_data` would all match.
ignored_tables: # OPTIONAL, tables listed here will be ignored in the final dump with:
# mysqldump ... --ignored-tables=DATABASE.table_1
- TABLE_NAME
76 changes: 76 additions & 0 deletions .driver/environments.yaml.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
environments:
staging:
sort: 100
transformations:
mview_state:
- "UPDATE {{table_name}} SET mode = 'disabled';"
core_config_data:
- "UPDATE {{table_name}} SET value = 'https://staging.store.com/' WHERE path LIKE 'web/%secure/base_url' AND scope_id = 0;"
- "UPDATE {{table_name}} SET value = 'staging.store.com' WHERE path LIKE 'web/cookie/cookie_domain' AND scope_id = 0;"
local:
sort: 200
transformations:
admin_user:
- "DELETE FROM {{table_name}};"
- "ALTER TABLE {{table_name}} AUTO_INCREMENT = 1;"
- "INSERT INTO {{table_name}} (firstname, lastname, email, username, password) VALUES ('SwiftOtter', 'Studios', 'joseph@swiftotter.com', 'admin', CONCAT(SHA2('xxxxxxxxswiftotter123', 256), ':xxxxxxxx:1'));"
authorization_role:
- "DELETE FROM {{table_name}};"
- "ALTER TABLE {{table_name}} AUTO_INCREMENT = 1;"
- "INSERT INTO {{table_name}} (role_id, parent_id, tree_level, sort_order, role_type, user_id, user_type, role_name) VALUES (1, '0','1','1','G','0','2','Administrators');"
- "INSERT INTO {{table_name}} (role_id, parent_id, tree_level, sort_order, role_type, user_id, user_type, role_name) VALUES (2, '1','2','0','U','1','2','swiftotter');"
authorization_rule:
- "DELETE FROM {{table_name}};"
- "ALTER TABLE {{table_name}} AUTO_INCREMENT = 1;"
- "INSERT INTO {{table_name}} (role_id, resource_id, permission) VALUES ('1', 'Magento_Backend::all', 'allow');"
- "INSERT INTO {{table_name}} (role_id, resource_id, permission) VALUES ('2', 'Magento_Backend::all', 'allow');"
core_config_data:
- "UPDATE {{table_name}} SET value = 'https://store.local/' WHERE path LIKE 'web/%secure/base_url' AND scope_id = 0;"
- "UPDATE {{table_name}} SET value = 'store.local' WHERE path LIKE 'web/cookie/cookie_domain' AND scope_id = 0;"
- "UPDATE {{table_name}} SET value = 'localhost' WHERE path LIKE 'catalog/search/elasticsearch%_server_hostname' AND scope_id = 0;"
ignored_tables:
- setup_module
- customer_address_entity
- customer_address_entity_datetime
- customer_address_entity_decimal
- customer_address_entity_int
- customer_address_entity_text
- customer_address_entity_varchar
- customer_entity
- customer_entity_datetime
- customer_entity_decimal
- customer_entity_int
- customer_entity_text
- customer_entity_varchar
- sales_creditmemo
- sales_credimemo_comment
- sales_creditmemo_grid
- sales_creditmemo_item
- sales_invoice
- sales_invoice_comment
- sales_invoice_grid
- sales_invoice_item
- sales_order
- sales_order_address
- sales_order_grid
- sales_order_item
- sales_order_payment
- sales_order_status_history
- sales_shipment
- sales_shipment_comment
- sales_shipment_grid
- sales_shipment_item
- sales_shipment_track
- sales_invoiced_aggregated
- sales_invoiced_aggregated_order
- sales_payment_transaction
- sales_order_aggregated_created
- sales_order_tax
- sales_order_tax_item
- sales_quote
- sales_quote_address
- sales_quote_address_item
- sales_quote_item
- sales_quote_item_option
- sales_quote_payment
- sales_quote_shipping_rate
51 changes: 2 additions & 49 deletions .driver/pipelines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,55 +7,8 @@
# at specific environments (like staging and local).

pipelines:
default: # pipeline span, usually default is the only one
- name: setup # pipeline stage
sort: 100
actions:
- name: connect
sort: 100
- name: check-filesystem
sort: 200
- name: start-sandbox
sort: 300

- name: import
sort: 200
actions:
- name: export-data-from-system-primary
sort: 100
- name: import-data-into-sandbox
sort: 200

- name: global-commands
sort: 300
actions:
- name: reduce
sort: 100
- name: anonymize
sort: 200
- name: update-values
sort: 300

- name: repeat-commands
sort: 400
actions:
- name: run-transformations
sort: 100
- name: connect
sort: 200
- name: export-data-from-sandbox
sort: 300
- name: upload-data-to-s3
sort: 400

- name: shutdown
sort: 600
actions:
- name: shutdown-sandbox
sort: 100

tag: # pipeline span, usually default is the only one
- name: setup # pipeline stage
build:
- name: setup
sort: 100
actions:
- name: connect
Expand Down
Loading