Add task for aws ec2 instance

This commit is contained in:
Kazuhiro MUSASHI 2023-02-05 19:18:20 +09:00
parent 0bfd4a7d53
commit 5bcd6e57bd
1 changed files with 9 additions and 0 deletions

9
tasks/ubuntu.rake Executable file
View File

@ -0,0 +1,9 @@
#!/usr/bin/env rake
desc 'Invoke itamae command for the first time'
task :ubuntu do
node = `ls -1 nodes/*.json | xargs -I % basename % .json | fzf`
node.chomp!
sh "ITAMAE_PASSWORD=musashi bundle ex itamae ssh -u ubuntu -i ~/.ssh/amazon.pem --host #{node} -j nodes/#{node}.json entrypoint.rb"
end