itamae-plugin-recipe-datadog 0.1.1 → 0.2.2

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
- SHA1:
3
- metadata.gz: a46b30385e139078a8376799851e15fcab2b5af0
4
- data.tar.gz: 8676d78c039fafc3b1b5da515a407e54da6fdbb2
2
+ SHA256:
3
+ metadata.gz: 102c6593fcfa07616474fea986ab3cea337bb9fc4778983f70282bb465dbbb31
4
+ data.tar.gz: 3a80383142aad9bd528958903c9676b3e6f901eb264bb9ef70e95944427978e9
5
5
  SHA512:
6
- metadata.gz: bbd5900cb32f38789e3fa82044cb4d6f1992d7586bdd09d8616d5660b8687553f2284e1c94e670c6dba88a32d131aee045d44481cbc79fcea95530e86c517989
7
- data.tar.gz: 73ac0faa935432ee5e784c6b458d813212075390d0d61e947d9a06f879505c275130de2132e6f443d72089a6fb1e3b2ade3f732b683d79cd85ca1be33a80e2b5
6
+ metadata.gz: f23f1ebf2d583646765abca4a96085bf655b9a98066d65e57b83690efc2d893440d73b43730f937e897bf6709424523b0e782f657ed2032ea31ea6efc1745b6f
7
+ data.tar.gz: 33a7ea4f01b0d756dfe626319c18ad2ca084f03a7738d95f237f82dbac684cce27ec5b5a620925a04e767d55a13bf6d4b221decce2fa3b33181f39674be91025
@@ -0,0 +1,100 @@
1
+ name: test
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ pull_request:
8
+ types:
9
+ - opened
10
+ - synchronize
11
+ - reopened
12
+ schedule:
13
+ - cron: "0 10 * * 5" # JST 19:00 (Fri)
14
+
15
+ jobs:
16
+ test:
17
+ runs-on: ubuntu-latest
18
+
19
+ strategy:
20
+ fail-fast: false
21
+
22
+ matrix:
23
+ ruby:
24
+ - 2.3
25
+ image:
26
+ - debian:buster
27
+ - amazonlinux:2
28
+
29
+ steps:
30
+ - uses: actions/checkout@v2
31
+
32
+ - uses: ruby/setup-ruby@v1
33
+ with:
34
+ ruby-version: ${{ matrix.ruby }}
35
+ bundler-cache: true
36
+ rubygems: latest
37
+
38
+ - name: Cache vendor/bundle
39
+ uses: actions/cache@v1
40
+ id: cache_gem
41
+ with:
42
+ path: vendor/bundle
43
+ key: v1-gem-${{ runner.os }}-${{ matrix.ruby }}-${{ github.sha }}
44
+ restore-keys: |
45
+ v1-gem-${{ runner.os }}-${{ matrix.ruby }}-
46
+
47
+ - name: bundle update
48
+ run: |
49
+ set -xe
50
+ bundle config --local path $PWD/vendor/bundle
51
+ bundle config --local jobs $(nproc)
52
+ bundle update --retry 3
53
+
54
+ - name: Run test (1st installation)
55
+ run: bundle exec rake test
56
+ env:
57
+ IMAGE: ${{ matrix.image }}
58
+
59
+ - name: Run test (installation is skipped)
60
+ run: bundle exec rake test
61
+ env:
62
+ IMAGE: itamae-plugin:latest
63
+ DATADOG_UPGRADE: "false"
64
+ DD_API_KEY: api_key_2
65
+
66
+ - name: Run test (datadog-agent is upgraded)
67
+ run: bundle exec rake test
68
+ env:
69
+ IMAGE: itamae-plugin:latest
70
+ DATADOG_UPGRADE: "true"
71
+ DD_API_KEY: api_key_3
72
+
73
+ - name: Slack Notification (not success)
74
+ uses: lazy-actions/slatify@master
75
+ if: "! success()"
76
+ continue-on-error: true
77
+ with:
78
+ job_name: ${{ format('*build* ({0}, {1})', matrix.ruby, matrix.image) }}
79
+ type: ${{ job.status }}
80
+ icon_emoji: ":octocat:"
81
+ url: ${{ secrets.SLACK_WEBHOOK }}
82
+ token: ${{ secrets.GITHUB_TOKEN }}
83
+
84
+ notify:
85
+ needs:
86
+ - test
87
+
88
+ runs-on: ubuntu-latest
89
+
90
+ steps:
91
+ - name: Slack Notification (success)
92
+ uses: lazy-actions/slatify@master
93
+ if: always()
94
+ continue-on-error: true
95
+ with:
96
+ job_name: '*build*'
97
+ type: ${{ job.status }}
98
+ icon_emoji: ":octocat:"
99
+ url: ${{ secrets.SLACK_WEBHOOK }}
100
+ token: ${{ secrets.GITHUB_TOKEN }}
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --require spec_helper
data/CHANGELOG.md ADDED
@@ -0,0 +1,39 @@
1
+ ## Unreleased
2
+ [full changelog](https://github.com/itamae-plugins/itamae-plugin-recipe-datadog/compare/v0.2.2...master)
3
+
4
+ ## v0.2.2
5
+ [full changelog](https://github.com/itamae-plugins/itamae-plugin-recipe-datadog/compare/v0.2.1...v0.2.2)
6
+
7
+ * Transferred to itamae-plugins org
8
+ * https://github.com/itamae-plugins/itamae-plugin-recipe-datadog/pull/11
9
+ * Setup CI. Install wget if not installed. Add itamae to runtime dependency
10
+ * https://github.com/itamae-plugins/itamae-plugin-recipe-datadog/pull/12
11
+ * Add `spec.metadata`
12
+ * https://github.com/itamae-plugins/itamae-plugin-recipe-datadog/pull/13
13
+
14
+ ## v0.2.1
15
+ [full changelog](https://github.com/itamae-plugins/itamae-plugin-recipe-datadog/compare/v0.2.0...v0.2.1)
16
+
17
+ * Don't re-install datadog-agent if installed
18
+ * https://github.com/itamae-plugins/itamae-plugin-recipe-datadog/pull/9
19
+
20
+ ## v0.2.0
21
+ [full changelog](https://github.com/itamae-plugins/itamae-plugin-recipe-datadog/compare/v0.1.1...v0.2.0)
22
+
23
+ * update README
24
+ * https://github.com/itamae-plugins/itamae-plugin-recipe-datadog/pull/2
25
+ * Upgrade install process to install V6 agent.
26
+ * https://github.com/itamae-plugins/itamae-plugin-recipe-datadog/pull/6
27
+ * Overwrite install script
28
+ * https://github.com/itamae-plugins/itamae-plugin-recipe-datadog/pull/7
29
+ * Add upgrade option to README
30
+ * https://github.com/itamae-plugins/itamae-plugin-recipe-datadog/pull/8
31
+
32
+ ## v0.1.1
33
+ [full changelog](https://github.com/itamae-plugins/itamae-plugin-recipe-datadog/compare/v0.1.0...v0.1.1)
34
+
35
+ * Fix repo url
36
+ * https://github.com/itamae-plugins/itamae-plugin-recipe-datadog/pull/1
37
+
38
+ ## v0.1.0
39
+ Initial release
data/README.md CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  [Itamae](https://github.com/ryotarai/itamae) plugin to install Datadog Agent.
4
4
 
5
+ [![Gem Version](https://badge.fury.io/rb/itamae-plugin-recipe-datadog.svg)](https://badge.fury.io/rb/itamae-plugin-recipe-datadog)
6
+ [![test](https://github.com/itamae-plugins/itamae-plugin-recipe-datadog/actions/workflows/test.yml/badge.svg)](https://github.com/itamae-plugins/itamae-plugin-recipe-datadog/actions/workflows/test.yml)
7
+
5
8
  ## Installation
6
9
 
7
10
  Add this line to your application's Gemfile:
@@ -21,7 +24,7 @@ Or install it yourself as:
21
24
  ## Usage
22
25
 
23
26
  ### Recipe
24
- ```
27
+ ```ruby
25
28
  # In your recipe
26
29
  include_recipe "datadog::install"
27
30
  ```
@@ -29,19 +32,24 @@ include_recipe "datadog::install"
29
32
  ### Node
30
33
  `$ itamae -y node.yml`
31
34
 
32
- ```
35
+ ```yaml
33
36
  # node.yml
34
37
  datadog:
35
38
  api_key: xxxxxx
36
39
  install_only: false # default: true
40
+ upgrade: true # default: false
37
41
  ```
38
42
 
39
- `node[:datadog][:api_key]` is your datadog-agent API Key.
40
- `node[:datadog][:install_only]` is an install option. If you want to install agent and don't start agent, please set this option`true`.
43
+ - `node[:datadog][:api_key]`
44
+ - Your datadog-agent API Key.
45
+ - `node[:datadog][:install_only]`
46
+ - An install option. If you want to install agent and don't start agent, please set this option`true`.
47
+ - `node[:datadog][:upgrade]`
48
+ - An install option. Upgrade datadog-agent version automatically.
41
49
 
42
50
  ## Contributing
43
51
 
44
- Bug reports and pull requests are welcome on GitHub at https://github.com/takanamito/itamae-plugin-recipe-datadog. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
52
+ Bug reports and pull requests are welcome on GitHub at https://github.com/itamae-plugins/itamae-plugin-recipe-datadog. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
45
53
 
46
54
 
47
55
  ## License
data/Rakefile CHANGED
@@ -1,6 +1,17 @@
1
1
  require "bundler/gem_tasks"
2
2
  require "rspec/core/rake_task"
3
3
 
4
- RSpec::Core::RakeTask.new(:spec)
4
+ RSpec::Core::RakeTask.new(:serverspec)
5
5
 
6
- task :default => :spec
6
+ ENV["DOCKER_IMAGE"] = "itamae-plugin:latest"
7
+ ENV["IMAGE"] ||= "debian:buster"
8
+
9
+ desc "Run itamae"
10
+ task :itamae do
11
+ sh "itamae docker --node-yaml=spec/recipes/node.yml spec/recipes/install.rb --image=#{ENV["IMAGE"]} --tag #{ENV["DOCKER_IMAGE"]}"
12
+ end
13
+
14
+ desc "Run test"
15
+ task :test => %i(itamae serverspec)
16
+
17
+ task default: :test
@@ -6,14 +6,19 @@ require 'itamae/plugin/recipe/datadog/version'
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "itamae-plugin-recipe-datadog"
8
8
  spec.version = Itamae::Plugin::Recipe::Datadog::VERSION
9
- spec.authors = ["Takahiro Kiso (takanamito)", "Speee, Inc."]
10
- spec.email = ["t.kiso0928@gmail.com"]
9
+ spec.authors = ["Takahiro Kiso (takanamito)", "sue445", "Speee, Inc."]
10
+ spec.email = ["t.kiso0928@gmail.com", "sue445@sue445.net"]
11
11
 
12
12
  spec.summary = %q{Itamae plugin to install datadog-agent.}
13
13
  spec.description = %q{Itamae plugin to install datadog-agent.}
14
- spec.homepage = "https://github.com/speee/itamae-plugin-recipe-datadog"
14
+ spec.homepage = "https://github.com/itamae-plugins/itamae-plugin-recipe-datadog"
15
15
  spec.license = "MIT"
16
16
 
17
+ spec.metadata["homepage_uri"] = spec.homepage
18
+ spec.metadata["source_code_uri"] = spec.homepage
19
+ spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/master/CHANGELOG.md"
20
+ spec.metadata["rubygems_mfa_required"] = "true"
21
+
17
22
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
18
23
  f.match(%r{^(test|spec|features)/})
19
24
  end
@@ -21,7 +26,11 @@ Gem::Specification.new do |spec|
21
26
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
27
  spec.require_paths = ["lib"]
23
28
 
24
- spec.add_development_dependency "bundler", "~> 1.13"
25
- spec.add_development_dependency "rake", "~> 10.0"
29
+ spec.add_dependency "itamae"
30
+
31
+ spec.add_development_dependency "bundler"
32
+ spec.add_development_dependency "docker-api"
33
+ spec.add_development_dependency "rake"
26
34
  spec.add_development_dependency "rspec", "~> 3.0"
35
+ spec.add_development_dependency "serverspec"
27
36
  end
@@ -1,21 +1,38 @@
1
1
  node.reverse_merge!(
2
2
  datadog: {
3
- install_only: true
3
+ install_only: true,
4
+ upgrade: false,
4
5
  }
5
6
  )
6
7
 
8
+ package 'wget'
9
+
7
10
  execute 'download install script' do
8
- command 'wget https://raw.githubusercontent.com/DataDog/dd-agent/master/packaging/datadog-agent/source/install_agent.sh'
11
+ command 'wget https://raw.githubusercontent.com/DataDog/datadog-agent/main/cmd/agent/install_script.sh -O /tmp/install_script.sh'
12
+
13
+ # If upgrade is enabled, always download the latest install_script.sh
14
+ # If upgrade is disabled, download only when `/tmp/install_script.sh` doesn't exist
15
+ unless node[:datadog][:upgrade]
16
+ not_if 'ls /tmp/install_script.sh'
17
+ end
9
18
  end
10
19
 
11
- execute "change install script's permission" do
12
- command 'chmod 755 install_agent.sh'
20
+ file '/tmp/install_script.sh' do
21
+ action :edit
22
+ mode '0755'
13
23
  end
14
24
 
15
25
  execute 'install datadog-agent' do
16
- if node[:datadog][:install_only]
17
- command "DD_API_KEY=#{node[:datadog][:api_key]} DD_INSTALL_ONLY=true ./install_agent.sh"
18
- else
19
- command "DD_API_KEY=#{node[:datadog][:api_key]} ./install_agent.sh"
26
+ options = {}
27
+ options['DD_API_KEY'] = node[:datadog][:api_key]
28
+ options['DD_INSTALL_ONLY'] = 'true' if node[:datadog][:install_only]
29
+ options['DD_UPGRADE'] = 'true' if node[:datadog][:upgrade]
30
+ option_str = options.map { |k, v| "#{k}=#{v}" }.join(' ')
31
+ command "#{option_str} /tmp/install_script.sh"
32
+
33
+ # If upgrade is enabled, always run `install_script.sh`
34
+ # If upgrade is disabled, run `install_script.sh` only when datadog isn't installed
35
+ unless node[:datadog][:upgrade]
36
+ not_if 'ls /etc/datadog-agent/datadog.yaml'
20
37
  end
21
38
  end
@@ -2,7 +2,7 @@ module Itamae
2
2
  module Plugin
3
3
  module Recipe
4
4
  module Datadog
5
- VERSION = "0.1.1"
5
+ VERSION = "0.2.2"
6
6
  end
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,44 +1,73 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itamae-plugin-recipe-datadog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takahiro Kiso (takanamito)
8
+ - sue445
8
9
  - Speee, Inc.
9
- autorequire:
10
+ autorequire:
10
11
  bindir: exe
11
12
  cert_chain: []
12
- date: 2016-12-28 00:00:00.000000000 Z
13
+ date: 2022-04-01 00:00:00.000000000 Z
13
14
  dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: itamae
17
+ requirement: !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - - ">="
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ version: '0'
14
29
  - !ruby/object:Gem::Dependency
15
30
  name: bundler
16
31
  requirement: !ruby/object:Gem::Requirement
17
32
  requirements:
18
- - - "~>"
33
+ - - ">="
19
34
  - !ruby/object:Gem::Version
20
- version: '1.13'
35
+ version: '0'
21
36
  type: :development
22
37
  prerelease: false
23
38
  version_requirements: !ruby/object:Gem::Requirement
24
39
  requirements:
25
- - - "~>"
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: '0'
43
+ - !ruby/object:Gem::Dependency
44
+ name: docker-api
45
+ requirement: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: '0'
50
+ type: :development
51
+ prerelease: false
52
+ version_requirements: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
26
55
  - !ruby/object:Gem::Version
27
- version: '1.13'
56
+ version: '0'
28
57
  - !ruby/object:Gem::Dependency
29
58
  name: rake
30
59
  requirement: !ruby/object:Gem::Requirement
31
60
  requirements:
32
- - - "~>"
61
+ - - ">="
33
62
  - !ruby/object:Gem::Version
34
- version: '10.0'
63
+ version: '0'
35
64
  type: :development
36
65
  prerelease: false
37
66
  version_requirements: !ruby/object:Gem::Requirement
38
67
  requirements:
39
- - - "~>"
68
+ - - ">="
40
69
  - !ruby/object:Gem::Version
41
- version: '10.0'
70
+ version: '0'
42
71
  - !ruby/object:Gem::Dependency
43
72
  name: rspec
44
73
  requirement: !ruby/object:Gem::Requirement
@@ -53,14 +82,32 @@ dependencies:
53
82
  - - "~>"
54
83
  - !ruby/object:Gem::Version
55
84
  version: '3.0'
85
+ - !ruby/object:Gem::Dependency
86
+ name: serverspec
87
+ requirement: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ type: :development
93
+ prerelease: false
94
+ version_requirements: !ruby/object:Gem::Requirement
95
+ requirements:
96
+ - - ">="
97
+ - !ruby/object:Gem::Version
98
+ version: '0'
56
99
  description: Itamae plugin to install datadog-agent.
57
100
  email:
58
101
  - t.kiso0928@gmail.com
102
+ - sue445@sue445.net
59
103
  executables: []
60
104
  extensions: []
61
105
  extra_rdoc_files: []
62
106
  files:
107
+ - ".github/workflows/test.yml"
63
108
  - ".gitignore"
109
+ - ".rspec"
110
+ - CHANGELOG.md
64
111
  - CODE_OF_CONDUCT.md
65
112
  - Gemfile
66
113
  - LICENSE.txt
@@ -72,11 +119,15 @@ files:
72
119
  - lib/itamae/plugin/recipe/datadog.rb
73
120
  - lib/itamae/plugin/recipe/datadog/install.rb
74
121
  - lib/itamae/plugin/recipe/datadog/version.rb
75
- homepage: https://github.com/speee/itamae-plugin-recipe-datadog
122
+ homepage: https://github.com/itamae-plugins/itamae-plugin-recipe-datadog
76
123
  licenses:
77
124
  - MIT
78
- metadata: {}
79
- post_install_message:
125
+ metadata:
126
+ homepage_uri: https://github.com/itamae-plugins/itamae-plugin-recipe-datadog
127
+ source_code_uri: https://github.com/itamae-plugins/itamae-plugin-recipe-datadog
128
+ changelog_uri: https://github.com/itamae-plugins/itamae-plugin-recipe-datadog/blob/master/CHANGELOG.md
129
+ rubygems_mfa_required: 'true'
130
+ post_install_message:
80
131
  rdoc_options: []
81
132
  require_paths:
82
133
  - lib
@@ -91,9 +142,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
91
142
  - !ruby/object:Gem::Version
92
143
  version: '0'
93
144
  requirements: []
94
- rubyforge_project:
95
- rubygems_version: 2.6.8
96
- signing_key:
145
+ rubygems_version: 3.2.22
146
+ signing_key:
97
147
  specification_version: 4
98
148
  summary: Itamae plugin to install datadog-agent.
99
149
  test_files: []