From 5f9f394157988443dffaf46d3fb3281903b15dd3 Mon Sep 17 00:00:00 2001 From: Joy A Date: Tue, 16 Jan 2024 14:33:38 +0530 Subject: [PATCH] avniproject/avni-product#1445 | Fix circleci config - Escape aws cli multi-line command --- .circleci/config.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6ab5d4258..2678e886c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -73,7 +73,7 @@ commands: - run: rm ~/.vault-pass.txt - setup-rwb-server-access: + setup-server-access: description: Generate and copy temporary keys to server parameters: instance-id: @@ -89,12 +89,13 @@ commands: - run: ssh-keygen -b 2048 -t rsa -f /tmp/temp_rsa_key -q -N "" - run: eval `ssh-agent -s` - run: ssh-add /tmp/temp_rsa_key - - run: aws ec2-instance-connect send-ssh-public-key \ - --instance-id << parameters.instance-id >> \ - --availability-zone << parameters.availability-zone >> \ - --instance-os-user << parameters.os-user >> \ - --no-paginate \ - --ssh-public-key file:///tmp/temp_rsa_key.pub \ + - run: | + aws ec2-instance-connect send-ssh-public-key \\ + --instance-id << parameters.instance-id >> \\ + --availability-zone << parameters.availability-zone >> \\ + --instance-os-user << parameters.os-user >> \\ + --no-paginate \\ + --ssh-public-key file:///tmp/temp_rsa_key.pub \\ --output text | head -1 jobs: test: @@ -281,7 +282,7 @@ jobs: - aws-cli/setup: role_arn: "arn:aws:iam::730335671779:role/avni_circleci_instance_connect" region: "ap-south-1" - - setup-rwb-server-access: + - setup-server-access: instance-id: "i-00b50ac6e8413fdca" availability-zone: "ap-south-1b" - deploy_as_service: @@ -292,7 +293,7 @@ jobs: - image: cimg/deploy:2023.09 working_directory: ~/ steps: - - setup-rwb-server-access: + - setup-server-access: instance-id: "i-015a3839bfe137346" availability-zone: "ap-south-1a" - deploy_as_service: