Its repository contains the scripts necessary to automate the deployment of the Smart-Shell project, which is integrated by five independent repositories in the same server.
The automation includes the configuration of the environment variables, cloning of repositories, generation of SSL certificates, configuration of the Nginx server (Reverse Proxy) and finally the continuous development/deployment.
- Smart-Shell-Postgres PosgresSQL: Database for the storage of structured data.
- Smart-Shell-Mongo MongoDB: Database for the storage of non-structured data.
- Smart-Shell-Redis Redis: Database for the storage of key-value data.
- Smart-Shell-SpringBoot SpringBoot: BackEnd for the business logic.
- Smart-Shell-Angular Angular: FrontEnd for the user interface.
-
Create a new directory
sudo mkdir /var/www/smart-shell sudo mkdir /var/www/smart-shell/configurations
-
Change the owner of the directory
sudo chown -R $USER:$USER /var/www/smart-shell
-
Clone the repository
cd /var/www/smart-shell/configurations git clone git@github.com:luis122448/smart-shell-bash.git git clone https://github.com/luis122448/smart-shell-bash.git
-
Define the environment variables
First, define the IP address of the server for $SERVER_LOCAL_HOST variable:
ip -4 addr show docker0 | grep -Po 'inet \K[\d.]+'
Then, define the environment variables in /etc/environment:
sudo nano /etc/environment
SERVER_LOCAL_HOST= SERVER_LOCAL_USER= DATABASE_USERNAME= DATABASE_PASSWORD= SMART_SHELL_POSTGRES_PORT=10001 SMART_SHELL_REDIS_PORT=10002 SMART_SHELL_MONGO_PORT=10003 SMART_SHELL_SPRINGBOOT_PORT=10004 SMART_SHELL_ANGULAR_PORT=10005
Charge the environment variables:
source /etc/environment
Nota: The password defined in the DATABASE_PASSWORD variable will be used for the configuration of all databases.
-
Execute the installation script
bash install.sh
-
Verify the installation
tree /var/www/smart-shell/deployments /var/www/smart-shell/deployments ├── smart-shell-postgres ├── smart-shell-redis ├── smart-shell-mongo ├── smart-shell-springboot ├── smart-shell-angular └── ...
-
Execute the deployment script
bash deploy.sh
-
Verify the deployment
sudo docker ps
-
Generate the SSH certificates and configure the NGINX server
Review the file ./scripts/ssh/README.md to generate the SSH certificates according to the domain to be used for the Back and Front. Additionally, review the instructions in ./scripts/proxy/README.md for the configuration of the NGINX server.
smart-shell-bash/ ├── scripts/ │ ├── ssh/ │ │ ├── README.md │ │ └── ... │ ├── proxy/ │ │ ├── luis122448.com.conf ( Front ) │ │ ├── luis122448.dev.conf ( Back ) │ │ ├── options-ssl-nginx.conf │ │ ├── README.md │ │ └── ... │ └── ... └── ...
All contributions are welcome. For more information, please refer to the CONTRIBUTING file.
Its project is licensed under the terms of the Creative Commons Attribution-NonCommercial 4.0 License.