README.md in travis-backup-0.0.3 vs README.md in travis-backup-0.1.0

- old
+ new

@@ -1,9 +1,8 @@ # README -*travis-backup* is an application that removes builds and their corresponding jobs -and exports them (optionally) to json files. +*travis-backup* is an application that helps with housekeeping and backup for Travis CI database v2.2 and with migration to v3.0 database. ### Installation and run You can install the gem using @@ -25,10 +24,13 @@ -t, --threshold MONTHS # number of months from now - data younger than this time won't be backuped -f, --files_location PATH # path of the folder in which backup files will be placed -u, --user_id ID # run only for given user -o, --org_id ID # run only for given organization -r, --repo_id ID # run only for given repository + --move_logs # run in move logs mode - move all logs to database at destination_db_url URL + --destination_db_url URL # URL for moving logs to + --remove_orphans # run in remove orphans mode ``` Or inside your app: ``` @@ -52,14 +54,22 @@ backup.run(org_id: 1) # or backup.run(repo_id: 1) ``` -### Configuration +#### Special modes -Despite of command line arguments, one of the ways you can configure your export is a file `config/settinigs.yml` that you can place in your app's main directory. The gem expects properties in the following format: +Using `--move_logs` flag you can move all logs to database at `destination_db_url` URL (which is required in this case). When you run gem in this mode no files are created and no other tables are being touched. +Using `--remove_orphans` flag you can remove all orphaned data from tables. When you run gem in this mode no files are created. + +Using `--dry_run` flag you can check which data would be removed by gem, but without removing them actually. Instead of that reports will be printed on standard output. This flag can be also combined with `--move_logs` or `--remove_orphans`. + +### Configuration options + +Despite of command line arguments, one of the ways you can configure your export is a file `config/settings.yml` that you can place in your app's main directory. The gem expects properties in the following format: + ``` backup: if_backup: true # when false, removes data without saving it to file dry_run: false # when true, only prints in console what data should be backuped and deleted limit: 1000 # builds limit for one backup file @@ -86,12 +96,12 @@ ``` bundle exec rspec ``` -To make tests working properly you should also ensure the database connection string for an empty test database. You can set it as `DATABASE_URL` environment variable or in `config/database.yml`. +To make tests working properly you should also ensure database connection strings for empty test databases. You can set them as `DATABASE_URL` and `BACKUP_DESTINATION_DB_URL` environment variables or in `config/database.yml`. -**Warning: this database will be cleaned during tests, so ensure that it includes no important data.** +**Warning: these databases will be cleaned during tests, so ensure that they include no important data.** ### Ruby version 2.7.2