Skip to content

Commit 71df994

Browse files
committed
Set up a mitamae environment
1 parent f3c0b80 commit 71df994

File tree

6 files changed

+59
-0
lines changed

6 files changed

+59
-0
lines changed

Gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ source 'https://rubygems.org'
22

33
gem 'rake'
44
gem 'test-unit'
5+
gem 'hocho'

Gemfile.lock

+26
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,41 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4+
ansi (1.5.0)
5+
hashie (4.1.0)
6+
hocho (0.3.7)
7+
hashie
8+
itamae
9+
net-ssh (>= 4.1.0)
10+
thor
11+
itamae (1.12.1)
12+
ansi
13+
hashie
14+
schash (~> 0.1.0)
15+
specinfra (>= 2.64.0, < 3.0.0)
16+
thor
17+
net-scp (3.0.0)
18+
net-ssh (>= 2.6.5, < 7.0.0)
19+
net-ssh (6.1.0)
20+
net-telnet (0.1.1)
421
power_assert (1.1.4)
522
rake (12.3.3)
23+
schash (0.1.2)
24+
sfl (2.3)
25+
specinfra (2.82.25)
26+
net-scp
27+
net-ssh (>= 2.7)
28+
net-telnet (= 0.1.1)
29+
sfl
630
test-unit (3.3.3)
731
power_assert
32+
thor (1.1.0)
833

934
PLATFORMS
1035
ruby
1136

1237
DEPENDENCIES
38+
hocho
1339
rake
1440
test-unit
1541

bin/hocho

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
prefix=()
3+
4+
if [[ -z "$SUDO_PASSWORD" ]]; then
5+
if which envchain > /dev/null 2>&1 && envchain --list | grep -q sudo; then
6+
prefix=("envchain" "sudo")
7+
else
8+
echo "Environment variable \$SUDO_PASSWORD must be set."
9+
echo "Retry this after installing envchain and running: envchain --set sudo SUDO_PASSWORD"
10+
exit 1
11+
fi
12+
fi
13+
14+
exec "${prefix[@]}" bundle exec hocho "$@"

hocho.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
property_providers:
2+
- add_default:
3+
properties:
4+
preferred_driver: mitamae
5+
6+
driver_options:
7+
mitamae:
8+
mitamae_path: /usr/local/bin/mitamae
9+
mitamae_options: ['--log-level', 'info']
10+
mitamae_prepare_script: |
11+
wget -O /usr/local/bin/mitamae https://github.com/itamae-kitchen/mitamae/releases/download/v1.12.7/mitamae-x86_64-linux &&
12+
chmod +x /usr/local/bin/mitamae

hosts.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
git.ruby-lang.org:
2+
properties:
3+
sudo_required: true
4+
run_list:
5+
- recipes/default.rb

recipes/default.rb

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
execute 'echo hello'

0 commit comments

Comments
 (0)