From cd258a40b8d2c5172d44bedd4806c06a57e948ed Mon Sep 17 00:00:00 2001 From: Dagger Date: Wed, 25 May 2022 00:20:38 +0000 Subject: [PATCH] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0c20a34..e2d23c7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,22 +1,7 @@ -docker-build: - image: docker:latest - stage: build - services: - - docker:dind - before_script: - - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY +build-test: + image: python:3.9 script: - - | - if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then - tag="" - echo "Running on default branch '$CI_DEFAULT_BRANCH': tag = 'latest'" - else - tag=":$CI_COMMIT_REF_SLUG" - echo "Running on branch '$CI_COMMIT_BRANCH': tag = $tag" - fi - - docker build --pull -t "$CI_REGISTRY_IMAGE${tag}" . - - docker push "$CI_REGISTRY_IMAGE${tag}" - rules: - - if: $CI_COMMIT_BRANCH - exists: - - Dockerfile + - python --version + - pip --version + - pip install ./requirements.txt + - uvicorn app:app --host 0.0.0.0 --port 80 \ No newline at end of file