Skip to content

Commit

Permalink
avniproject/avni-product#1445 | Fix circleci config - Escape aws cli …
Browse files Browse the repository at this point in the history
…multi-line command
  • Loading branch information
1t5j0y committed Jan 16, 2024
1 parent 9e706c5 commit 5f9f394
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down

0 comments on commit 5f9f394

Please sign in to comment.