Skip to content

Commit ba97b9f

Browse files
committed
setup/fix basic CI
Signed-off-by: Ben Abrams <me@benabrams.it>
1 parent 74a74b7 commit ba97b9f

File tree

9 files changed

+110
-3
lines changed

9 files changed

+110
-3
lines changed

.kitchen.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
driver:
3+
name: docker
4+
use_sudo: false
5+
6+
provisioner:
7+
name: shell
8+
data_path: .
9+
script: test/fixtures/bootstrap.sh
10+
11+
verifier:
12+
ruby_bindir: /usr/local/bin
13+
14+
platforms:
15+
- name: debian-8
16+
17+
suites:
18+
- name: ruby-230
19+
driver:
20+
image: ruby:2.3.0-slim
21+
- name: ruby-241
22+
driver:
23+
image: ruby:2.4.1-slim

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ script:
2626
deploy:
2727
provider: rubygems
2828
api_key:
29-
secure: iXvvVJhGsNcWNLhX6EBFK9gWbvH5CRFFx53vqPD3uuEFiPB+U5TRLG5sLVeqOrkloQ05qbkjuPlW4BOf2McEw1eaxCuW0FhAfRJEfl4nnoUYx9nya3a0WU4Vq7rJaUclHusgGfUebEgLYBFpsOzzg0rXnAkv3tQ2fFkurxNIOjbB/lQAspHQJw86qePOLMT7OIt1v2fwuySwRHT+d+nyCmJ8yNpbkMK0BDbE2MuXmOVHJk6DsVY8mOi8CMQ7Mda7aQvWua+ECHf/KXnokNh9gUoqdppGmJ/7nrtOp3MKT1/B52AhSlm5aqrsXG5K4mQduHhp4vtK+zFs9M84CY+onyaKo+tLtEPgsisNDkZgUdvASHWWv2iIxjRyQggfs8mqwkoJvncGEHukPfsuo6cBAmDbKd9zZZjID9VC8PD7xql9meCNRP5UtEPPBsKji6uJ9CbRskVfFcVXJWhAz7aDs1cMUgY0j0VEmPY6MTAxKaQWkk3Vxe1wDe8U1nBud5zoQjoVCBx0wOrNzjEc5RmyIxJM7NrbvPzSzua/Olvhgb5j+0AgrQLXTsK9i/Sth8LzWt+WG5uE/cOinb6w4AL80XmunntqSIT3ADRbtqAhbPbaWc+7j5a/hywTiqoZuGxckLkRlvHqs3DeX1YUUnz+0ngVjSx82/mxbS493dH0i/8=
30-
gem: sensu-plugins-skel
29+
secure: apVfqhmIVfG3wZZkBCdvtzrfpA3V5kXs9cOFIAvas4Z9tXfLDiWnTSSQZvjlXqdMAm9HXBZeHQOnDPCl4ia2jd/USVX0MccA2wNHyKqb16cxOk5jCZYv7SgzcJrw8x4pfjKDmisYbWvTBJdk/Owl6sTEeUi/H7PTuwXmR1ZAmgKZR2JZG7ziQoFDSCwZR8tcYUTCaq+S9PeotcFxn35/TXh7Ya22jVVOS5iIRtGSrJi4H8MVp+rOJ6ZOXbYQT6GumzkkHTvta8HoIuwJHXT2jjD3DFVAuPd7MfiG1WB0KbmRNgqLN6uJ7yvtuF/2dg1J3FGEyAJod0oh46X8YkbJxDiGpgkk+HmNBBDpE3HBtpmfLzQNZjjknEfcbTxr+JD2c1xuckuSUX/fv7HSlpFy2v8ESNYROwXxBY5SoyaQ3TuT3vsmCIJ2ek8Jfqg80CvNHJ670YK3JMNGEK7HTNC5eYXz9eOyb20Cd/mmbWAFL2ooP4g9eJ9mEO+82OMjMPpD1QAya/9Cp2GisqrNrmp7g6U/OqQ9MliHoijr6PXy+kfY+TxdbBYOuLhJdfjEINKp9d3+9fOi7sMOg3IwmEUSFMFHcZtbUK96NlbgdsnunLbIVfz8q6s2m1XVzoh7q4BamTD6SqBP74vx7VaK3vl1FxXLlMLwxGV/5bEXUo88FHc=
30+
gem: sensu-plugins-vault
3131
on:
3232
tags: true
3333
all_branches: true
3434
rvm: 2.4.1
35-
repo: sensu-plugins/sensu-plugins-skel
35+
repo: sensu-plugins/sensu-plugins-vault

Rakefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ require 'rubocop/rake_task'
88
require 'yard'
99
require 'yard/rake/yardoc_task'
1010
require 'English'
11+
require 'kitchen/rake_tasks'
1112

1213
YARD::Rake::YardocTask.new do |t|
1314
OTHER_PATHS = %w[].freeze
@@ -40,5 +41,10 @@ task :check_binstubs do
4041
end
4142
end
4243

44+
Kitchen::RakeTasks.new
45+
desc 'Alias for kitchen:all'
46+
task integration: 'kitchen:all'
47+
4348
task default: %i[spec make_bin_executable yard rubocop check_binstubs]
49+
4450
task quick: %i[make_bin_executable yard rubocop check_binstubs]

test/fixtures/bootstrap.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
#
3+
# Set up a super simple web server and make it accept GET and POST requests
4+
# for Sensu plugin testing.
5+
#
6+
7+
set -e
8+
9+
# base utilities that need to exist to start bootatraping
10+
apt-get update
11+
# apt-get install -y wget
12+
13+
# setup the rubies
14+
source /etc/profile
15+
DATA_DIR=/tmp/kitchen/data
16+
RUBY_HOME=${MY_RUBY_HOME}
17+
18+
# Start bootatraping
19+
20+
## install some required deps for pg_gem to install
21+
22+
23+
# End of Actual bootatrap
24+
25+
# Install gems
26+
cd $DATA_DIR
27+
SIGN_GEM=false gem build sensu-plugins-vault.gemspec
28+
gem install sensu-plugins-vault-*.gem
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# frozen_string_literal: true
2+
3+
require 'spec_helper'
4+
require 'shared_spec'
5+
6+
gem_path = '/usr/local/bin'
7+
check_name = 'check-vault-sealed.rb'
8+
check = "#{gem_path}/#{check_name}"
9+
10+
describe 'ruby environment' do
11+
it_behaves_like 'ruby checks', check
12+
end
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# frozen_string_literal: true
2+
3+
require 'spec_helper'
4+
5+
shared_examples_for 'ruby checks' do |check|
6+
describe command('which ruby') do
7+
its(:exit_status) { should eq 0 }
8+
its(:stdout) { should match(/\/usr\/local\/bin\/ruby/) }
9+
end
10+
11+
describe command('which gem') do
12+
its(:exit_status) { should eq 0 }
13+
its(:stdout) { should match(/\/usr\/local\/bin\/gem/) }
14+
end
15+
16+
describe command("which #{check}") do
17+
its(:exit_status) { should eq 0 }
18+
its(:stdout) { should match(Regexp.new(Regexp.escape(check))) }
19+
end
20+
21+
describe file(check) do
22+
it { should be_file }
23+
it { should be_executable }
24+
end
25+
end
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# frozen_string_literal: true
2+
3+
require 'serverspec'
4+
5+
set :backend, :exec
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# frozen_string_literal: true
2+
3+
require 'spec_helper'
4+
require 'shared_spec'
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# frozen_string_literal: true
2+
3+
require 'spec_helper'
4+
require 'shared_spec'

0 commit comments

Comments
 (0)