cat << 'EOF' > README.md
Welcome to the I-Terroni-DevOps repository for the ITU-MiniTwit application. This project is a micro-blogging platform built with Pyramid and deployed automatically using Docker and Vagrant on DigitalOcean.
We deploy our software using a Virtual Machine (Droplet) hosted on DigitalOcean, fully automated via Vagrant (Infrastructure as Code).
Before provisioning or deploying, ensure you have the following installed on your local machine (all the following command had been tested on Ubuntu 22.04):
- Vagrant
- The Vagrant DigitalOcean plugin. Install it by running:
vagrant plugin install vagrant-digitalocean
Every collaborator must create their own local .env file in the root of the cloned repository. Do not commit this file.
Create a .env file in the project root and add your DigitalOcean details:
export DO_TOKEN="your_personal_access_token_here"
export DO_SSH_KEY_NAME="your_key_name_on_digitalocean"
export DO_SSH_KEY_PATH="~/.ssh/id_ed25519" #path to your private keyTo create the infrastructure from scratch, our Vagrantfile reads your secrets and spins up an ubuntu-22-04-x64 server in the fra1 region. It also automatically installs Docker and Docker Compose.
Load your environment variables:
source .envTell Vagrant to create the server:
vagrant up --provider=digital_oceanOnce the server is running, deploy the latest version of the application using our automated deployment script. This script syncs the project files to the /vagrant folder on the server, stops existing containers, and builds/starts the new ones.
Ensure the script has execution permissions:
chmod +x deploy_software.shRun the deployment script:
./deploy_software.shUpon success, the script will output the public IP and the live URLs for the MiniTwit App (port 8080) and the Simulator API.
To verify the deployment was successful, test the live endpoints against the public IP of the server. We use the provided Pytest suite configured for our public server address.
pytest minitwit_sim_api_test.pyIf all tests pass, the application API is correctly tracking the latest variable and handling JSON payloads for registering, following, and tweeting!
AI Disclosure: Portions of this codebase were generated or optimized using LLMs. All AI-generated logic has been reviewed and tested for accuracy and security.