corrected tester.sh

This commit is contained in:
Andreas Balogh
2021-02-11 18:39:11 +01:00
parent b7e0207de8
commit 7f7458f7d8
3 changed files with 10 additions and 4 deletions

View File

@@ -26,7 +26,7 @@ build_flask:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker push $IMAGE_TAG - docker push $IMAGE_TAG
build_api: build_tester:
stage: build stage: build
tags: tags:
- shell - shell
@@ -35,6 +35,7 @@ build_api:
- echo "Build api image" - echo "Build api image"
- export - export
# https://gitlab.com/gitlab-org/gitlab-runner/-/issues/26785
unit_test: unit_test:
stage: test stage: test
services: services:
@@ -42,7 +43,9 @@ unit_test:
alias: zeo alias: zeo
- name: $CI_REGISTRY_IMAGE/webui:$CI_COMMIT_REF_SLUG - name: $CI_REGISTRY_IMAGE/webui:$CI_COMMIT_REF_SLUG
alias: webui alias: webui
image: ubuntu:20.04 image:
name: $CI_REGISTRY_IMAGE/webui:$CI_COMMIT_REF_SLUG
entrypoint: ["tester.sh"]
tags: tags:
- docker - docker
- ubuntu - ubuntu
@@ -50,6 +53,5 @@ unit_test:
paths: paths:
- var/ - var/
script: script:
- apt-get install -y wget
- mkdir var - mkdir var
- wget webui:5000 -o var/index.html - wget webui:5000 -o var/index.html

View File

@@ -1,11 +1,13 @@
FROM python:3.9-slim FROM python:3.9-slim
RUN apt-get update && apt-get install -y \ RUN apt-get update && apt-get install -y \
gcc \ gcc \
wget \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
RUN pip install ZEO==5.2.1 RUN pip install ZEO==5.2.1
RUN pip install flask RUN pip install flask
WORKDIR /flaskr
COPY . . COPY . .
RUN chmod +x /tester.sh
RUN chmod +x /run.sh
ENV FLASK_APP=flaskr/zeo_db ENV FLASK_APP=flaskr/zeo_db
EXPOSE 5000 EXPOSE 5000
CMD python3 -m flask run --host=0.0.0.0 CMD python3 -m flask run --host=0.0.0.0

2
src/webui/tester.sh Normal file
View File

@@ -0,0 +1,2 @@
mkdir var
wget webui:5000 -o var/index.html