The phoenix-server-deploy
script is a powerful automation tool designed to streamline the deployment process of web applications to an Ubuntu server. This Windows batch script efficiently packages and transfers important files and folders from your local environment to a remote Ubuntu server, ensuring a smooth and consistent deployment process.
- Automated Zipping: Compresses specified files and folders into a zip archive for efficient transfer.
- Secure Transfer: Utilizes
scp
for secure file transmission to the Ubuntu server. - Service Management: Remotely stops the server service before deployment and restarts it after completion.
- Server Clean-up: Automatically deletes the existing application directory on the server and replaces it with the latest version.
- Dependency Management: Handles mix dependencies and database migrations on the server.
- Easy to Use: With SSH keys set up in the environment, the script offers a hassle-free deployment experience.
- Windows environment for running the batch script.
zip
,scp
, andssh
installed on the local machine.- SSH key-based authentication set up for the target Ubuntu server.
- Properly configured server service and application directory paths in the script.
deploy.env
USERNAME=your_username
KEY_PATH=path_to_your_private_key
SERVER_ADDRESS=your.server.address
- Edit the environment file to specify the source directory, destination directory, server user, server IP, and server service name.
- Run the script by double-clicking
phoenix-server-deploy.bat
or executing it in the command prompt. - Monitor the output for successful completion or any error messages.
This script performs significant operations like file transfer and directory deletion. It is highly recommended to test it in a non-production environment and ensure you have backups of critical data before use.