Browse Source

Merge pull request #34 from nmasse-itix/issue-33

Python 3.x compatibility
pull/38/head 1.0.0
Nicolas Massé 7 years ago
committed by GitHub
parent
commit
c4e40513b1
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      .gitignore
  2. 17
      .travis.yml
  3. 6
      tests/3scale-inventory.yaml.enc
  4. 1
      tests/3scale-saas-with-hosted-apicast-apikey.yml
  5. 2
      tests/3scale-saas-with-hosted-apicast-multi-environment.yml
  6. 1
      tests/3scale-saas-with-hosted-apicast-oidc.yml
  7. 1
      tests/3scale-saas-with-hosted-apicast-with-basePath.yml
  8. 3
      tests/3scale-saas-with-hosted-apicast-with-cors-policy.yml
  9. 3
      tests/3scale-saas-with-hosted-apicast-with-smoketest-in-extra-vars.yml
  10. 1
      tests/3scale-saas-with-hosted-apicast-without-smoketest.yml
  11. 6
      tests/write-inventory-files.yml
  12. 2
      vars/main.yml

2
.gitignore

@ -1,4 +1,4 @@
*.retry
inventory
3scale-inventory.*
3scale-inventory.yaml
bin

17
.travis.yml

@ -1,8 +1,12 @@
language: python
python:
- '2.7'
matrix:
include:
- python: '2.7'
env: ANSIBLE_VERSION=2.4.6 THREESCALE_POOL=0
- python: '3.6'
env: ANSIBLE_VERSION=2.7.5 THREESCALE_POOL=1
install:
- pip install ansible==2.4.0
- pip install ansible==$ANSIBLE_VERSION
- pip install jmespath
# Pre-install go-swagger locally since it cannot be fetched from the Travis-CI
# infrastructures because of rate limits imposed by GitHub on its API.
@ -15,12 +19,11 @@ script:
- ansible-playbook -v -i tests/inventory tests/3scale-saas-with-hosted-apicast-multi-environment.yml
- ansible-playbook -v -i tests/inventory tests/3scale-saas-with-hosted-apicast-with-smoketest-in-extra-vars.yml
- ansible-playbook -v -i tests/inventory tests/3scale-saas-with-hosted-apicast-without-smoketest.yml
env:
global:
# travis encrypt "THREESCALE_INVENTORY=$(yaml2json tests/3scale-inventory.yaml|base64)"
secure: "SKrCC5Nd1lXFU9mCrmGUSbqmEFGzT6/3KTXGQ/bASgSx4r0AuDHt48cI/XPQ6XGCIGaxAt2oRWzJZJ00+Y+5A1TCYAXI4X75mTVl+mgZ3ul5hSK1/KfPPoLciZIcv678FLmmpryNRapK+zxG+OKR1puNFQm9himhF9x0JICigFZSVLMLGnpvHDo2GguFv+4aO1tkdZMT5IzBlPD11Kn98QVCruF/dHiBXtSxuo5ja0/uDsGotMcUQRNa637WIQ5D7YgDREpeLrHzmbpW2zr7HI30oA68k+BxZFqlQ/cyI7f5ogNE73ID+FBSSxVXqcn7TD2nmYL3NQpMztTCzM6YlODIuAvdWUxggeBJflpIVoza0HLP7CB76GAmRSkvwGbnGAHWvCOtvczmJ/hXGgAEdRL5q3eJiGebRvhb6SAVMZ3LOH9LlLU9fKDVGqzolFi4+Jaxami600zgBB/yGkFckpapUZLEK2O0QdHBu3bjd7+9C0EgYONrbyMMkMoWr8TiX/y0qTHg3SclOEacDqLw3kb0MAe9V9WtE+MKOAM38lkXN1v1J9x2izeEqKBDDuzxMOsRxQwfSlA5MVW1kOiKaQgKl37F5t+msfIsPDlr2DRM4JTsIBaQKMY9E50tQ0cMW+vU7P+kn8UlNdTh53TLwKMjPcU99XG1f95fGAMocAA="
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/
branches:
except:
- /^dev.*/
before_install:
- openssl aes-256-cbc -K $encrypted_7bf6043000c3_key -iv $encrypted_7bf6043000c3_iv
-in tests/3scale-inventory.yaml.enc -out tests/3scale-inventory.yaml -d

6
tests/3scale-inventory.yaml.enc

@ -0,0 +1,6 @@
¥² ‡�fDÌö–u>†ç�õ'G×r¡äØÇÑjq˜+CPé)®[ãûöJzDZœ¯a¡)vŒþדÍñ~Rä(E½¨G'…%Éfü÷‘e¼{<’‹°!�,z§·Ñà ”¤¥lÊî�cšx£Ÿõ£DçAÀzÏyë
t�^�žÿ‹7É�ÚópG}p™Ú¤§~‘¢µ–…·†Em×ÔQ’#]jy]¹¢ùYÃvÑ" Öo·;KIbÑg.‚ús#¯vXÞš9ì{)b0h{Ñc©ÿ6ÅzˆV¯»ˆc5…¯ÎLÈ
×mÀ4Z¨�ÏbRlÏ ÿÐQ
0–Ù%þç2D»ƒŒ¦eä ÙSÎW˜åõÓ¢·ˆc »Áy¨%û²˜ ¾[}5ZJ‡eÔ5¢ë£¢NNȤ\Ï£àØÌ›/©«Ì˜Î+ëÞ%Õêgʾ�{ö¥;—²#¨à®E1>væÚMô›÷𢎽†)Á]‹…=×ê?™ñ$ ðŸ‡faÓW“Œø¹ã/¯fœ
dÙ<’LÔàÜ�õÀ�ýdÙSMô…äÅ FÁ!Ás~óZæ<©&ëÖhàÆD'ä Ó»Yù_-O]œ†}{ãÞÀÊ� �#­A(µ¿S™™†ÂdŠÍ41¿¾A^Íý`�½–¢,•Èz§ÄDþðÃbpÀÄd7vô¾ñRmÓ}AŠævÍÃRþO‡þ¯Ë@ŸÌP�š¾’·é±â‰‡JD�Š{"C_Ž‚<¿‰
Æïƒ®b>;Ñ:7;Í|ò‚pQ¸8*´À ‹­¹ÅÇI�æY‘ÕIΛ)È�fÀã

