travis-backup 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +9 -5
- data/lib/config.rb +3 -3
- data/travis-backup.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8b5825713610ce11c333d20573340404da43e46afadad8a8149b35194aa371e
|
4
|
+
data.tar.gz: acc50d6c047c57af32368a5fcd634e130a9ccab611222f1bf8b235be26e474fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14ac9ae0fdc86e32e68dc396a8ad02cc0adf988a6614146ba46c2353a290d4e57d33e5ead26a5cb7f8f8d6c4654c1833fb71af0ce9725d0431e5698d9c984adc
|
7
|
+
data.tar.gz: b07f0529a93a964f3280daaad33ceaff21c547438d93709c256b905cc8325e5cdfaf5d74204a0a31cd0fa497e43958f789dd66b600d1c5e131a9c74f50003222
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# README
|
2
2
|
|
3
|
-
*travis-backup* is an application that helps with housekeeping and backup for Travis CI database v2.2 and with migration to v3.0 database.
|
3
|
+
*travis-backup* is an application that helps with housekeeping and backup for Travis CI database v2.2 and with migration to v3.0 database. By default it removes requests and builds with their corresponding jobs and logs, as long as they are older than given threshold says (and backups them in files, if this option is active). Although it can be also run with special modes: `move_logs`, for moving logs from one database to another, and `remove_orphans`, for deleting all orphaned data.
|
4
4
|
|
5
5
|
### Installation and run
|
6
6
|
|
@@ -75,15 +75,19 @@ backup:
|
|
75
75
|
limit: 1000 # builds limit for one backup file
|
76
76
|
threshold: 6 # number of months from now - data younger than this time won't be backuped
|
77
77
|
files_location: './dump' # path of the folder in which backup files will be placed
|
78
|
-
user_id
|
79
|
-
org_id
|
80
|
-
repo_id
|
78
|
+
user_id: 1 # run only for given user
|
79
|
+
org_id: 1 # run only for given organization
|
80
|
+
repo_id: 1 # run only for given repository
|
81
|
+
move_logs: false # run in move logs mode - move all logs to database at destination_db_url URL
|
82
|
+
remove_orphans: false # run in remove orphans mode
|
81
83
|
```
|
82
84
|
|
83
|
-
You can also set these properties using env vars corresponding to them: `IF_BACKUP`, `BACKUP_DRY_RUN`, `BACKUP_LIMIT`, `BACKUP_THRESHOLD`, `BACKUP_FILES_LOCATION`, `
|
85
|
+
You can also set these properties using env vars corresponding to them: `IF_BACKUP`, `BACKUP_DRY_RUN`, `BACKUP_LIMIT`, `BACKUP_THRESHOLD`, `BACKUP_FILES_LOCATION`, `BACKUP_USER_ID`, `BACKUP_ORG_ID`, `BACKUP_REPO_ID`, `BACKUP_MOVE_LOGS`, `BACKUP_REMOVE_ORPHANS`.
|
84
86
|
|
85
87
|
You should also specify your database url. You can do this the standard way in `config/database.yml` file, setting the `database_url` hash argument while creating `Backup` instance or using the `DATABASE_URL` env var. Your database should be consistent with the Travis 2.2 database schema.
|
86
88
|
|
89
|
+
For `move_logs` mode you need also to specify a destination database. You can set it also in `config/database.yml` file, in `destination` subsection, setting the `destination_db_url` hash argument while creating `Backup` instance or using the `BACKUP_DESTINATION_DB_URL` env var. Your destination database should be consistent with the Travis 3.0 database schema.
|
90
|
+
|
87
91
|
### How to run the test suite
|
88
92
|
|
89
93
|
You can run the test after cloning this repository. Next you should call
|
data/lib/config.rb
CHANGED
@@ -67,19 +67,19 @@ class Config
|
|
67
67
|
@user_id = first_not_nil(
|
68
68
|
args[:user_id],
|
69
69
|
argv_opts[:user_id],
|
70
|
-
ENV['
|
70
|
+
ENV['BACKUP_USER_ID'],
|
71
71
|
config.dig('backup', 'user_id')
|
72
72
|
)
|
73
73
|
@repo_id = first_not_nil(
|
74
74
|
args[:repo_id],
|
75
75
|
argv_opts[:repo_id],
|
76
|
-
ENV['
|
76
|
+
ENV['BACKUP_REPO_ID'],
|
77
77
|
config.dig('backup', 'repo_id')
|
78
78
|
)
|
79
79
|
@org_id = first_not_nil(
|
80
80
|
args[:org_id],
|
81
81
|
argv_opts[:org_id],
|
82
|
-
ENV['
|
82
|
+
ENV['BACKUP_ORG_ID'],
|
83
83
|
config.dig('backup', 'org_id')
|
84
84
|
)
|
85
85
|
@move_logs = first_not_nil(
|
data/travis-backup.gemspec
CHANGED