mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-11 04:52:44 +00:00
python: Add gitlab-ci.mustache (#5342)
* python: Add gitlab-ci.mustache It does the same stuff as in the .travis.yml but just for Gitlab CI #5340 - Python .gitlab-ci.yml * python: Run all scripts in bin find bin/ -type f -name 'python*.sh' -exec {} \; Had to update all samples
This commit is contained in:
@@ -266,6 +266,7 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig
|
||||
supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
|
||||
supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore"));
|
||||
supportingFiles.add(new SupportingFile("travis.mustache", "", ".travis.yml"));
|
||||
supportingFiles.add(new SupportingFile("gitlab-ci.mustache", "", ".gitlab-ci.yml"));
|
||||
supportingFiles.add(new SupportingFile("setup.mustache", "", "setup.py"));
|
||||
}
|
||||
supportingFiles.add(new SupportingFile("configuration.mustache", packagePath(), "configuration.py"));
|
||||
|
||||
33
modules/openapi-generator/src/main/resources/python/gitlab-ci.mustache
vendored
Normal file
33
modules/openapi-generator/src/main/resources/python/gitlab-ci.mustache
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
# ref: https://docs.gitlab.com/ee/ci/README.html
|
||||
|
||||
stages:
|
||||
- test
|
||||
|
||||
.nosetest:
|
||||
stage: test
|
||||
script:
|
||||
- pip install -r requirements.txt
|
||||
- pip install nose
|
||||
- nosetests
|
||||
|
||||
nosetest-2.7:
|
||||
extends: .nosetest
|
||||
image: python:2.7-alpine
|
||||
nosetest-3.3:
|
||||
extends: .nosetest
|
||||
image: python:3.3-alpine
|
||||
nosetest-3.4:
|
||||
extends: .nosetest
|
||||
image: python:3.4-alpine
|
||||
nosetest-3.5:
|
||||
extends: .nosetest
|
||||
image: python:3.5-alpine
|
||||
nosetest-3.6:
|
||||
extends: .nosetest
|
||||
image: python:3.6-alpine
|
||||
nosetest-3.7:
|
||||
extends: .nosetest
|
||||
image: python:3.7-alpine
|
||||
nosetest-3.8:
|
||||
extends: .nosetest
|
||||
image: python:3.8-alpine
|
||||
33
samples/client/petstore/python-asyncio/.gitlab-ci.yml
Normal file
33
samples/client/petstore/python-asyncio/.gitlab-ci.yml
Normal file
@@ -0,0 +1,33 @@
|
||||
# ref: https://docs.gitlab.com/ee/ci/README.html
|
||||
|
||||
stages:
|
||||
- test
|
||||
|
||||
.nosetest:
|
||||
stage: test
|
||||
script:
|
||||
- pip install -r requirements.txt
|
||||
- pip install nose
|
||||
- nosetests
|
||||
|
||||
nosetest-2.7:
|
||||
extends: .nosetest
|
||||
image: python:2.7-alpine
|
||||
nosetest-3.3:
|
||||
extends: .nosetest
|
||||
image: python:3.3-alpine
|
||||
nosetest-3.4:
|
||||
extends: .nosetest
|
||||
image: python:3.4-alpine
|
||||
nosetest-3.5:
|
||||
extends: .nosetest
|
||||
image: python:3.5-alpine
|
||||
nosetest-3.6:
|
||||
extends: .nosetest
|
||||
image: python:3.6-alpine
|
||||
nosetest-3.7:
|
||||
extends: .nosetest
|
||||
image: python:3.7-alpine
|
||||
nosetest-3.8:
|
||||
extends: .nosetest
|
||||
image: python:3.8-alpine
|
||||
33
samples/client/petstore/python-experimental/.gitlab-ci.yml
Normal file
33
samples/client/petstore/python-experimental/.gitlab-ci.yml
Normal file
@@ -0,0 +1,33 @@
|
||||
# ref: https://docs.gitlab.com/ee/ci/README.html
|
||||
|
||||
stages:
|
||||
- test
|
||||
|
||||
.nosetest:
|
||||
stage: test
|
||||
script:
|
||||
- pip install -r requirements.txt
|
||||
- pip install nose
|
||||
- nosetests
|
||||
|
||||
nosetest-2.7:
|
||||
extends: .nosetest
|
||||
image: python:2.7-alpine
|
||||
nosetest-3.3:
|
||||
extends: .nosetest
|
||||
image: python:3.3-alpine
|
||||
nosetest-3.4:
|
||||
extends: .nosetest
|
||||
image: python:3.4-alpine
|
||||
nosetest-3.5:
|
||||
extends: .nosetest
|
||||
image: python:3.5-alpine
|
||||
nosetest-3.6:
|
||||
extends: .nosetest
|
||||
image: python:3.6-alpine
|
||||
nosetest-3.7:
|
||||
extends: .nosetest
|
||||
image: python:3.7-alpine
|
||||
nosetest-3.8:
|
||||
extends: .nosetest
|
||||
image: python:3.8-alpine
|
||||
33
samples/client/petstore/python-tornado/.gitlab-ci.yml
Normal file
33
samples/client/petstore/python-tornado/.gitlab-ci.yml
Normal file
@@ -0,0 +1,33 @@
|
||||
# ref: https://docs.gitlab.com/ee/ci/README.html
|
||||
|
||||
stages:
|
||||
- test
|
||||
|
||||
.nosetest:
|
||||
stage: test
|
||||
script:
|
||||
- pip install -r requirements.txt
|
||||
- pip install nose
|
||||
- nosetests
|
||||
|
||||
nosetest-2.7:
|
||||
extends: .nosetest
|
||||
image: python:2.7-alpine
|
||||
nosetest-3.3:
|
||||
extends: .nosetest
|
||||
image: python:3.3-alpine
|
||||
nosetest-3.4:
|
||||
extends: .nosetest
|
||||
image: python:3.4-alpine
|
||||
nosetest-3.5:
|
||||
extends: .nosetest
|
||||
image: python:3.5-alpine
|
||||
nosetest-3.6:
|
||||
extends: .nosetest
|
||||
image: python:3.6-alpine
|
||||
nosetest-3.7:
|
||||
extends: .nosetest
|
||||
image: python:3.7-alpine
|
||||
nosetest-3.8:
|
||||
extends: .nosetest
|
||||
image: python:3.8-alpine
|
||||
33
samples/client/petstore/python/.gitlab-ci.yml
Normal file
33
samples/client/petstore/python/.gitlab-ci.yml
Normal file
@@ -0,0 +1,33 @@
|
||||
# ref: https://docs.gitlab.com/ee/ci/README.html
|
||||
|
||||
stages:
|
||||
- test
|
||||
|
||||
.nosetest:
|
||||
stage: test
|
||||
script:
|
||||
- pip install -r requirements.txt
|
||||
- pip install nose
|
||||
- nosetests
|
||||
|
||||
nosetest-2.7:
|
||||
extends: .nosetest
|
||||
image: python:2.7-alpine
|
||||
nosetest-3.3:
|
||||
extends: .nosetest
|
||||
image: python:3.3-alpine
|
||||
nosetest-3.4:
|
||||
extends: .nosetest
|
||||
image: python:3.4-alpine
|
||||
nosetest-3.5:
|
||||
extends: .nosetest
|
||||
image: python:3.5-alpine
|
||||
nosetest-3.6:
|
||||
extends: .nosetest
|
||||
image: python:3.6-alpine
|
||||
nosetest-3.7:
|
||||
extends: .nosetest
|
||||
image: python:3.7-alpine
|
||||
nosetest-3.8:
|
||||
extends: .nosetest
|
||||
image: python:3.8-alpine
|
||||
@@ -0,0 +1,33 @@
|
||||
# ref: https://docs.gitlab.com/ee/ci/README.html
|
||||
|
||||
stages:
|
||||
- test
|
||||
|
||||
.nosetest:
|
||||
stage: test
|
||||
script:
|
||||
- pip install -r requirements.txt
|
||||
- pip install nose
|
||||
- nosetests
|
||||
|
||||
nosetest-2.7:
|
||||
extends: .nosetest
|
||||
image: python:2.7-alpine
|
||||
nosetest-3.3:
|
||||
extends: .nosetest
|
||||
image: python:3.3-alpine
|
||||
nosetest-3.4:
|
||||
extends: .nosetest
|
||||
image: python:3.4-alpine
|
||||
nosetest-3.5:
|
||||
extends: .nosetest
|
||||
image: python:3.5-alpine
|
||||
nosetest-3.6:
|
||||
extends: .nosetest
|
||||
image: python:3.6-alpine
|
||||
nosetest-3.7:
|
||||
extends: .nosetest
|
||||
image: python:3.7-alpine
|
||||
nosetest-3.8:
|
||||
extends: .nosetest
|
||||
image: python:3.8-alpine
|
||||
33
samples/openapi3/client/petstore/python/.gitlab-ci.yml
Normal file
33
samples/openapi3/client/petstore/python/.gitlab-ci.yml
Normal file
@@ -0,0 +1,33 @@
|
||||
# ref: https://docs.gitlab.com/ee/ci/README.html
|
||||
|
||||
stages:
|
||||
- test
|
||||
|
||||
.nosetest:
|
||||
stage: test
|
||||
script:
|
||||
- pip install -r requirements.txt
|
||||
- pip install nose
|
||||
- nosetests
|
||||
|
||||
nosetest-2.7:
|
||||
extends: .nosetest
|
||||
image: python:2.7-alpine
|
||||
nosetest-3.3:
|
||||
extends: .nosetest
|
||||
image: python:3.3-alpine
|
||||
nosetest-3.4:
|
||||
extends: .nosetest
|
||||
image: python:3.4-alpine
|
||||
nosetest-3.5:
|
||||
extends: .nosetest
|
||||
image: python:3.5-alpine
|
||||
nosetest-3.6:
|
||||
extends: .nosetest
|
||||
image: python:3.6-alpine
|
||||
nosetest-3.7:
|
||||
extends: .nosetest
|
||||
image: python:3.7-alpine
|
||||
nosetest-3.8:
|
||||
extends: .nosetest
|
||||
image: python:3.8-alpine
|
||||
@@ -1 +1 @@
|
||||
4.2.3-SNAPSHOT
|
||||
4.3.0-SNAPSHOT
|
||||
@@ -14,7 +14,7 @@ def add_pet(pet): # noqa: E501
|
||||
:param pet: Pet object that needs to be added to the store
|
||||
:type pet: dict | bytes
|
||||
|
||||
:rtype: None
|
||||
:rtype: Pet
|
||||
"""
|
||||
if connexion.request.is_json:
|
||||
pet = Pet.from_dict(connexion.request.get_json()) # noqa: E501
|
||||
@@ -83,7 +83,7 @@ def update_pet(pet): # noqa: E501
|
||||
:param pet: Pet object that needs to be added to the store
|
||||
:type pet: dict | bytes
|
||||
|
||||
:rtype: None
|
||||
:rtype: Pet
|
||||
"""
|
||||
if connexion.request.is_json:
|
||||
pet = Pet.from_dict(connexion.request.get_json()) # noqa: E501
|
||||
|
||||
@@ -26,6 +26,15 @@ paths:
|
||||
requestBody:
|
||||
$ref: '#/components/requestBodies/Pet'
|
||||
responses:
|
||||
"200":
|
||||
content:
|
||||
application/xml:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
description: successful operation
|
||||
"405":
|
||||
description: Invalid input
|
||||
security:
|
||||
@@ -41,6 +50,15 @@ paths:
|
||||
requestBody:
|
||||
$ref: '#/components/requestBodies/Pet'
|
||||
responses:
|
||||
"200":
|
||||
content:
|
||||
application/xml:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
description: successful operation
|
||||
"400":
|
||||
description: Invalid ID supplied
|
||||
"404":
|
||||
|
||||
@@ -38,6 +38,7 @@ class TestPetController(BaseTestCase):
|
||||
"status" : "available"
|
||||
}
|
||||
headers = {
|
||||
'Accept': 'application/json',
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': 'Bearer special-key',
|
||||
}
|
||||
@@ -142,6 +143,7 @@ class TestPetController(BaseTestCase):
|
||||
"status" : "available"
|
||||
}
|
||||
headers = {
|
||||
'Accept': 'application/json',
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': 'Bearer special-key',
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
4.2.3-SNAPSHOT
|
||||
4.3.0-SNAPSHOT
|
||||
@@ -14,7 +14,7 @@ def add_pet(pet): # noqa: E501
|
||||
:param pet: Pet object that needs to be added to the store
|
||||
:type pet: dict | bytes
|
||||
|
||||
:rtype: None
|
||||
:rtype: Pet
|
||||
"""
|
||||
if connexion.request.is_json:
|
||||
pet = Pet.from_dict(connexion.request.get_json()) # noqa: E501
|
||||
@@ -83,7 +83,7 @@ def update_pet(pet): # noqa: E501
|
||||
:param pet: Pet object that needs to be added to the store
|
||||
:type pet: dict | bytes
|
||||
|
||||
:rtype: None
|
||||
:rtype: Pet
|
||||
"""
|
||||
if connexion.request.is_json:
|
||||
pet = Pet.from_dict(connexion.request.get_json()) # noqa: E501
|
||||
|
||||
@@ -26,6 +26,15 @@ paths:
|
||||
requestBody:
|
||||
$ref: '#/components/requestBodies/Pet'
|
||||
responses:
|
||||
"200":
|
||||
content:
|
||||
application/xml:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
description: successful operation
|
||||
"405":
|
||||
description: Invalid input
|
||||
security:
|
||||
@@ -41,6 +50,15 @@ paths:
|
||||
requestBody:
|
||||
$ref: '#/components/requestBodies/Pet'
|
||||
responses:
|
||||
"200":
|
||||
content:
|
||||
application/xml:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
description: successful operation
|
||||
"400":
|
||||
description: Invalid ID supplied
|
||||
"404":
|
||||
|
||||
@@ -38,6 +38,7 @@ class TestPetController(BaseTestCase):
|
||||
"status" : "available"
|
||||
}
|
||||
headers = {
|
||||
'Accept': 'application/json',
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': 'Bearer special-key',
|
||||
}
|
||||
@@ -142,6 +143,7 @@ class TestPetController(BaseTestCase):
|
||||
"status" : "available"
|
||||
}
|
||||
headers = {
|
||||
'Accept': 'application/json',
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': 'Bearer special-key',
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user