From 5bcd6e57bd7273d9ac86fb58c6992b4840ae7755 Mon Sep 17 00:00:00 2001 From: Kazuhiro MUSASHI Date: Sun, 5 Feb 2023 19:18:20 +0900 Subject: [PATCH] Add task for aws ec2 instance --- tasks/ubuntu.rake | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 tasks/ubuntu.rake diff --git a/tasks/ubuntu.rake b/tasks/ubuntu.rake new file mode 100755 index 0000000..0a2cea7 --- /dev/null +++ b/tasks/ubuntu.rake @@ -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