H
H
hckn2018-07-28 23:29:31
linux
hckn, 2018-07-28 23:29:31

How can this script be optimized?

I wrote the first script in my life for the initial deployment of the application (the application consists of two separate ones - the front and the API).
1. full VPS setup, installation of dependencies, config for the server, etc.
2. copying the keys from the git, cloning repositories, installing dependencies and running them
3. transferring the database, transferring statics (pictures)

#!/bin/bash

USER=iamuser
HOST=88.88.88.88
DOMAIN=example.com

scp keys/* $USER@$HOST:/home/$USER/.ssh

Everything works surprisingly flawlessly. But since this is the first experience and I have not studied bash scripting at all (from the word in general), I suspect there are stupid moments, and in general it is possible to somehow optimize the whole thing. I ask for help and criticism from more experienced developers.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Stupenkov, 2018-07-29
@hckn

Try ansible

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question