1
0
mirror of https://github.com/gsi-upm/senpy synced 2024-11-14 12:42:27 +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
# When using dind, it's wise to use the overlayfs driver for
# improved performance.
stages:
- test
- push
- deploy
- clean
- publish
- check_published
before_script:
- make -e login
.test: &test_definition
stage: test
script:
- make -e test-$PYTHON_VERSION
except:
- tags # Avoid unnecessary double testing
test-3.6:
<<: *test_definition
docker:
stage: publish
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
variables:
PYTHON_VERSION: "3.6"
test-3.7:
<<: *test_definition
allow_failure: true
variables:
PYTHON_VERSION: "3.7"
push:
stage: push
PYTHON_VERSION: "3.10"
tags:
- docker
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:
- tags
- triggers
- fix-makefiles
push-latest:
stage: push
testpy37:
tags:
- docker
image: python:3.7
stage: test
script:
- make -e push-latest
only:
- master
- triggers
- fix-makefiles
- pip install -r requirements.txt -r test-requirements.txt
- python setup.py test
push-github:
stage: deploy
testpy310:
tags:
- docker
image: python:3.10
stage: test
script:
- make -e push-github
only:
- master
- triggers
- fix-makefiles
- pip install -r requirements.txt -r test-requirements.txt
- python setup.py test
deploy_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.
push_pypi:
only:
- /^v?\d+\.\d+\.\d+([abc]\d*)?$/ # PEP-440 compliant version (tags)
except:
- branches
deploy:
stage: deploy
environment: test
- tags
tags:
- docker
image: python:3.7
stage: publish
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:
- master
- fix-makefiles
push-github:
stage: deploy
- tags
tags:
- docker
image: python:3.7
stage: check_published
script:
- make -e push-github
only:
- master
- triggers
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.
- pip install senpy==$CI_COMMIT_TAG
# Allow PYPI to update its index before we try to install
when: delayed
start_in: 10 minutes

View File

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