1
tests/3scale-saas-with-hosted-apicast-apikey.yml

@ -8,6 +8,7 @@
threescale_cicd_openapi_file_format: 'JSON'
threescale_cicd_api_backend_hostname: echo-api.3scale.net
threescale_cicd_openapi_smoketest_operation: GET_beer
threescale_cicd_api_base_system_name: beer_catalog_apikey
tasks:
# Test a first deployment
- import_role:

2
tests/3scale-saas-with-hosted-apicast-multi-environment.yml

@ -8,7 +8,7 @@
threescale_cicd_openapi_file_format: 'JSON'
threescale_cicd_api_backend_hostname: echo-api.3scale.net
threescale_cicd_openapi_smoketest_operation: GET_beer
threescale_cicd_api_base_system_name: beer_catalog
threescale_cicd_api_base_system_name: beer_catalog_envs
tasks:
# Deploy in DEV
- import_role:

1
tests/3scale-saas-with-hosted-apicast-oidc.yml

@ -5,6 +5,7 @@
gather_facts: no
vars:
threescale_cicd_openapi_file: '{{ playbook_dir }}/api/echo-api-oidc.yaml'
threescale_cicd_api_base_system_name: echo_api_oidc
tasks:
# Test a first deployment
- import_role:

1
tests/3scale-saas-with-hosted-apicast-with-basePath.yml

@ -5,6 +5,7 @@
gather_facts: no
vars:
threescale_cicd_openapi_file: '{{ playbook_dir }}/api/echo-api-with-basePath.yaml'
threescale_cicd_api_base_system_name: echo_api_with_basepath
tasks:
# Test a first deployment
- import_role:

3
tests/3scale-saas-with-hosted-apicast-with-cors-policy.yml

@ -1,12 +1,13 @@
---
- name: Deploy the Echo API to a 3scale SaaS instance, with hosted APIcasts and no smoketests
- name: Deploy the Echo API to a 3scale SaaS instance, with hosted APIcasts and CORS
hosts: threescale
gather_facts: no
vars:
threescale_cicd_openapi_smoketest_operation: Echo
threescale_cicd_apicast_policies_cors: yes
threescale_cicd_openapi_file: '{{ playbook_dir }}/api/echo-api-bare.yaml'
threescale_cicd_api_base_system_name: echo_api_cors
tasks:
# Deploy the service
- import_role:

3
tests/3scale-saas-with-hosted-apicast-with-smoketest-in-extra-vars.yml

@ -1,11 +1,12 @@
---
- name: Deploy the Echo API to a 3scale SaaS instance, with hosted APIcasts and no smoketests
- name: Deploy the Echo API to a 3scale SaaS instance, with hosted APIcasts and smoketests in extra vars
hosts: threescale
gather_facts: no
vars:
threescale_cicd_openapi_smoketest_operation: Echo
threescale_cicd_openapi_file: '{{ playbook_dir }}/api/echo-api-bare.yaml'
threescale_cicd_api_base_system_name: echo_api_bare_extra
tasks:
# Deploy the service
- import_role:

1
tests/3scale-saas-with-hosted-apicast-without-smoketest.yml

@ -6,6 +6,7 @@
vars:
# There is no "threescale_cicd_openapi_smoketest_operation" variable
threescale_cicd_openapi_file: '{{ playbook_dir }}/api/echo-api-bare.yaml'
threescale_cicd_api_base_system_name: echo_api_no_smoketests
tasks:
# Deploy the service
- import_role:

6
tests/write-inventory-files.yml

@ -21,6 +21,12 @@
recurse: no
register: templates
- name: Select the target CI platform using the THREESCALE_POOL environment variable
set_fact:
threescale_inventory: '{{ threescale_inventory[env|int] }}'
vars:
env: '{{ lookup(''env'', ''THREESCALE_POOL'') }}'
- name: Process the Jinja2 templates
template:
src: '{{ item }}'

2
vars/main.yml

@ -29,7 +29,7 @@ threescale_cicd_api_version_components: '{{ threescale_cicd_api_version.split(".
threescale_cicd_api_version_major: '{{ threescale_cicd_api_version_components|first }}'
threescale_cicd_api_security_requirements: '{{ threescale_cicd_openapi_file_content.security|default([]) }}'
threescale_cicd_api_security_definitions: '{{ threescale_cicd_openapi_file_content.securityDefinitions|default({}) }}'
threescale_cicd_api_security_scheme_name: '{{ threescale_cicd_api_security_requirements[0].keys()[0]|default(''none'') }}'
threescale_cicd_api_security_scheme_name: '{{ (threescale_cicd_api_security_requirements|first|default(''{ "none": {} }'')).keys()|list|first }}'
threescale_cicd_api_security_scheme: '{{ threescale_cicd_api_security_definitions[threescale_cicd_api_security_scheme_name] if threescale_cicd_api_security_scheme_name in threescale_cicd_api_security_definitions else {} }}'
threescale_cicd_api_backend_version: '{{ threescale_cicd_backend_version_mapping[threescale_cicd_api_security_scheme.type] }}'
threescale_cicd_backend_version_mapping:

Loading…
Cancel
Save