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:
LoveIsGrief
2020-02-17 15:36:21 +01:00
committed by GitHub
parent acf85921e4
commit 910ce9fa89
16 changed files with 278 additions and 6 deletions

View File

@@ -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"));

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View File

@@ -1 +1 @@
4.2.3-SNAPSHOT
4.3.0-SNAPSHOT

View File

@@ -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

View File

@@ -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":

View File

@@ -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',
}

View File

@@ -1 +1 @@
4.2.3-SNAPSHOT
4.3.0-SNAPSHOT

View File

@@ -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

View File

@@ -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":

View File

@@ -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',
}