itamae-plugin-recipe-tmux 0.1.1 → 0.1.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
2
  SHA1:
3
- metadata.gz: 985aeb418bff1b85de901ed602bbb6e5517f7c59
4
- data.tar.gz: d35ccd3f24c71cbe0e8ca506f8446a58d9706d41
3
+ metadata.gz: d0db9ca4f6369bd34b96dd8db083768c9b67925e
4
+ data.tar.gz: f64265254b240a94a5aca820101739f4a856323b
5
5
  SHA512:
6
- metadata.gz: 8b65d2e31839638bcf23f31b2ef61a1136d2436ee28a91df55d341ac90d8af471432b169483dafc1263acb085e903b1443e3915da95f3c0fcb01d7c3c2f3f8be
7
- data.tar.gz: 939911cff50a1d1c0bf1734f3c86c4301e578b0ba4e38992247f276e4d7b2b8b5af14566fc3e8d53e952277866c636b3042bc027e2fa56b236fb0aa5dffa5d66
6
+ metadata.gz: 62a500ee6838100e978084b6816f4cfece5fbf7e54e29d9d731ee143e1940ba3a0103c07eb899fe3a737fae80eec98d0b09f8c98cad1f1c07928746b5815f852
7
+ data.tar.gz: d475ff7b6f9512af3ac01507533a19a7d489350d6b95a3cb8e6614f2c9f563f7f000fde41edc34c24dfe47d322675a65820edec18d0ef74b1d20527e9c7f7e85
data/.gitignore CHANGED
@@ -7,3 +7,4 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ .vagrant/
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --color
2
+ --format documentation
3
+ --require spec_helper
@@ -0,0 +1,13 @@
1
+ # Change Log
2
+
3
+ ## [v0.1.1](https://github.com/sue445/itamae-plugin-recipe-tmux/tree/v0.1.1) (2016/02/24)
4
+ [Full Changelog](https://github.com/sue445/itamae-plugin-recipe-tmux/compare/v0.1.0...v0.1.1)
5
+
6
+ **Merged pull requests:**
7
+
8
+ - Add runtime dependency [\#1](https://github.com/sue445/itamae-plugin-recipe-tmux/pull/1) ([sue445](https://github.com/sue445))
9
+
10
+ ## [v0.1.0](https://github.com/sue445/itamae-plugin-recipe-tmux/tree/v0.1.0) (2016/02/24)
11
+
12
+
13
+ \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
data/README.md CHANGED
@@ -5,6 +5,8 @@
5
5
  [![Gem Version](https://badge.fury.io/rb/itamae-plugin-recipe-tmux.svg)](https://badge.fury.io/rb/itamae-plugin-recipe-tmux)
6
6
  [![Dependency Status](https://gemnasium.com/sue445/itamae-plugin-recipe-tmux.svg)](https://gemnasium.com/sue445/itamae-plugin-recipe-tmux)
7
7
 
8
+ [![wercker status](https://app.wercker.com/status/f879bd39d3c0a5ac0480cd0286077fa4/m/master "wercker status")](https://app.wercker.com/project/bykey/f879bd39d3c0a5ac0480cd0286077fa4)
9
+
8
10
  ## Installation
9
11
 
10
12
  Add this line to your application's Gemfile:
@@ -58,6 +60,15 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
58
60
 
59
61
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
60
62
 
63
+ ## Testing
64
+ requirements [Vagrant](https://www.vagrantup.com/)
65
+
66
+ ```sh
67
+ vagrant up centos70
68
+ bundle exec rake itamae:centos70
69
+ bundle exec rake spec:centos70
70
+ ```
71
+
61
72
  ## Contributing
62
73
 
63
74
  Bug reports and pull requests are welcome on GitHub at https://github.com/sue445/itamae-plugin-recipe-tmux.
data/Rakefile CHANGED
@@ -1 +1,29 @@
1
1
  require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ task :spec => "spec:all"
5
+
6
+ HOSTS = %w(centos70 debian8)
7
+
8
+ namespace :spec do
9
+ task :all => HOSTS
10
+
11
+ HOSTS.each do |host|
12
+ RSpec::Core::RakeTask.new(host.to_sym) do |t|
13
+ puts "Running tests to #{host} ..."
14
+ ENV["TARGET_HOST"] = host
15
+ t.pattern = "spec/*_spec.rb"
16
+ end
17
+ end
18
+ end
19
+
20
+ namespace :itamae do
21
+ task :all => HOSTS
22
+
23
+ HOSTS.each do |host|
24
+ desc "Running itamae to #{host}"
25
+ task host do
26
+ sh "bundle exec itamae ssh --host=#{host} --vagrant --node-yaml=recipes/node.yml recipes/install.rb"
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,105 @@
1
+ # -*- mode: ruby -*-
2
+ # vi: set ft=ruby :
3
+
4
+ # All Vagrant configuration is done below. The "2" in Vagrant.configure
5
+ # configures the configuration version (we support older styles for
6
+ # backwards compatibility). Please don't change it unless you know what
7
+ # you're doing.
8
+ Vagrant.configure(2) do |config|
9
+ config.vm.provider :digital_ocean do |provider, override|
10
+ override.vm.box = "digital_ocean"
11
+ override.vm.box_url = "https://github.com/smdahlen/vagrant-digitalocean/raw/master/box/digital_ocean.box"
12
+ provider.token = ENV["DIGITALOCEAN_ACCESS_TOKEN"]
13
+ provider.region = "nyc1"
14
+ provider.size = "512MB"
15
+
16
+ if ENV["WERCKER"] == "true"
17
+ provider.ssh_key_name = "wercker-#{ENV['WERCKER_GIT_REPOSITORY']}"
18
+ override.ssh.private_key_path = "~/.ssh/id_rsa.vagrant"
19
+ else
20
+ provider.ssh_key_name = "local"
21
+ override.ssh.private_key_path = "~/.ssh/id_rsa"
22
+ end
23
+ end
24
+
25
+ config.vm.define :centos70 do |c|
26
+ c.vm.box = "centos/7"
27
+ c.vm.provider :digital_ocean do |provider, override|
28
+ provider.image = "centos-7-0-x64"
29
+ end
30
+ c.vm.hostname = 'itamae-centos70'
31
+ c.vm.hostname += "-#{ENV['WERCKER_BUILD_ID']}" if ENV['WERCKER_BUILD_ID']
32
+ end
33
+
34
+ config.vm.define :debian8 do |c|
35
+ c.vm.box = "debian/jessie64"
36
+ c.vm.provider :digital_ocean do |provider, override|
37
+ provider.image = "debian-8-x64"
38
+ end
39
+ c.vm.hostname = 'itamae-debian8'
40
+ c.vm.hostname += "-#{ENV['WERCKER_BUILD_ID']}" if ENV['WERCKER_BUILD_ID']
41
+ end
42
+
43
+ # The most common configuration options are documented and commented below.
44
+ # For a complete reference, please see the online documentation at
45
+ # https://docs.vagrantup.com.
46
+
47
+ # Every Vagrant development environment requires a box. You can search for
48
+ # boxes at https://atlas.hashicorp.com/search.
49
+ # config.vm.box = "base"
50
+
51
+ # Disable automatic box update checking. If you disable this, then
52
+ # boxes will only be checked for updates when the user runs
53
+ # `vagrant box outdated`. This is not recommended.
54
+ # config.vm.box_check_update = false
55
+
56
+ # Create a forwarded port mapping which allows access to a specific port
57
+ # within the machine from a port on the host machine. In the example below,
58
+ # accessing "localhost:8080" will access port 80 on the guest machine.
59
+ # config.vm.network "forwarded_port", guest: 80, host: 8080
60
+
61
+ # Create a private network, which allows host-only access to the machine
62
+ # using a specific IP.
63
+ # config.vm.network "private_network", ip: "192.168.33.10"
64
+
65
+ # Create a public network, which generally matched to bridged network.
66
+ # Bridged networks make the machine appear as another physical device on
67
+ # your network.
68
+ # config.vm.network "public_network"
69
+
70
+ # Share an additional folder to the guest VM. The first argument is
71
+ # the path on the host to the actual folder. The second argument is
72
+ # the path on the guest to mount the folder. And the optional third
73
+ # argument is a set of non-required options.
74
+ # config.vm.synced_folder "../data", "/vagrant_data"
75
+
76
+ # Provider-specific configuration so you can fine-tune various
77
+ # backing providers for Vagrant. These expose provider-specific options.
78
+ # Example for VirtualBox:
79
+ #
80
+ # config.vm.provider "virtualbox" do |vb|
81
+ # # Display the VirtualBox GUI when booting the machine
82
+ # vb.gui = true
83
+ #
84
+ # # Customize the amount of memory on the VM:
85
+ # vb.memory = "1024"
86
+ # end
87
+ #
88
+ # View the documentation for the provider you are using for more
89
+ # information on available options.
90
+
91
+ # Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
92
+ # such as FTP and Heroku are also available. See the documentation at
93
+ # https://docs.vagrantup.com/v2/push/atlas.html for more information.
94
+ # config.push.define "atlas" do |push|
95
+ # push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
96
+ # end
97
+
98
+ # Enable provisioning with a shell script. Additional provisioners such as
99
+ # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
100
+ # documentation for more information about their specific syntax and use.
101
+ # config.vm.provision "shell", inline: <<-SHELL
102
+ # sudo apt-get update
103
+ # sudo apt-get install -y apache2
104
+ # SHELL
105
+ end
@@ -0,0 +1,8 @@
1
+ #!/bin/bash -xe
2
+
3
+ readonly HOST=$1
4
+
5
+ vagrant up $HOST --provider=digital_ocean
6
+ bundle exec rake itamae:$HOST
7
+ bundle exec rake spec:$HOST
8
+ vagrant destroy -f $HOST
@@ -0,0 +1,22 @@
1
+ # via. https://github.com/itamae-kitchen/itamae/blob/v1.9.3/ci/destroy_old_droplets.rb
2
+ require 'net/https'
3
+ require 'json'
4
+ require 'time'
5
+
6
+ http = Net::HTTP.new("api.digitalocean.com", 443)
7
+ http.use_ssl = true
8
+
9
+ res = http.start do
10
+ http.get("/v2/droplets", "Authorization" => "Bearer #{ENV['DIGITALOCEAN_ACCESS_TOKEN']}")
11
+ end
12
+
13
+ droplets = JSON.parse(res.body)['droplets']
14
+ droplets.each do |droplet|
15
+ next unless /^itamae-/ =~ droplet['name']
16
+ if Time.now - Time.parse(droplet['created_at']) >= 60 * 60
17
+ puts "destroying #{droplet}..."
18
+ res = http.start do
19
+ http.delete("/v2/droplets/#{droplet['id']}", "Authorization" => "Bearer #{ENV['DIGITALOCEAN_ACCESS_TOKEN']}")
20
+ end
21
+ end
22
+ end
@@ -21,6 +21,9 @@ Gem::Specification.new do |spec|
21
21
 
22
22
  spec.add_dependency "itamae"
23
23
 
24
- spec.add_development_dependency "bundler", "~> 1.11"
24
+ # NOTE: for vagrant dependency
25
+ # https://github.com/mitchellh/vagrant/blob/v1.8.1/vagrant.gemspec#L18
26
+ spec.add_development_dependency "bundler", ">= 1.5.2", "<= 1.10.6"
25
27
  spec.add_development_dependency "rake", "~> 10.0"
28
+ spec.add_development_dependency "serverspec"
26
29
  end
@@ -15,6 +15,7 @@ node.reverse_merge!(
15
15
 
16
16
  # via. http://minomawari.jp/2014/04/09/how-to-install-tmux-for-non-root-users/
17
17
  # via. http://qiita.com/ikai/items/8cb49aad82351881a583
18
+ include_recipe "./dependency"
18
19
  include_recipe "./libevent"
19
20
  include_recipe "./ncurses"
20
21
  include_recipe "./tmux"
@@ -0,0 +1,3 @@
1
+ package "wget"
2
+ package "gcc"
3
+ package "make"
@@ -13,7 +13,7 @@ check_command = "#{node[:tmux][:prefix]}/bin/tmux -V | grep #{node[:tmux][:versi
13
13
  end
14
14
 
15
15
  [
16
- "./configure --prefix=#{node[:tmux][:prefix]} LDFLAGS='-L#{node[:tmux][:prefix]}/lib' CFLAGS='-I#{node[:tmux][:prefix]}/include'",
16
+ "./configure --prefix=#{node[:tmux][:prefix]} LDFLAGS='-L#{node[:tmux][:prefix]}/lib' CFLAGS='-I#{node[:tmux][:prefix]}/include -I#{node[:tmux][:prefix]}/include/ncurses/'",
17
17
  "make",
18
18
  "make install",
19
19
  ].each do |command|
@@ -2,7 +2,7 @@ module Itamae
2
2
  module Plugin
3
3
  module Recipe
4
4
  module Tmux
5
- VERSION = "0.1.1"
5
+ VERSION = "0.1.2"
6
6
  end
7
7
  end
8
8
  end
@@ -0,0 +1 @@
1
+ include_recipe "tmux"
@@ -0,0 +1,3 @@
1
+ tmux:
2
+ version: "2.1"
3
+ prefix: "/usr/local"
@@ -0,0 +1,81 @@
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: sue445/rvm-vagrant-digitalocean@1.0.0
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
+ # - mongodb
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
+ - rvm-use:
25
+ version: 2.3.0
26
+
27
+ - bundle-install:
28
+ jobs: 4
29
+ version: 1.10.6
30
+
31
+ - script:
32
+ name: echo ruby information
33
+ code: |
34
+ echo "ruby version $(ruby --version) running"
35
+ echo "from location $(which ruby)"
36
+ echo -p "gem list: $(gem list)"
37
+
38
+ - script:
39
+ name: create .ssh directory
40
+ code: mkdir -p $HOME/.ssh
41
+
42
+ - create-file:
43
+ name: put private key
44
+ filename: $HOME/.ssh/id_rsa.vagrant
45
+ overwrite: true
46
+ hide-from-log: true
47
+ content: $DIGITALOCEAN_KEY_PRIVATE
48
+
49
+ - create-file:
50
+ name: put public key
51
+ filename: $HOME/.ssh/id_rsa.vagrant.pub
52
+ overwrite: true
53
+ hide-from-log: true
54
+ content: $DIGITALOCEAN_KEY_PUBLIC
55
+
56
+ - script:
57
+ name: chmod 600 id_rsa
58
+ code: chmod 600 $HOME/.ssh/id_rsa.vagrant
59
+
60
+ - script:
61
+ name: test centos70
62
+ code: ./ci/build.sh centos70
63
+
64
+ - script:
65
+ name: test debian8
66
+ code: ./ci/build.sh debian8
67
+
68
+ after-steps:
69
+ - script:
70
+ name: shutdown all vms
71
+ code: |
72
+ vagrant destroy -f centos70
73
+ vagrant destroy -f debian8
74
+
75
+ - script:
76
+ name: shutdown old vms
77
+ code: bundle exec ruby ci/destroy_old_droplets.rb
78
+
79
+ - wantedly/pretty-slack-notify:
80
+ webhook_url: $SLACK_WEBHOOK_URL
81
+ username: wercker_build
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itamae-plugin-recipe-tmux
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - sue445
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-02-24 00:00:00.000000000 Z
11
+ date: 2016-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: itamae
@@ -28,16 +28,22 @@ dependencies:
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 1.5.2
34
+ - - "<="
32
35
  - !ruby/object:Gem::Version
33
- version: '1.11'
36
+ version: 1.10.6
34
37
  type: :development
35
38
  prerelease: false
36
39
  version_requirements: !ruby/object:Gem::Requirement
37
40
  requirements:
38
- - - "~>"
41
+ - - ">="
39
42
  - !ruby/object:Gem::Version
40
- version: '1.11'
43
+ version: 1.5.2
44
+ - - "<="
45
+ - !ruby/object:Gem::Version
46
+ version: 1.10.6
41
47
  - !ruby/object:Gem::Dependency
42
48
  name: rake
43
49
  requirement: !ruby/object:Gem::Requirement
@@ -52,6 +58,20 @@ dependencies:
52
58
  - - "~>"
53
59
  - !ruby/object:Gem::Version
54
60
  version: '10.0'
61
+ - !ruby/object:Gem::Dependency
62
+ name: serverspec
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
55
75
  description: Itamae plugin to install tmux without any packages
56
76
  email:
57
77
  - sue445@sue445.net
@@ -61,19 +81,28 @@ extra_rdoc_files: []
61
81
  files:
62
82
  - ".github_changelog_generator"
63
83
  - ".gitignore"
84
+ - ".rspec"
85
+ - CHANGELOG.md
64
86
  - Gemfile
65
87
  - LICENSE.txt
66
88
  - README.md
67
89
  - Rakefile
90
+ - Vagrantfile
68
91
  - bin/console
69
92
  - bin/setup
93
+ - ci/build.sh
94
+ - ci/destroy_old_droplets.rb
70
95
  - itamae-plugin-recipe-tmux.gemspec
71
96
  - lib/itamae/plugin/recipe/tmux.rb
72
97
  - lib/itamae/plugin/recipe/tmux/default.rb
98
+ - lib/itamae/plugin/recipe/tmux/dependency.rb
73
99
  - lib/itamae/plugin/recipe/tmux/libevent.rb
74
100
  - lib/itamae/plugin/recipe/tmux/ncurses.rb
75
101
  - lib/itamae/plugin/recipe/tmux/tmux.rb
76
102
  - lib/itamae/plugin/recipe/tmux/version.rb
103
+ - recipes/install.rb
104
+ - recipes/node.yml
105
+ - wercker.yml
77
106
  homepage: https://github.com/sue445/itamae-plugin-recipe-tmux
78
107
  licenses:
79
108
  - MIT