From e5308ecda25d9a700273d865cc2c8f78b0266ce7 Mon Sep 17 00:00:00 2001 From: Luke Else Date: Fri, 16 Feb 2024 14:02:07 +0000 Subject: [PATCH] #11 Created a separate runner withappropriate container for running --- .gitlab-ci.yml | 20 ++++++++++++-------- cicd/docker-compose.yml | 11 +++++++++-- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 75d2f72..77cc01a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,18 +5,22 @@ variables: DOCKER_HOST: tcp://docker:2375/ DOCKER_DRIVER: overlay2 -# pytest: -# stage: test -# script: -# - cd /builds/u5500327/wmgzon -# - pip install -r requirements.txt -# - pytest +pytest: + stage: test + tags: + - python + script: + - cd /builds/u5500327/wmgzon + - pip install -r requirements.txt + - pytest deploy: stage: deploy - image: docker:latest + tags: + - docker + image: docker:20.10.16 services: - - name: docker:dind + - name: docker:20.10.16-dind alias: docker script: - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY diff --git a/cicd/docker-compose.yml b/cicd/docker-compose.yml index 34f82de..c16f0ed 100644 --- a/cicd/docker-compose.yml +++ b/cicd/docker-compose.yml @@ -1,8 +1,15 @@ version: '3.8' services: - gitlab-runner: + gitlab-runner-python: image: gitlab/gitlab-runner:latest volumes: - - ./runner-data:/etc/gitlab-runner + - ./runner-data-python:/etc/gitlab-runner + - /var/run/docker.sock:/var/run/docker.sock + restart: unless-stopped + + gitlab-runner-docker: + image: gitlab/gitlab-runner:latest + volumes: + - ./runner-data-docker:/etc/gitlab-runner - /var/run/docker.sock:/var/run/docker.sock restart: unless-stopped \ No newline at end of file