1
0
mirror of https://github.com/gsi-upm/senpy synced 2024-11-15 04:42:30 +00:00

Version 1.0.5

This commit is contained in:
J. Fernando Sánchez 2022-05-23 09:52:22 +02:00
parent 4b1eecd1c2
commit adbcd7d196
2 changed files with 51 additions and 83 deletions

View File

@ -4,100 +4,68 @@
# - docker:dind # - docker:dind
# When using dind, it's wise to use the overlayfs driver for # When using dind, it's wise to use the overlayfs driver for
# improved performance. # improved performance.
stages: stages:
- test - test
- push - publish
- deploy - check_published
- clean
before_script: docker:
- make -e login stage: publish
image:
.test: &test_definition name: gcr.io/kaniko-project/executor:debug
stage: test entrypoint: [""]
script:
- make -e test-$PYTHON_VERSION
except:
- tags # Avoid unnecessary double testing
test-3.6:
<<: *test_definition
variables: variables:
PYTHON_VERSION: "3.6" PYTHON_VERSION: "3.10"
tags:
test-3.7: - docker
<<: *test_definition
allow_failure: true
variables:
PYTHON_VERSION: "3.7"
push:
stage: push
script: script:
- make -e push - sed "s/{{PYVERSION}}/$PYTHON_VERSION/" Dockerfile.template > Dockerfile
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"},\"https://index.docker.io/v1\":{\"auth\":\"$HUB_AUTH\"}}" > /kaniko/.docker/config.json
# The skip-tls-verify flag is there because our registry certificate is self signed
- /kaniko/executor --context $CI_PROJECT_DIR --skip-tls-verify --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG --destination $HUB_REPO:$CI_COMMIT_TAG
only: only:
- tags - tags
- triggers
- fix-makefiles
push-latest: testpy37:
stage: push tags:
- docker
image: python:3.7
stage: test
script: script:
- make -e push-latest - pip install -r requirements.txt -r test-requirements.txt
only: - python setup.py test
- master
- triggers
- fix-makefiles
push-github: testpy310:
stage: deploy tags:
- docker
image: python:3.10
stage: test
script: script:
- make -e push-github - pip install -r requirements.txt -r test-requirements.txt
only: - python setup.py test
- master
- triggers
- fix-makefiles
deploy_pypi: push_pypi:
stage: deploy
script: # Configure the PyPI credentials, then push the package, and cleanup the creds.
- echo "[server-login]" >> ~/.pypirc
- echo "repository=https://upload.pypi.org/legacy/" >> ~/.pypirc
- echo "username=" ${PYPI_USER} >> ~/.pypirc
- echo "password=" ${PYPI_PASSWORD} >> ~/.pypirc
- make pip_upload
- echo "" > ~/.pypirc && rm ~/.pypirc # If the above fails, this won't run.
only: only:
- /^v?\d+\.\d+\.\d+([abc]\d*)?$/ # PEP-440 compliant version (tags) - tags
except: tags:
- branches - docker
image: python:3.7
deploy: stage: publish
stage: deploy
environment: test
script: script:
- make -e deploy - echo $CI_COMMIT_TAG > senpy/VERSION
- pip install twine
- python setup.py sdist bdist_wheel
- TWINE_PASSWORD=$PYPI_PASSWORD TWINE_USERNAME=$PYPI_USERNAME python -m twine upload dist/*
check_pypi:
only: only:
- master - tags
- fix-makefiles tags:
- docker
push-github: image: python:3.7
stage: deploy stage: check_published
script: script:
- make -e push-github - pip install senpy==$CI_COMMIT_TAG
only: # Allow PYPI to update its index before we try to install
- master when: delayed
- triggers start_in: 10 minutes
clean :
stage: clean
script:
- make -e clean
when: manual
cleanup_py:
stage: clean
when: always # this is important; run even if preceding stages failed.
script:
- rm -vf ~/.pypirc # we don't want to leave these around, but GitLab may clean up anyway.

View File

@ -204,8 +204,8 @@ def basic_api(f):
return decorated_function return decorated_function
@api_blueprint.route('/', defaults={'plugins': None}, methods=['POST', 'GET']) @api_blueprint.route('/', defaults={'plugins': None}, methods=['POST', 'GET'], strict_slashes=False)
@api_blueprint.route('/<path:plugins>', methods=['POST', 'GET']) @api_blueprint.route('/<path:plugins>', methods=['POST', 'GET'], strict_slashes=False)
@basic_api @basic_api
def api_root(plugins): def api_root(plugins):
if plugins: if plugins: