1

I'm using a series of commands for deploying my files to production,This is done manually currently.Is it possible to make these commands to an executable file,So that i don't have to copy paste these commands each and every time. When the first line is executed ie, connecting to the root server it will ask for the password and have to paste the password: xxxxxxxxxxxxxx

I'm using mac system.

if you have any idea please let me know?

ssh root@server
pwd: xxxxxxxxxxxxxx
ssh-agent bash
ssh-add bi-master
cd /home/trans/bimaster
git status
git pull [email protected]:xxxxxxxxx/bimaster.git master

1 Answer 1

2

Yes it is possible, normally people use services like Jenkins (free) or bamboo (not free) to run deployment tasks, then you can save credentials on the bamboo/Jenkins server and write a deployment script or pipeline to do the deployment steps.

You should also consider setting up ssh keys on your local machine (public private keypair with ssh-keygen) and the remote (just the public key - ssh-copy-id can do this IIRC) so you don't have to rely on password logins on the remote login. generally, ssh keys are considered more secure and practical than using passwords.

Also, don't do things as the root user unless you have no other choice or you're just testing. Running things as root in production is asking for trouble.

Sign up to request clarification or add additional context in comments.

2 Comments

Hi ,I'm the admin of the server, Since the project is been done by different teams as of now we have decided to do manual deployment as we have to check the status of some files.So for manual deployment is there a way to make a .exe or batch file to run the repeating commands?
Probably, but I don't do Windows, sorry

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.