Skip to content

Instantly share code, notes, and snippets.

@kou029w
kou029w / Vagrantfile
Last active February 21, 2018 03:50
rails on centos, vagrant
Vagrant.configure('2') do |config|
config.vm.box = 'centos/7'
config.vm.network 'forwarded_port', guest: 3000, host: 3000
config.vm.provision 'shell', privileged: false, inline: <<~'SCRIPT'
# anyenv のインストール
sudo yum install -y git
git clone https://github.com/riywo/anyenv ~/.anyenv
echo 'export PATH="$HOME/.anyenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(anyenv init -)"' >> ~/.bash_profile
@kou029w
kou029w / Vagrantfile
Created February 20, 2018 07:24
Docker on CentOS on Vagrant
script = <<~'SCRIPT'
# Docker Engine のインストール (http://docs.docker.jp/engine/installation/linux/docker-ce/centos.html)
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum install -y docker-ce
# Docker Compose のインストール (http://docs.docker.jp/compose/install.html)
curl -fsSL -o /usr/local/bin/docker-compose $(curl -sI https://github.com/docker/compose/releases/latest | sed -n "/^Location:/{s/^.* //;s#/tag/#/download/#;s#\\r\$#/docker-compose-$(uname -s)-$(uname -m)#;p;}")
chmod +x /usr/local/bin/docker-compose
curl -fsSL https://raw.githubusercontent.com/docker/compose/$(/usr/local/bin/docker-compose version --short)/contrib/completion/bash/docker-compose -o /usr/share/bash-completion/completions/docker-compose
@kou029w
kou029w / rspec-slack.rb
Created February 16, 2018 03:57
RSpecの開始と終了をSlackに通知する
require 'slack-ruby-client'
Slack.configure do |config|
config.token = ENV.fetch('SLACK_API_TOKEN', '')
end
RSpec.configure do |config|
config.before(:suite) do
chat_post ':stopwatch: Running...'
end