diff --git a/deploy/calculator.service b/deploy/calculator.service new file mode 100644 index 0000000000000000000000000000000000000000..8fdabe01ba5c75c035566159675790c1b39cfc8f --- /dev/null +++ b/deploy/calculator.service @@ -0,0 +1,12 @@ +Description=CiCd. +After=network.target +StartLimitIntervalSec=0 + +[Service] +Type=simple +ExecStart=python3 -m uvicorn server:app --port 80 --host 0.0.0.0 +User=root +WorkingDirectory=/var/www/cicd/calculator + +[Install] +WantedBy=multi-user.target diff --git a/deploy/setup.md b/deploy/setup.md new file mode 100644 index 0000000000000000000000000000000000000000..7ab3d03e4dae842aa4613ecb028234be758dfbd4 --- /dev/null +++ b/deploy/setup.md @@ -0,0 +1,29 @@ +# Setup la vm pour notre calculatrice + +## Clone le repo + +```bash +mkdir -p /var/www +cd /var/www +git clone https://gitlab.viarezo.fr/<login>/cicd.git +``` + +## Installe les dépendances + +```bash +cd cicd +pip install -r requirements.txt +``` + +## Ajoute le service + +```bash +cp deploy/calculator.service /etc/systemd/system/ +systemctl daemon-reload +systemctl enable calculator +systemctl start calculator +``` + +## Dans ton navigateur + +- "http://ip-de-la-vm:80/"