There are two pipelines in gitlab --> build & deploy
In deploy pipeline I want to copy dist folder into my ec2 directory that's why I want to ssh into my ec2.
command I have put in yml file & settled variables also :
$ ssh -tt -i $Server_pem ubuntu@Server_IP
but when deploy pipeline it shows error :
ssh: Could not resolve hostname server_ip: Name or service not known
Ec2 Instance Details :
Ubuntu AMIUsing Public DNS / IP : ec2-XX-XXX-XX-XX.ap-south-1.compute.amazonaws.com Instance can be accessed from outside ( configured security group for this)
GitLab Details :
I'm using Gitlab shared runners for this (Personal account) &Added SHA (RSA) key in Server_pem file in variables for connection EC2
help me to solve this issue and if any other way I can copy my build please let me know.
Thank you in advance :)