capistrano-itamae 0.1.1 → 1.0.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 617064b1bc956ce9812df7eda388493c323dfbb1
4
- data.tar.gz: 7317e1c7aa5681c974a84d62bdf3e0b1498115e2
2
+ SHA256:
3
+ metadata.gz: 58bc7344d8a43b8b0c4a3926aea17561f97192b392d81fbaccb7332f238d85f1
4
+ data.tar.gz: 6b7760a666ee196e7329e11f7d77e1d3a09b4eedcfe23ecdf64d5782901d998e
5
5
  SHA512:
6
- metadata.gz: 33f23c4f45342c271fef4ca74f247809355a17598a6562b5954fce34e7d3bc87fbf04e58d53a3b71bff1905c1ee92d9a41d4bbefe849a387461922fb8b8aabc2
7
- data.tar.gz: 22ed2a4ebb2501d4718fff23f447530e4c9355c961a5bfc0dc49ba3e42c2a9941494ea4bce17bc3c7b1bc764a61ae2a9e5dd9f8ed8eb8b470bcf26a9945e9895
6
+ metadata.gz: fd3d6827f15030277b0d5f46ed6a7739c8603428e155ba2a12c74f1ea04a3a86f889dcb80b2b30caa66ab5e3c9a05db4d2ed6216170a40ecdbfa847827d1ab5b
7
+ data.tar.gz: ddd1e8d5a873244945a4cf0cb376a7c46c06a03b172bc591d8b4dd498344dc9769d3a905fc57234ee056dde2aced35300cae0a0227120256618b728fbc3e725d
@@ -0,0 +1,96 @@
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
+ env:
16
+ CI: "true"
17
+
18
+ jobs:
19
+ test:
20
+ runs-on: ubuntu-latest
21
+
22
+ strategy:
23
+ fail-fast: false
24
+
25
+ matrix:
26
+ ruby:
27
+ # - "2.3"
28
+ - "2.4"
29
+ - "2.5"
30
+ - "2.6"
31
+ - "2.7"
32
+ - "3.0"
33
+
34
+ steps:
35
+ - uses: actions/checkout@v2
36
+
37
+ - uses: ruby/setup-ruby@v1
38
+ with:
39
+ ruby-version: ${{ matrix.ruby }}
40
+
41
+ - name: Cache vendor/bundle
42
+ uses: actions/cache@v1
43
+ id: cache_gem
44
+ with:
45
+ path: vendor/bundle
46
+ key: v1-gem-${{ runner.os }}-${{ matrix.ruby }}-${{ github.sha }}
47
+ restore-keys: |
48
+ v1-gem-${{ runner.os }}-${{ matrix.ruby }}-
49
+
50
+ - name: bundle update
51
+ run: |
52
+ set -xe
53
+ bundle config path vendor/bundle
54
+ bundle update --jobs $(nproc) --retry 3
55
+
56
+ - name: Setup sandbox server
57
+ working-directory: spec/integration
58
+ run: |
59
+ set -xe
60
+ docker image build . -t ssh_server
61
+ docker run -d -p 10000:22 ssh_server
62
+
63
+ - name: Run integration test
64
+ working-directory: spec/integration
65
+ run: |
66
+ set -xe
67
+ bundle exec rake spec
68
+
69
+ - name: Slack Notification (not success)
70
+ uses: lazy-actions/slatify@master
71
+ if: "! success()"
72
+ continue-on-error: true
73
+ with:
74
+ job_name: ${{ format('*build* ({0})', matrix.ruby) }}
75
+ type: ${{ job.status }}
76
+ icon_emoji: ":octocat:"
77
+ url: ${{ secrets.SLACK_WEBHOOK }}
78
+ token: ${{ secrets.GITHUB_TOKEN }}
79
+
80
+ notify:
81
+ needs:
82
+ - test
83
+
84
+ runs-on: ubuntu-latest
85
+
86
+ steps:
87
+ - name: Slack Notification (success)
88
+ uses: lazy-actions/slatify@master
89
+ if: always()
90
+ continue-on-error: true
91
+ with:
92
+ job_name: '*build*'
93
+ type: ${{ job.status }}
94
+ icon_emoji: ":octocat:"
95
+ url: ${{ secrets.SLACK_WEBHOOK }}
96
+ token: ${{ secrets.GITHUB_TOKEN }}
data/CHANGELOG.md CHANGED
@@ -1,5 +1,36 @@
1
1
  ## master
