Home Doing git clone with bash script, could not read Password for repository
Reply: 0

Doing git clone with bash script, could not read Password for repository

user1142
1#
user1142 Published in June 20, 2018, 1:21 am

I'm trying to deploy Amazon EC2 instance through CloudFormation and I'm trying to clone a repository with a bash script with cfn-init.

"UserData" : { "Fn::Base64" : { "Fn::Join" : ["", [
                "#! /bin/bash -xe\n",
                "yum install -y aws-cfn-bootstrap\n",
                "/opt/aws/bin/cfn-init -v ",
                "       --stack ", { "Ref" : "AWS::StackName" },
                "       --resource DocumentationInstance ",
                "       --configsets Install ",
                "       --region ", { "Ref" : "AWS::Region" }, "\n",
                "git clone https://", { "Ref": "GitLabUsn" },"@gitlab.com/user/repository.git \n", { "Ref": "GitLabPwd" }  
                ]]}}
        }

However, when I deploy the EC2 instance, I can see from cloud-init-output.log that the git clone fails, and this is the error:

fatal: could not read Password for 'https://username@gitlab.com': No such device or address

How can I input the password with the bash script correctly? I've tried the yes found here

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.311598 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO