landscape-turner 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: b91db91275ab5c80b11a340bf00aecd646f8fc67
4
+ data.tar.gz: f9fac8e520093e561b4a76684b681968fe1eb0a3
5
+ SHA512:
6
+ metadata.gz: d35358bf352d04df8abd4898ba4328753a205fdcde33867cbb93073807d558070415678021536a51a966e37e5863308fc0f74a4a80aa8f99a37b3b10ce53361a
7
+ data.tar.gz: 73accf3046f3366e0be2bcf054ee86fb3866ff9f96eb23e5e64327a6849b17f0d99dabc28aaab8e8ea8f778128e34fa941cded45cb587c2617af081e146dcb59
data/README.md CHANGED
@@ -1,6 +1,10 @@
1
1
  # Landscape Turner
2
2
 
3
- Landscape Turner is a set of two ruby scripts for backing up the Landscape service, `landscape-turner-backup` and `landscape-turner-restore` .
3
+ Landscape Turner is a set of two ruby scripts for backing up the Landscape service, `landscape-turner-backup` and `landscape-turner-restore`.
4
+
5
+ ## License
6
+
7
+ Landscape Turner is MIT Licensed.
4
8
 
5
9
  ## General Usage
6
10
 
@@ -30,7 +34,6 @@ Path to prefix default landscape dirs (/var, /etc), default is nothing.
30
34
  ### -p, --no-op
31
35
  No-op (dry run)
32
36
 
33
-
34
37
  To override specific paths, use `-o name1=path1 -o name2=path2 -o name3=path3`. To disable specific paths for backup, use `-d name1 -d name2`. Overrides have higher priority than `--landscape-prefix`.
35
38
 
36
39
  ## Options for landscape-turner-restore
@@ -43,3 +46,13 @@ Disable database restore
43
46
 
44
47
 
45
48
  In addition to the optional arguments, you must specify exactly one .tar.gz file to restore.
49
+
50
+ ## Install
51
+
52
+ You can build Landscape Turner from the gemspec file like so:
53
+
54
+ `$ gem build landscape-turner.gemspec`
55
+
56
+ `$ sudo gem install landscape-turner-1.2.0.gem`
57
+
58
+ If you don't want to build from the gemspec yourself, you can install from rubygems with `$ sudo gem install landscape-turner`
data/Rakefile CHANGED
@@ -1,3 +1,8 @@
1
+ #
2
+ # Copyright 2016, DAQRI LLC.
3
+ #
4
+ # This code is covered by the MIT License (see LICENSE.txt)
5
+
1
6
  require "rake/testtask"
2
7
 
3
8
  Rake::TestTask.new do |t|
data/bin/console CHANGED
@@ -1,4 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
+ #
3
+ # Copyright 2016, DAQRI LLC.
4
+ #
5
+ # This code is covered by the MIT License (see LICENSE.txt)
2
6
 
3
7
  require "bundler/setup"
4
8
  require "landscape_turner"
data/bin/setup CHANGED
@@ -1,8 +1,11 @@
1
1
  #!/usr/bin/env bash
2
+ #
3
+ # Copyright 2016, DAQRI LLC.
4
+ #
5
+ # This code is covered by the MIT License (see LICENSE.txt)
6
+
2
7
  set -euo pipefail
3
8
  IFS=$'\n\t'
4
9
  set -vx
5
10
 
6
11
  bundle install
7
-
8
- # Do any other automated setup that you need to do here
@@ -1,4 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
+ #
3
+ # Copyright 2016, DAQRI LLC.
4
+ #
5
+ # This code is covered by the MIT License (see LICENSE.txt)
2
6
 
3
7
  require 'landscape-turner/backup'
4
8
 
@@ -1,10 +1,14 @@
1
1
  #!/usr/bin/env ruby
2
+ #
3
+ # Copyright 2016, DAQRI LLC.
4
+ #
5
+ # This code is covered by the MIT License (see LICENSE.txt)
2
6
 
3
7
  require 'landscape-turner/restore'
4
8
 
5
9
  if ENV['USER'] != "root"
6
10
  puts "You must have root permissions to run this tool."
7
- exit
11
+ exit
8
12
  end
9
-
13
+
10
14
  Restore.restore_with_cli_args
@@ -1,3 +1,8 @@
1
+ #
2
+ # Copyright 2016, DAQRI LLC.
3
+ #
4
+ # This code is covered by the MIT License (see LICENSE.txt)
5
+
1
6
  require_relative 'helpers'
2
7
  require 'fileutils'
3
8
  require 'pathname'
@@ -91,16 +96,16 @@ Names with default values:
91
96
  end
92
97
  # remove the folder where we stored everything
93
98
  operate ? FileUtils.remove_dir(destination) : nil
94
- puts "Finished backing up to #{destination}"
99
+ puts "Finished backing up to #{destination}"
95
100
  end
96
101
 
97
102
  def self.dump_landscape_databases(backup_destination)
98
103
  FileUtils.mkdir("#{backup_destination}/postgresql_backup") rescue nil
