From bbc8431cc3db08e0c538cbc23c701747d0a75580 Mon Sep 17 00:00:00 2001 From: Leo Date: Sat, 12 Sep 2026 05:21:38 +0000 Subject: [PATCH] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..ca1ad0e --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,35 @@ +default: + tags: + - universal + +stages: + - build + - tests + - deploy + +build_job1: + image: docker:latest + script: + - docker build -t quote-bot:v1 . + +tests_job1: + stage: tests + image: python:3.11-slim + before_script: + - pip install --no-cache-dir -r requirements.txt + - pip install pytest + script: + - pytest tests/ + +deploy_to_server: + stage: deploy + image: cytopia/ansible:latest + variables: + ANSIBLE_HOST_KEY_CHECKING: "False" + before_script: + - echo "$ANSIBLE_PRIVATE_KEY" > ./deploy_key + - chmod 600 ./deploy_key + script: + - cd auto-deployment/ + - ansible-playbook -i inventory.ini A_deploy.yml --private-key=./deploy_key +