datadog_backup 0.9.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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 1a8dbd6b3fdd5e8369259f165b7117ed2234451aae4efb305a341a22e928f555
4
+ data.tar.gz: eb1514dd4d63b025f2b32e10795f489a845789162661a2c2d0fa369030cd0c0f
5
+ SHA512:
6
+ metadata.gz: d01dbaf32507d8852bec2fb3f6c6615d135c124a6173071c31aceba0d9bc342dfad9985641ce80b976c138cfb4d4ed5c1507d80256f1d471871cfd5f173331cb
7
+ data.tar.gz: 71d9c25ded490956078fdb8bd563ad1e69d7aaa71c0d8fc35c10dd03fe941c094f91f4ad20b43526163b336540984bf7713c487345bdbe7d183f99ed0f896729
@@ -0,0 +1,54 @@
1
+ name: Rspec and Release
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+ workflow_dispatch:
7
+
8
+ jobs:
9
+ rspec:
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - uses: actions/checkout@v2
14
+ - name: Set up Ruby 2.7.1
15
+ uses: actions/setup-ruby@v1
16
+ with:
17
+ ruby-version: 2.7.1
18
+ - name: Test with Rspec
19
+ run: |
20
+ gem install --no-document bundler
21
+ bundle install --jobs 4 --retry 3
22
+ bundle exec rspec --format documentation
23
+ release:
24
+ if: github.event_name == 'push'
25
+ needs: rspec
26
+ runs-on: ubuntu-latest
27
+
28
+ steps:
29
+ - uses: actions/checkout@v2
30
+ - name: Set up Ruby 2.7.1
31
+ uses: actions/setup-ruby@v1
32
+ with:
33
+ ruby-version: 2.7.1
34
+ - name: Build with bundler
35
+ run: |
36
+ gem install --no-document bundler
37
+ bundle config set deployment 'true'
38
+ bundle config set without 'development test'
39
+ bundle install --jobs 4 --retry 3
40
+ - name: Zip
41
+ run : |
42
+ zip -r datadog_backup.zip ./*
43
+ - name: Semantic Release
44
+ id: semantic
45
+ uses: cycjimmy/semantic-release-action@v2
46
+ env:
47
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48
+ GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_API_TOKEN }}
49
+ with:
50
+ semantic_version: 17
51
+ extra_plugins: |
52
+ @semantic-release/changelog
53
+ @semantic-release/git
54
+ semantic-release-rubygem
@@ -0,0 +1,119 @@
1
+ # Created by https://www.gitignore.io
2
+
3
+ ### OSX ###
4
+ .DS_Store
5
+ .AppleDouble
6
+ .LSOverride
7
+
8
+ # Icon must end with two \r
9
+ Icon
10
+
11
+
12
+ # Thumbnails
13
+ ._*
14
+
15
+ # Files that might appear in the root of a volume
16
+ .DocumentRevisions-V100
17
+ .fseventsd
18
+ .Spotlight-V100
19
+ .TemporaryItems
20
+ .Trashes
21
+ .VolumeIcon.icns
22
+
23
+ # Directories potentially created on remote AFP share
24
+ .AppleDB
25
+ .AppleDesktop
26
+ Network Trash Folder
27
+ Temporary Items
28
+ .apdisk
29
+
30
+
31
+ ### RubyMine ###
32
+ # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm
33
+
34
+ *.iml
35
+
36
+ ## Directory-based project format:
37
+ .idea/
38
+ # if you remove the above rule, at least ignore the following:
39
+
40
+ # User-specific stuff:
41
+ # .idea/workspace.xml
42
+ # .idea/tasks.xml
43
+ # .idea/dictionaries
44
+
45
+ # Sensitive or high-churn files:
46
+ # .idea/dataSources.ids
47
+ # .idea/dataSources.xml
48
+ # .idea/sqlDataSources.xml
49
+ # .idea/dynamic.xml
50
+ # .idea/uiDesigner.xml
51
+
52
+ # Gradle:
53
+ # .idea/gradle.xml
54
+ # .idea/libraries
55
+
56
+ # Mongo Explorer plugin:
57
+ # .idea/mongoSettings.xml
58
+
59
+ ## File-based project format:
60
+ *.ipr
61
+ *.iws
62
+
63
+ ## Plugin-specific files:
64
+
65
+ # IntelliJ
66
+ /out/
67
+
68
+ # mpeltonen/sbt-idea plugin
69
+ .idea_modules/
70
+
71
+ # JIRA plugin
72
+ atlassian-ide-plugin.xml
73
+
74
+ # Crashlytics plugin (for Android Studio and IntelliJ)
75
+ com_crashlytics_export_strings.xml
76
+ crashlytics.properties
77
+ crashlytics-build.properties
78
+
79
+
80
+ ### Ruby ###
81
+ *.gem
82
+ *.rbc
83
+ /.config
84
+ /coverage/
85
+ /InstalledFiles
86
+ /pkg/
87
+ /spec/reports/
88
+ /test/tmp/
89
+ /test/version_tmp/
90
+ /tmp/
91
+ .rspec
92
+
93
+ ## Specific to RubyMotion:
94
+ .dat*
95
+ .repl_history
96
+ build/
97
+
98
+ ## Documentation cache and generated files:
99
+ /.yardoc/
100
+ /_yardoc/
101
+ /doc/
102
+ /rdoc/
103
+
104
+ ## Environment normalisation:
105
+ /.bundle/
106
+ /vendor/bundle
107
+ /lib/bundler/man/
108
+
109
+ # for a library or gem, you might want to ignore these files since the code is
110
+ # intended to run in multiple environments; otherwise, check them in:
111
+ Gemfile.lock
112
+ .ruby-version*
113
+ .ruby-gemset*
114
+
115
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
116
+ .rvmrc
117
+
118
+ spec/helpers/failures.txt
119
+ backup/
@@ -0,0 +1,80 @@
1
+ # [0.9.0](https://github.com/scribd/datadog_backup/compare/v0.8.0...v0.9.0) (2020-08-11)
2
+
3
+
4
+ ### Features
5
+
6
+ * public release of datadog_backup ([50d3582](https://github.com/scribd/datadog_backup/commit/50d358284fa3f2c561b1025a3b4f5ce4b4433116))
7
+
8
+ # [0.8.0](https://github.com/scribd/datadog_backup/compare/v0.7.0...v0.8.0) (2020-08-07)
9
+
10
+
11
+ ### Features
12
+
13
+ * sort keys and ignore banlist for consistency ([ca683a6](https://github.com/scribd/datadog_backup/commit/ca683a63d58eeefee98b5909f830baa0e0bfa426))
14
+
15
+ # [0.7.0](https://github.com/scribd/datadog_backup/compare/v0.6.0...v0.7.0) (2020-08-07)
16
+
17
+
18
+ ### Features
19
+
20
+ * Purge before backup, so that deletions can be detected. ([bdcb2b0](https://github.com/scribd/datadog_backup/commit/bdcb2b08a2e2e908f8b85359d0a43c392c5253ab))
21
+
22
+ # [0.6.0](https://github.com/scribd/datadog_backup/compare/v0.5.0...v0.6.0) (2020-08-05)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * enable datadog_backup executable to run restore ([5094813](https://github.com/scribd/datadog_backup/commit/50948132b154c30956b87b5ec1e9070d34a48a02))
28
+ * order is not guaranteed ([d65b9a8](https://github.com/scribd/datadog_backup/commit/d65b9a872c268bcd91384f9f0215b88bdc5e9544))
29
+ * restore actually restores ([0e80999](https://github.com/scribd/datadog_backup/commit/0e80999b9d90cecb7c04c639d593987d89c35616))
30
+ * rspec properly handles SystemExit ([cf26bfb](https://github.com/scribd/datadog_backup/commit/cf26bfb7dd28d4b14c2126487848cab4d9af2bf9))
31
+
32
+
33
+ ### Features
34
+
35
+ * add restore flow ([8175a03](https://github.com/scribd/datadog_backup/commit/8175a033b34b268f4a9850d1629dfdb21e86d2fa))
36
+ * Change defaults to YAML(backups) and color(diffs) ([d9ed708](https://github.com/scribd/datadog_backup/commit/d9ed7084f4cb8a5357ce0ab2927df770f0b841ed))
37
+ * ignore key ordering changes ([47e6e9f](https://github.com/scribd/datadog_backup/commit/47e6e9f7f5ac7824a57f8cee45bfe68867bba760))
38
+ * use Diffy diffs rather than HashDiff:x ([e5529b8](https://github.com/scribd/datadog_backup/commit/e5529b8f8501c2534f26bd0d541afa20c076b5c0))
39
+
40
+ # [0.5.0](https://github.com/scribd/datadog_backup/compare/v0.4.0...v0.5.0) (2020-07-30)
41
+
42
+
43
+ ### Features
44
+
45
+ * Handle Ctrl-c by closing down the worker pool ([96791ba](https://github.com/scribd/datadog_backup/commit/96791ba23997114c356a097eb7a096ef2f7bd31c))
46
+ * use thread pool to globally limit thread count ([915f5c2](https://github.com/scribd/datadog_backup/commit/915f5c27be2fdf1f3bde40c34d8999ee1248de43))
47
+
48
+ # [0.4.0](https://github.com/scribd/datadog_backup/compare/v0.3.0...v0.4.0) (2020-07-27)
49
+
50
+
51
+ ### Bug Fixes
52
+
53
+ * use maintained 'amazing_print' gem, rather than suffer a bajillion error messages ([a988416](https://github.com/scribd/datadog_backup/commit/a988416de11fd83ddd2d5bcf5b78bed59de65694))
54
+
55
+
56
+ ### Features
57
+
58
+ * `diffs` provides a diff between what's on disk and in datadog ([8599b47](https://github.com/scribd/datadog_backup/commit/8599b47cd8761292247331982d9332f6b4da07b4))
59
+ * add `diffs` function ([3f5cd41](https://github.com/scribd/datadog_backup/commit/3f5cd41ae6bae99abb44a1495ea76c527ddc0428))
60
+
61
+ # [0.3.0](https://github.com/scribd/datadog_backup/compare/v0.2.0...v0.3.0) (2020-07-24)
62
+
63
+
64
+ ### Features
65
+
66
+ * add yaml option ([5645e71](https://github.com/scribd/datadog_backup/commit/5645e71826ee474201d54f51ed061ab1d3f9e872))
67
+
68
+ # [0.2.0](https://github.com/scribd/datadog_backup/compare/v0.1.0...v0.2.0) (2020-07-18)
69
+
70
+
71
+ ### Features
72
+
73
+ * send debug array to DEBUG ([0ef8bd7](https://github.com/scribd/datadog_backup/commit/0ef8bd71beba051e5ba4cddc9142507b505bc945))
74
+
75
+ # [0.1.0](https://github.com/scribd/datadog_backup/compare/v0.0.3...v0.1.0) (2020-07-17)
76
+
77
+
78
+ ### Features
79
+
80
+ * change default backup directory to 'backup' ([27c8f69](https://github.com/scribd/datadog_backup/commit/27c8f6914147801b10de7e24cfa7e2742010fd89))
@@ -0,0 +1,76 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, sex characteristics, gender identity and expression,
9
+ level of experience, education, socio-economic status, nationality, personal
10
+ appearance, race, religion, or sexual identity and orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at rtyler@scribd.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72
+
73
+ [homepage]: https://www.contributor-covenant.org
74
+
75
+ For answers to common questions about this code of conduct, see
76
+ https://www.contributor-covenant.org/faq
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ gemspec
6
+
7
+ group :development, :test do
8
+ gem 'climate_control'
9
+ gem 'guard-rspec'
10
+ gem 'rspec'
11
+ gem 'rubocop'
12
+ end
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ # A sample Guardfile
4
+ # More info at https://github.com/guard/guard#readme
5
+
6
+ ## Uncomment and set this to only include directories you want to watch
7
+ # directories %w(app lib config test spec features) \
8
+ # .select{|d| Dir.exist?(d) ? d : UI.warning("Directory #{d} does not exist")}
9
+
10
+ ## Note: if you are using the `directories` clause above and you are not
11
+ ## watching the project directory ('.'), then you will want to move
12
+ ## the Guardfile to a watched dir and symlink it back, e.g.
13
+ #
14
+ # $ mkdir config
15
+ # $ mv Guardfile config/
16
+ # $ ln -s config/Guardfile .
17
+ #
18
+ # and, you'll have to watch "config/Guardfile" instead of "Guardfile"
19
+
20
+ # Note: The cmd option is now required due to the increasing number of ways
21
+ # rspec may be run, below are examples of the most common uses.
22
+ # * bundler: 'bundle exec rspec'
23
+ # * bundler binstubs: 'bin/rspec'
24
+ # * spring: 'bin/rspec' (This will use spring if running and you have
25
+ # installed the spring binstubs per the docs)
26
+ # * zeus: 'zeus rspec' (requires the server to be started separately)
27
+ # * 'just' rspec: 'rspec'
28
+
29
+ guard :rspec, cmd: 'bundle exec rspec' do
30
+ require 'guard/rspec/dsl'
31
+ dsl = Guard::RSpec::Dsl.new(self)
32
+
33
+ # Feel free to open issues for suggestions and improvements
34
+
35
+ # RSpec files
36
+ rspec = dsl.rspec
37
+ watch(rspec.spec_helper) { rspec.spec_dir }
38
+ watch(rspec.spec_support) { rspec.spec_dir }
39
+ watch(rspec.spec_files)
40
+
41
+ # Ruby files
42
+ ruby = dsl.ruby
43
+ dsl.watch_spec_files_for(ruby.lib_files)
44
+ end
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 Scribd, Inc
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,57 @@
1
+ # Datadog Backup
2
+
3
+ ![Rspec and Release](https://github.com/scribd/datadog_backup/workflows/Rspec%20and%20Release/badge.svg)
4
+
5
+ Use `datadog_backup` to backup your datadog account.
6
+ Currently supports
7
+
8
+ - dashboards
9
+ - monitors
10
+
11
+ Additional features may be built out over time.
12
+
13
+ ## Installation
14
+
15
+ ```
16
+ gem install datadog_backup
17
+ ```
18
+ or
19
+
20
+ ```
21
+ gem build datadog_backup.gemspec
22
+ gem install datadog_backup-*.gem
23
+ ```
24
+
25
+ ## Usage
26
+
27
+ ```
28
+ DATADOG_API_KEY=example123 DATADOG_APP_KEY=example123 datadog_backup <backup|diffs|restore> [--backup-dir /path/to/backups] [--debug] [--monitors-only] [--dashboards-only] [--diff-format color|html|html_simple] [--no-color] [--json]
29
+ ```
30
+
31
+ ```
32
+ gem install datadog_backup
33
+ export DATADOG_API_KEY=abc123
34
+ export DATADOG_APP_KEY=abc123
35
+
36
+ # Perform backup to optional/path/to/backupdir using YAML encoding
37
+ datadog_backup backup --backup-dir optional/path/to/backupdir
38
+
39
+ # Make some changes
40
+
41
+ # Just review the changes since last backup
42
+ datadog_backup diffs --backup-dir optional/path/to/backupdir
43
+
44
+ # Review and apply local changes to datadog
45
+
46
+ datadog_backup restore --backup-dir optional/path/to/backupdir
47
+ ```
48
+
49
+ ### Usage in a Github repo
50
+
51
+ See [example/](https://github.com/scribd/datadog_backup/tree/master/example) for an example implementation as a repo that backs up your Datadog dashboards hourly.
52
+
53
+ # Development
54
+
55
+ Releases are cut using [semantic-release](https://github.com/semantic-release/semantic-release).
56
+
57
+ Please write commit messages following [Angular commit guidelines](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines)