diff --git a/python-packages/.gitkeep b/python-packages/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/python-packages/artifactory.yml b/python-packages/artifactory.yml new file mode 100644 index 0000000000000000000000000000000000000000..0bdbc8a90651b47a28b5b16453141677f86bb62f --- /dev/null +++ b/python-packages/artifactory.yml @@ -0,0 +1,16 @@ +artifactory: + stage: artifactory + tags: + - docker + variables: + TWINE_USERNAME: $ACR_USERNAME + TWINE_PASSWORD: $ACR_PASSWORD + script: + - source $VIRTUALENV_NAME/bin/activate + - pip install twine + - python setup.py sdist bdist_wheel + - twine upload --repository-url $ACR_PYPI_URL dist/* + only: + refs: + # run only when new tag is published or changes pushed to master + - tags diff --git a/python-packages/pages.yml b/python-packages/pages.yml new file mode 100644 index 0000000000000000000000000000000000000000..c9618d159c5d21131f92fb620baba98d6bc8000b --- /dev/null +++ b/python-packages/pages.yml @@ -0,0 +1,19 @@ +pages: + tags: + - docker + stage: pages + script: + - source $VIRTUALENV_NAME/bin/activate + - pip install -U sphinx + - pip install -U sphinx_glpi_theme + - cd docs + - sphinx-build -b html . ../public + allow_failure: true + artifacts: + paths: + - public + only: + refs: + # run only when new tag is published or changes pushed to master + - tags + - master diff --git a/python-packages/test.yml b/python-packages/test.yml new file mode 100644 index 0000000000000000000000000000000000000000..c60bbf6189429fe5462068faa7f626fe35763d85 --- /dev/null +++ b/python-packages/test.yml @@ -0,0 +1,12 @@ +test: + tags: + - docker # this is necessary to execute the Gitlab Runner in a docker container + only: + refs: + # run only when new tag is published or changes pushed to master + - tags + - master + script: + # run test files in tests folder + - source $VIRTUALENV_NAME/bin/activate + - python -m unittest discover tests diff --git a/python-packages/virtualenv.yml b/python-packages/virtualenv.yml new file mode 100644 index 0000000000000000000000000000000000000000..a766e51a0c7926119ee277507b874b63b87a5ba9 --- /dev/null +++ b/python-packages/virtualenv.yml @@ -0,0 +1,19 @@ +variables: + PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" + VIRTUALENV_NAME: "venv" + +cache: + paths: + - .cache/pip + - $VIRTUALENV_NAME/ + +virtualenv: + stage: virtualenv + tags: + - docker + script: + - pip install virtualenv # install virtualenv to create a virtual environment to install required packages + - virtualenv $VIRTUALENV_NAME # create a virtualenvironment + - source $VIRTUALENV_NAME/bin/activate # activate the virtualenvironment + - python -V # print python version for debugging + - pip install -r requirements.txt # install required packages