Skip to content
Snippets Groups Projects
Commit 37b7b7da authored by Francois Dall'Asta's avatar Francois Dall'Asta :speech_balloon:
Browse files

[docker-build] update .gitlab-ci.yml and Dockerfile

parent 2dfc96ad
No related branches found
No related tags found
No related merge requests found
...@@ -23,18 +23,19 @@ docker-build: ...@@ -23,18 +23,19 @@ docker-build:
- /kaniko/executor - /kaniko/executor
--context $CI_PROJECT_DIR --context $CI_PROJECT_DIR
--dockerfile Dockerfile --dockerfile Dockerfile
--destination $CI_REGISTRY_IMAGE/env-ubuntu:22.04 --destination $CI_REGISTRY_IMAGE/webgeodyn-ubuntu:22.04
rules: rules:
- if: $CI_COMMIT_MESSAGE =~ /\[docker-build]/ - if: $CI_COMMIT_MESSAGE =~ /\[docker-build]/
when: always when: always
test_with_coverage: test_with_coverage:
image: image:
name: $CI_REGISTRY_IMAGE/env-ubuntu:22.04 name: $CI_REGISTRY_IMAGE/webgeodyn-ubuntu:22.04
variables:
GIT_STRATEGY: clone
stage: run stage: run
script: script:
- pip3 install . - pip3 install .
- pip3 install coverage
- coverage run --source $(pwd) --omit="webgeodyn/tests/*" setup.py test - coverage run --source $(pwd) --omit="webgeodyn/tests/*" setup.py test
- coverage report - coverage report
- coverage html - coverage html
...@@ -45,25 +46,26 @@ test_with_coverage: ...@@ -45,25 +46,26 @@ test_with_coverage:
coverage: "/TOTAL.+ ([0-9]{1,3}%)/" coverage: "/TOTAL.+ ([0-9]{1,3}%)/"
rules: rules:
- if: $CI_COMMIT_REF_NAME == "master" - if: $CI_COMMIT_REF_NAME == "master"
when: always when: on_success
generate_rst: generate_rst:
image: image:
name: $CI_REGISTRY_IMAGE/env-ubuntu:22.04 name: $CI_REGISTRY_IMAGE/webgeodyn-ubuntu:22.04
variables:
GIT_STRATEGY: clone
stage: run stage: run
script: script:
- pip3 install sphinx
- cd doc/ && ./make_all_doc.sh && cd .. - cd doc/ && ./make_all_doc.sh && cd ..
artifacts: artifacts:
paths: paths:
- doc/html - doc/html
rules: rules:
- if: $CI_COMMIT_REF_NAME == "master" - if: $CI_COMMIT_REF_NAME == "master"
when: always when: on_success
pages: pages:
image: image:
name: $CI_REGISTRY_IMAGE/env-ubuntu:22.04 name: $CI_REGISTRY_IMAGE/webgeodyn-ubuntu:22.04
stage: deploy stage: deploy
variables: variables:
GIT_STRATEGY: none GIT_STRATEGY: none
...@@ -81,18 +83,19 @@ pages: ...@@ -81,18 +83,19 @@ pages:
- generate_rst - generate_rst
rules: rules:
- if: $CI_COMMIT_REF_NAME == "master" - if: $CI_COMMIT_REF_NAME == "master"
when: always when: on_success
pypi_upload: pypi_upload:
image: image:
name: $CI_REGISTRY_IMAGE/env-ubuntu:22.04 name: $CI_REGISTRY_IMAGE/webgeodyn-ubuntu:22.04
variables:
GIT_STRATEGY: clone
stage: release stage: release
script: script:
- pip3 install twine
- python3 setup.py sdist bdist_wheel - python3 setup.py sdist bdist_wheel
- python3 -m twine check dist/* - python3 -m twine check dist/*
- python3 -m twine upload dist/* - python3 -m twine upload dist/*
only: rules:
variables: - if: $CI_COMMIT_TAG =~ /^\d+\.\d+\.\d+$/
- $CI_COMMIT_TAG =~ /^\d+\.\d+\.\d+$/ when: on_success
...@@ -4,3 +4,6 @@ RUN apt-get update && apt-get install -y -qq \ ...@@ -4,3 +4,6 @@ RUN apt-get update && apt-get install -y -qq \
python3 \ python3 \
python3-pip python3-pip
RUN apt-get autoclean -y && apt-get autoremove -y && rm -rf /var/lib/apt/lists/* RUN apt-get autoclean -y && apt-get autoremove -y && rm -rf /var/lib/apt/lists/*
RUN pip3 install coverage
RUN pip3 install sphinx
RUN pip3 install twine
\ No newline at end of file
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