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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: da5ede447a9a2a1b215d03d8582f62e8c4573e69e3337da91afaaffef07323f3
4
- data.tar.gz: 01bc3c92f48f093ae3dd4ff23c07a0f2e9c5516b79c05279700d82570b0a2d40
3
+ metadata.gz: f8b5825713610ce11c333d20573340404da43e46afadad8a8149b35194aa371e
4
+ data.tar.gz: acc50d6c047c57af32368a5fcd634e130a9ccab611222f1bf8b235be26e474fb
5
5
  SHA512:
6
- metadata.gz: 775e8b95e35be972da5194d703d33645bfe21198d91f28efe2a417214d74e4fc71fee5a9c6d7a715ae2819b8d12a0b0bad691bca44b507782acd1dbf48c43d16
7
- data.tar.gz: 289107dfc9d91b3cc43479c1a4973fe0fec4db91a519dd9cd8be321c9ce56f65e2170464ae3c88492385af5609d0ea52bfbe9d7510f1a44bcffa8f1dfea81b63
6
+ metadata.gz: 14ac9ae0fdc86e32e68dc396a8ad02cc0adf988a6614146ba46c2353a290d4e57d33e5ead26a5cb7f8f8d6c4654c1833fb71af0ce9725d0431e5698d9c984adc
7
+ data.tar.gz: b07f0529a93a964f3280daaad33ceaff21c547438d93709c256b905cc8325e5cdfaf5d74204a0a31cd0fa497e43958f789dd66b600d1c5e131a9c74f50003222
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- travis-backup (0.1.0)
4
+ travis-backup (0.1.1)
5
5
  activerecord
6
6
  bootsnap
7
7
  pg
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 # run only for given user
79
- org_id # run only for given organization
80
- repo_id # run only for given repository
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`, `USER_ID`, `ORG_ID`, `REPO_ID`.
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['USER_ID'],
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['REPO_ID'],
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['ORG_ID'],
82
+ ENV['BACKUP_ORG_ID'],
83
83
  config.dig('backup', 'org_id')
84
84
  )
85
85
  @move_logs = first_not_nil(
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'travis-backup'
3
- s.version = '0.1.0'
3
+ s.version = '0.1.1'
4
4
  s.summary = 'Travis CI backup tool'
5
5
  s.authors = ['Karol Selak']
6
6
  s.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: travis-backup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karol Selak