-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from amsprost/development
Development
- Loading branch information
Showing
36 changed files
with
5,466 additions
and
21 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,12 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_style = space | ||
indent_size = 2 | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.php] | ||
indent_size = 4 |
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,4 @@ | ||
# define your env variables for the test env here | ||
KERNEL_CLASS='App\Kernel' | ||
APP_SECRET='$ecretf0rt3st' | ||
SYMFONY_DEPRECATIONS_HELPER=999999 |
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 @@ | ||
composer run qa-checks |
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,36 @@ | ||
{ | ||
"types": [ | ||
{ | ||
"type": "feat", | ||
"section": "Features" | ||
}, | ||
{ | ||
"type": "fix", | ||
"section": "Bug Fixes" | ||
}, | ||
{ | ||
"type": "docs", | ||
"section": "Documentation" | ||
}, | ||
{ | ||
"type": "test", | ||
"section": "Tests" | ||
}, | ||
{ | ||
"type": "build", | ||
"section": "Build System" | ||
}, | ||
{ | ||
"type": "ci" | ||
}, | ||
{ | ||
"type": "chore", | ||
"section": "Chores" | ||
}, | ||
{ | ||
"type": "deps", | ||
"section": "Dependencies" | ||
} | ||
], | ||
"issueUrlFormat": "https://team.linkorb.com/cards/{{id}}" | ||
} |
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,35 @@ | ||
Table Archiver | ||
============== | ||
This is a CLI tool to export old data from any SQL database table into ranged ndjson files | ||
that you can then wherever you like. | ||
|
||
## Installation | ||
|
||
git clone [email protected]:linkorb/table-archiver.git | ||
cd table-archiver | ||
docker-compose up -d | ||
docker-compose exec app composer install # install PHP dependencies | ||
|
||
## Usage | ||
Command looks like: | ||
|
||
./bin/console linkorb:table:archive {db_dsn} {table_name} {mode} {date_column} [max_stamp]\ | ||
See `./bin/console linkorb:table:archive --help` for more info | ||
|
||
(To run it from docker container you need to prepend it with `docker-compose exec app `...) | ||
|
||
All gzipped [ndjson](http://ndjson.org/) files can be found under `./output` directory | ||
|
||
If you want to change threads number you can do that easily by changing `APP_THREADS_NUMBER` in `.env` | ||
|
||
With big date ranges it's recommended to run command with disabled (or increased) memory limit | ||
(prepended `php -d memory_limit=-1`). If that's not an option you can bypass caching for writers by passing `no-cache` | ||
option. Be aware that this setting noticeable affects performance. | ||
|
||
### Example: | ||
|
||
./bin/console linkorb:table:archive mysql://root:[email protected]:3306/test target_table YEAR_MONTH_DAY timestamp 20200101 | ||
|
||
## Git hooks | ||
|
||
There are some git hooks under `.hooks` directory. Feel free to copy & adjust & use them |
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,13 @@ | ||
#!/usr/bin/env php | ||
<?php | ||
|
||
if (!file_exists(dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php')) { | ||
echo "Unable to find the `simple-phpunit.php` script in `vendor/symfony/phpunit-bridge/bin/`.\n"; | ||
exit(1); | ||
} | ||
|
||
if (false === getenv('SYMFONY_PHPUNIT_DIR')) { | ||
putenv('SYMFONY_PHPUNIT_DIR='.__DIR__.'/.phpunit'); | ||
} | ||
|
||
require dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php'; |
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,3 @@ | ||
module.exports = { | ||
extends: ['@commitlint/config-conventional'] | ||
}; |
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
Oops, something went wrong.