99
- get_landscape_databases().each { |database_name|
104
+ get_landscape_databases().each { |database_name|
100
105
  # pg_dump dbname > outfile
101
106
  safe_system("cd /tmp && sudo -u postgres pg_dump #{database_name} > #{database_name}.bak")
102
107
  FileUtils.mv("/tmp/#{database_name}.bak","#{backup_destination}/postgresql_backup/")
103
- }
108
+ }
104
109
  end
105
110
 
106
111
  def self.check_consistent_tar(destination)
@@ -110,7 +115,7 @@ Names with default values:
110
115
  hash_folder1 = Open3.capture3("find #{destination} -type f 2>/dev/null -exec md5sum {} \;")
111
116
  hash_folder2 = Open3.capture3("find /tmp/tar_check -type f 2>/dev/null -exec md5sum {} \;")
112
117
  FileUtils.rm_rf("/tmp/tar_check")
113
- return hash_folder1 == hash_folder2
118
+ return hash_folder1 == hash_folder2
114
119
  end
115
120
 
116
121
  end
@@ -1,3 +1,8 @@
1
+ #
2
+ # Copyright 2016, DAQRI LLC.
3
+ #
4
+ # This code is covered by the MIT License (see LICENSE.txt)
5
+
1
6
  require 'open3'
2
7
 
3
8
  module LandscapeTurner
@@ -1,3 +1,8 @@
1
+ #
2
+ # Copyright 2016, DAQRI LLC.
3
+ #
4
+ # This code is covered by the MIT License (see LICENSE.txt)
5
+
1
6
  require_relative 'helpers'
2
7
  require_relative 'backup'
3
8
  require 'fileutils'
@@ -55,7 +60,7 @@ In addition to optional arguments, give exactly one .tar.gz file to restore.
55
60
  with_service_stopped("postgresql") do
56
61
  replace(POSTGRES_CONFIG,"/tmp/landscape_backup/#{POSTGRES_CONFIG}")
57
62
  end
58
- end
63
+ end
59
64
 
60
65
  puts "Restoration of Landscape configuration completed."
61
66
 
@@ -68,7 +73,7 @@ In addition to optional arguments, give exactly one .tar.gz file to restore.
68
73
  puts "Copying #{filename} to #{File.dirname(filename_replace)}..."
69
74
  FileUtils.cp_r(filename, File.dirname(filename_replace), :preserve => true, :remove_destination => true)
70
75
  end
71
-
76
+
72
77
 
73
78
  def self.restore_landscape_databases(restore_location)
74
79
  #clear the databases first
@@ -83,5 +88,5 @@ In addition to optional arguments, give exactly one .tar.gz file to restore.
83
88
 
84
89
  end
85
90
 
86
-
91
+
87
92
  end
@@ -1,3 +1,8 @@
1
+ #
2
+ # Copyright 2016, DAQRI LLC.
3
+ #
4
+ # This code is covered by the MIT License (see LICENSE.txt)
5
+
1
6
  module LandscapeTurner
2
- VERSION = "1.2.0"
7
+ VERSION = "1.3.0"
3
8
  end
metadata CHANGED
@@ -1,36 +1,32 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: landscape-turner
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
5
- prerelease:
4
+ version: 1.3.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Justin Boisvert
9
8
  autorequire:
10
9
  bindir: exe
11
10
  cert_chain: []
12
- date: 2016-02-03 00:00:00.000000000 Z
11
+ date: 2016-05-06 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: trollop
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - '>='
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: bundler
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ~>
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ~>
44
39
  - !ruby/object:Gem::Version
@@ -46,7 +41,6 @@ dependencies:
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rake
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
45
  - - ~>
52
46
  - !ruby/object:Gem::Version
@@ -54,7 +48,6 @@ dependencies:
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
52
  - - ~>
60
53
  - !ruby/object:Gem::Version
@@ -62,17 +55,15 @@ dependencies:
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: minitest
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ! '>='
59
+ - - '>='
68
60
  - !ruby/object:Gem::Version
69
61
  version: '0'
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ! '>='
66
+ - - '>='
76
67
  - !ruby/object:Gem::Version
77
68
  version: '0'
78
69
  description: A backup tool for the Landscape service that backs up the configuration
@@ -100,26 +91,25 @@ files:
100
91
  - lib/landscape-turner/version.rb
101
92
  homepage: http://www.daqri.com
102
93
  licenses: []
94
+ metadata: {}
103
95
  post_install_message:
104
96
  rdoc_options: []
105
97
  require_paths:
106
98
  - lib
107
99
  required_ruby_version: !ruby/object:Gem::Requirement
108
- none: false
109
100
  requirements:
110
- - - ! '>='
101
+ - - '>='
111
102
  - !ruby/object:Gem::Version
112
103
  version: '0'
113
104
  required_rubygems_version: !ruby/object:Gem::Requirement
114
- none: false
115
105
  requirements:
116
- - - ! '>='
106
+ - - '>='
117
107
  - !ruby/object:Gem::Version
118
108
  version: '0'
119
109
  requirements: []
120
110
  rubyforge_project:
121
- rubygems_version: 1.8.23
111
+ rubygems_version: 2.4.8
122
112
  signing_key:
123
- specification_version: 3
113
+ specification_version: 4
124
114
  summary: Backup tool for the Landscape service
125
115
  test_files: []