From dc1afdf3ecbb34635867f7d5783229efdcd5f290 Mon Sep 17 00:00:00 2001 From: RENAUX Anna <anna.renaux5@etu.univ-lorraine.fr> Date: Mon, 8 Jan 2024 16:05:52 +0000 Subject: [PATCH] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..9fbb706 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,27 @@ +stages: + - build + - test + - deploy + +variables: + DOCKER_IMAGE_TAG: latest + +before_script: + - apt-get update -qy + - apt-get install -y python3 python3-pip + +build: + stage: build + script: + - pip3 install -r requirements.txt + +test: + stage: test + script: + - python3 -m unittest discover + +deploy: + stage: deploy + script: + - docker build -t my-python-app:$DOCKER_IMAGE_TAG . + - docker run -p 9090:9090 my-python-app:$DOCKER_IMAGE_TAG -- GitLab