2
- [full changelog](http://github.com/sue445/capistrano-itamae/compare/v0.1.1...master)
2
+ [full changelog](http://github.com/sue445/capistrano-itamae/compare/v1.0.2...master)
3
+
4
+ ## v1.0.2
5
+ [full changelog](http://github.com/sue445/capistrano-itamae/compare/v1.0.1...v1.0.2)
6
+
7
+ * Enable MFA requirement for gem releasing
8
+ * https://github.com/sue445/capistrano-itamae/pull/37
9
+
10
+ ## v1.0.1
11
+ [full changelog](http://github.com/sue445/capistrano-itamae/compare/v1.0.0...v1.0.1)
12
+
13
+ * Resolved. bundler deprecation warning
14
+ * https://github.com/sue445/capistrano-itamae/pull/26
15
+
16
+ ## v1.0.0
17
+ [full changelog](http://github.com/sue445/capistrano-itamae/compare/v0.2.0...v1.0.0)
18
+
19
+ ### Breaking changes :bomb:
20
+ * `options` arg of `itamae_ssh` is changed to keyword arg.
21
+ * Before (v0.x): `itamae_ssh "recipe.rb", "xxxxx"`
22
+ * After (v1.0.0+): `itamae_ssh "recipe.rb", options: "xxxxx"`
23
+ * https://github.com/sue445/capistrano-itamae/pull/21
24
+
25
+ ### Features
26
+ * Add `environment` arg to `itamae_ssh`
27
+ * https://github.com/sue445/capistrano-itamae/pull/22
28
+
29
+ ## v0.2.0
30
+ [full changelog](http://github.com/sue445/capistrano-itamae/compare/v0.1.1...v0.2.0)
31
+
32
+ * Add `--dry-run` support
33
+ * https://github.com/sue445/capistrano-itamae/pull/16
3
34
 
4
35
  ## v0.1.1
5
36
  [full changelog](http://github.com/sue445/capistrano-itamae/compare/v0.1.0...v0.1.1)
data/README.md CHANGED
@@ -3,10 +3,9 @@
3
3
  Run [itamae](https://github.com/itamae-kitchen/itamae) in capistrano task
4
4
 
5
5
  [![Gem Version](https://badge.fury.io/rb/capistrano-itamae.svg)](https://badge.fury.io/rb/capistrano-itamae)
6
+ [![Build Status](https://github.com/sue445/capistrano-itamae/workflows/test/badge.svg?branch=master)](https://github.com/sue445/capistrano-itamae/actions?query=workflow%3Atest)
6
7
  [![Code Climate](https://codeclimate.com/github/sue445/capistrano-itamae/badges/gpa.svg)](https://codeclimate.com/github/sue445/capistrano-itamae)
7
8
 
8
- [![wercker status](https://app.wercker.com/status/a2f734cda581d3d221e10b1ede83bb71/m/master "wercker status")](https://app.wercker.com/project/bykey/a2f734cda581d3d221e10b1ede83bb71)
9
-
10
9
  ## Installation
11
10
 
12
11
  Add this line to your application's Gemfile:
@@ -52,13 +51,24 @@ desc "Run itamae"
52
51
  # Run itamae ssh --node-yaml=node.yml cookbooks/recipe1.rb cookbooks/recipe2.rb
53
52
  itamae_ssh ["recipe1.rb", "recipe2.rb"]
54
53
 
55
- # Run itamae ssh --node-yaml=node.yml cookbooks/recipe.rb --dry-run
56
- itamae_ssh "recipe.rb", "--dry-run"
54
+ # Run itamae ssh --node-yaml=node.yml cookbooks/recipe.rb --no-sudo --log-level=debug
55
+ itamae_ssh "recipe.rb", options: "--no-sudo --log-level=debug"
56
+
57
+ # Pass $PATH to `itamae ssh`
58
+ itamae_ssh "recipe.rb", environment: { path: ENV["PATH"] }
57
59
  end
58
60
  end
59
61
  end
60
62
  ```
61
63
 
64
+ ```bash
65
+ # Run itamae ssh --dry-run 〜
66
+ $ bundle exec cap --dry-run 〜
67
+
68
+ # Run itamae ssh 〜
69
+ $ bundle exec cap 〜
70
+ ```
71
+
62
72
  see [Capistrano::Itamae::DSL#itamae_ssh](lib/capistrano/itamae/dsl.rb)
63
73
 
64
74
  ## Variables
@@ -75,7 +85,8 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
75
85
  ## Integration test
76
86
  ```sh
77
87
  cd spec/integration
78
- bundle exec vagrant up
88
+ docker image build . -t ssh_server
89
+ docker run -d -p 10000:22 ssh_server
79
90
  bundle exec rake spec
80
91
  ```
81
92
 
@@ -14,16 +14,23 @@ Gem::Specification.new do |spec|
14
14
  spec.homepage = "https://github.com/sue445/capistrano-itamae"
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 { |f| f.match(%r{^(test|spec|features)/}) }
18
23
  spec.bindir = "exe"
19
24
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
25
  spec.require_paths = ["lib"]
21
26
 
22
27
  spec.add_dependency "bundler"
23
- spec.add_dependency "capistrano", ">= 3"
28
+ spec.add_dependency "capistrano", ">= 3.5.0"
24
29
  spec.add_dependency "itamae"
25
30
 
31
+ spec.add_development_dependency "bcrypt_pbkdf", ">= 1.0", "< 2.0"
32
+ spec.add_development_dependency "ed25519", ">= 1.2", "< 2.0"
26
33
  spec.add_development_dependency "pry-byebug"
27
- spec.add_development_dependency "rake", "~> 10.0"
34
+ spec.add_development_dependency "rake", ">= 11.0"
28
35
  spec.add_development_dependency "serverspec"
29
36
  end
@@ -8,7 +8,8 @@ module Capistrano
8
8
  # Run `itamae ssh`
9
9
  # @param recipe_files [String, Array<String>]
10
10
  # @param options [String] itamae ssh options
11
- def itamae_ssh(recipe_files = DEFAULT_RECIPE, options = nil)
11
+ # @param environment [Hash] environment variables. (passed to `with`)
12
+ def itamae_ssh(recipe_files = DEFAULT_RECIPE, options: nil, environment: {})
12
13
  recipe_paths = Array(recipe_files).map { |file| itamae_cookbooks_path.join(file) }
13
14
 
14
15
  itamae_options = [options, itamae_ssh_default_options].compact
@@ -17,8 +18,10 @@ module Capistrano
17
18
  server = host
18
19
 
19
20
  run_locally do
20
- Bundler.with_clean_env do
21
- execute(*generate_itamae_ssh_command(server, recipe_paths, itamae_options))
21
+ Bundler.with_original_env do
22
+ with environment do
23
+ execute(*generate_itamae_ssh_command(server, recipe_paths, itamae_options))
24
+ end
22
25
  end
23
26
  end
24
27
  end
@@ -49,6 +52,7 @@ module Capistrano
49
52
  options << "--user #{ssh_options[:user]}" if ssh_options[:user]
50
53
  options << "--port #{ssh_options[:port]}" if ssh_options[:port]
51
54
  options << "--key #{ssh_options[:key]}" if ssh_options[:key]
55
+ options << "--dry-run" if dry_run?
52
56
  options
53
57
  end
54
58
  end
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module Itamae
3
- VERSION = "0.1.1"
3
+ VERSION = "1.0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-itamae
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - sue445
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-07-20 00:00:00.000000000 Z
11
+ date: 2021-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '3'
33
+ version: 3.5.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '3'
40
+ version: 3.5.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: itamae
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -52,6 +52,46 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: bcrypt_pbkdf
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '1.0'
62
+ - - "<"
63
+ - !ruby/object:Gem::Version
64
+ version: '2.0'
65
+ type: :development
66
+ prerelease: false
67
+ version_requirements: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: '1.0'
72
+ - - "<"
73
+ - !ruby/object:Gem::Version
74
+ version: '2.0'
75
+ - !ruby/object:Gem::Dependency
76
+ name: ed25519
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '1.2'
82
+ - - "<"
83
+ - !ruby/object:Gem::Version
84
+ version: '2.0'
85
+ type: :development
86
+ prerelease: false
87
+ version_requirements: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: '1.2'
92
+ - - "<"
93
+ - !ruby/object:Gem::Version
94
+ version: '2.0'
55
95
  - !ruby/object:Gem::Dependency
56
96
  name: pry-byebug
57
97
  requirement: !ruby/object:Gem::Requirement
@@ -70,16 +110,16 @@ dependencies:
70
110
  name: rake
71
111
  requirement: !ruby/object:Gem::Requirement
72
112
  requirements:
73
- - - "~>"
113
+ - - ">="
74
114
  - !ruby/object:Gem::Version
75
- version: '10.0'
115
+ version: '11.0'
76
116
  type: :development
77
117
  prerelease: false
78
118
  version_requirements: !ruby/object:Gem::Requirement
79
119
  requirements:
80
- - - "~>"
120
+ - - ">="
81
121
  - !ruby/object:Gem::Version
82
- version: '10.0'
122
+ version: '11.0'
83
123
  - !ruby/object:Gem::Dependency
84
124
  name: serverspec
85
125
  requirement: !ruby/object:Gem::Requirement
@@ -101,6 +141,7 @@ executables: []
101
141
  extensions: []
102
142
  extra_rdoc_files: []
103
143
  files:
144
+ - ".github/workflows/test.yml"
104
145
  - ".gitignore"
105
146
  - CHANGELOG.md
106
147
  - Gemfile
@@ -115,12 +156,15 @@ files:
115
156
  - lib/capistrano/itamae/dsl.rb
116
157
  - lib/capistrano/itamae/variables.rb
117
158
  - lib/capistrano/itamae/version.rb
118
- - wercker.yml
119
159
  homepage: https://github.com/sue445/capistrano-itamae
120
160
  licenses:
121
161
  - MIT
122
- metadata: {}
123
- post_install_message:
162
+ metadata:
163
+ homepage_uri: https://github.com/sue445/capistrano-itamae
164
+ source_code_uri: https://github.com/sue445/capistrano-itamae
165
+ changelog_uri: https://github.com/sue445/capistrano-itamae/blob/master/CHANGELOG.md
166
+ rubygems_mfa_required: 'true'
167
+ post_install_message:
124
168
  rdoc_options: []
125
169
  require_paths:
126
170
  - lib
@@ -135,9 +179,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
135
179
  - !ruby/object:Gem::Version
136
180
  version: '0'
137
181
  requirements: []
138
- rubyforge_project:
139
- rubygems_version: 2.5.1
140
- signing_key:
182
+ rubygems_version: 3.2.22
183
+ signing_key:
141
184
  specification_version: 4
142
185
  summary: Run itamae in capistrano task
143
186
  test_files: []
data/wercker.yml DELETED
@@ -1,93 +0,0 @@
1
- # This references the default Ruby container from
2
- # the Docker Hub.
3
- # https://registry.hub.docker.com/_/ruby/
4
- # If you want to use a specific version you would use a tag:
5
- # ruby:2.2.2
6
- box: drecom/centos-ruby:2.3.1
7
- # You can also use services such as databases. Read more on our dev center:
8
- # http://devcenter.wercker.com/docs/services/index.html
9
- # services:
10
- # - postgres
11
- # http://devcenter.wercker.com/docs/services/postgresql.html
12
-
13
- # - mongo
14
- # http://devcenter.wercker.com/docs/services/mongodb.html
15
-
16
- # This is the build pipeline. Pipelines are the core of wercker
17
- # Read more about pipelines on our dev center
18
- # http://devcenter.wercker.com/docs/pipelines/index.html
19
- build:
20
- # Steps make up the actions in your pipeline
21
- # Read more about steps on our dev center:
22
- # http://devcenter.wercker.com/docs/steps/index.html
23
- steps:
24
- - script:
25
- name: Install Vagrant
26
- code: |
27
- wget https://releases.hashicorp.com/vagrant/1.8.4/vagrant_1.8.4_x86_64.rpm
28
- rpm -i vagrant_1.8.4_x86_64.rpm
29
- vagrant plugin install vagrant-digitalocean
30
-
31
- - script:
32
- # NOTE: vagrant v1.8.4 depends on bundler v1.12.5
33
- # https://github.com/mitchellh/vagrant/blob/v1.8.4/vagrant.gemspec#L23
34
- name: Install bundler
35
- code: |
36
- gem uninstall bundler --all --force
37
- gem install bundler -v 1.12.5
38
-
39
- - bundle-install:
40
- jobs: 4
41
-
42
- - script:
43
- name: create .ssh directory
44
- code: mkdir -m 700 -p $HOME/.ssh
45
-
46
- - create-file:
47
- name: put private key
48
- filename: $HOME/.ssh/id_rsa.vagrant
49
- overwrite: true
50
- hide-from-log: true
51
- content: $DIGITALOCEAN_KEY_PRIVATE
52
-
53
- - create-file:
54
- name: put public key
55
- filename: $HOME/.ssh/id_rsa.vagrant.pub
56
- overwrite: true
57
- hide-from-log: true
58
- content: $DIGITALOCEAN_KEY_PUBLIC
59
-
60
- - script:
61
- name: chmod 600 id_rsa
62
- code: chmod 600 $HOME/.ssh/id_rsa.vagrant
63
-
64
- - script:
65
- name: start vm
66
- code: vagrant up default --provider=digital_ocean
67
- cwd: spec/integration
68
-
69
- - script:
70
- name: vagrant ssh-config
71
- code: vagrant ssh-config
72
- cwd: spec/integration
73
-
74
- - script:
75
- name: run integration test
76
- code: bundle exec rake spec
77
- cwd: spec/integration
78
-
79
- after-steps:
80
- - script:
81
- name: Set variables
82
- code: |
83
- # NOTE: override .ruby-version in pretty-slack-notify
84
- export RBENV_VERSION=2.3.1
85
-
86
- - script:
87
- name: shutdown all vms
88
- code: vagrant destroy -f
89
- cwd: spec/integration
90
-
91
- - wantedly/pretty-slack-notify:
92
- webhook_url: $SLACK_WEBHOOK_URL
93
- username: wercker_build