Skip to content
Snippets Groups Projects
Commit 21ee2842 authored by kaiyou's avatar kaiyou
Browse files

Run e2e tests on CI and build the Docker image

parent 15c8f45e
No related branches found
No related tags found
No related merge requests found
stages:
- test
- docker
test:
stage: test
image: python:3.10
variables:
FLASK_APP: hiboo
services:
- name: redis:alpine
alias: redis
before_script:
- apt-get update
- apt-get install -y --no-install-recommends python3-dev libxmlsec1 libxmlsec1-dev libpq-dev libmariadb-dev
......@@ -14,10 +18,17 @@ test:
script:
- poetry run playwright install-deps
- poetry run playwright install
- poetry run flask db upgrade
- poetry run flask user create admin admin
- poetry run flask user create user user
- poetry run flask user promote admin
- nohup poetry run flask run &
- sleep 10
- poetry run pytest --base-url=http://localhost:5000
- poetry run pytest
docker:
stage: docker
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:${CI_COMMIT_REF_NAME%+*}
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_TAG
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment