Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
GitHubHistory
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Anastasios Lisgaras
GitHubHistory
Commits
84e86e54
Commit
84e86e54
authored
Mar 23, 2016
by
Paschalis Korosoglou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ARGO-393 Changes in swagger role
parent
0737f6f5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
44 deletions
+38
-44
roles/swagger/defaults/main.yml
roles/swagger/defaults/main.yml
+2
-4
roles/swagger/handlers/main.yml
roles/swagger/handlers/main.yml
+4
-0
roles/swagger/tasks/main.yml
roles/swagger/tasks/main.yml
+32
-40
No files found.
roles/swagger/defaults/main.yml
View file @
84e86e54
---
---
swagger_ui_host
:
example.com
swagger_docs
:
swagger_ui_port
:
8080
-
{
github_org
:
swagger-api
,
name
:
swagger-spec
,
branch
:
master
,
path_to_yaml
:
"
examples/v2.0/yaml/petstore.yaml"
,
api_host
:
"
petstore.swagger.io"
}
swagger_web_api_branch
:
devel
swagger_messaging_branch
:
devel
roles/swagger/handlers/main.yml
0 → 100644
View file @
84e86e54
---
-
name
:
restart apache
service
:
name=httpd state=restarted
roles/swagger/tasks/main.yml
View file @
84e86e54
...
@@ -10,13 +10,10 @@
...
@@ -10,13 +10,10 @@
-
name
:
Install Apache
-
name
:
Install Apache
tags
:
swagger
tags
:
swagger
yum
:
name=httpd state=present
yum
:
name={{ item }} state=present
with_items
:
-
name
:
Config Apache to run on specified port
-
httpd
tags
:
swagger
-
mod_ssl
lineinfile
:
dest=/etc/httpd/conf/httpd.conf regexp="^Listen "
insertafter="^#Listen " line="Listen {{ swagger_ui_port }}"
notify
:
restart apache
-
name
:
Config Apache Up and Running
-
name
:
Config Apache Up and Running
tags
:
swagger
tags
:
swagger
...
@@ -32,53 +29,48 @@
...
@@ -32,53 +29,48 @@
curl -L https://api.github.com/repos/swagger-api/swagger-ui/tarball
curl -L https://api.github.com/repos/swagger-api/swagger-ui/tarball
| tar xz -C /tmp/swagger --strip-components 1
| tar xz -C /tmp/swagger --strip-components 1
-
name
:
Create
argo-web-api swagger dir
-
name
:
Create
swagger directories
tags
:
swagger
tags
:
swagger
file
:
path={{item}} state=directory
file
:
path=/var/www/html/{{ item.name }} state=directory owner=root group=root mode=0755
with_items
:
with_items
:
swagger_docs
-
/var/www/html/argo-web-api
-
/var/www/html/argo-messaging
-
name
:
Transfer dist files to each dedicated dir at /var/www/html/
-
name
:
Transfer dist files to each dedicated dir at /var/www/html/
tags
:
swagger
tags
:
swagger
shell
:
cp -R /tmp/swagger/dist/* {item}
shell
:
cp -R /tmp/swagger/dist/* /var/www/html/{{ item.name }}
with_items
:
with_items
:
swagger_docs
-
/var/www/html/argo-web-api
-
/var/www/html/argo-messaging
-
name
:
Get latest
argo-web-api swagger.yaml from our devel repo
-
name
:
Get latest
swagger.yaml definition files
tags
:
swagger
tags
:
swagger
command
:
>
get_url
:
url=https://raw.githubusercontent.com/{{ item.github_org }}/{{ item.name }}/{{ item.branch }}/{{ item.path_to_yaml }}
curl -L -H "Accept: application/vnd.github.raw"
dest=/tmp/swagger/{{ item.name }}_swagger.yaml force=yes
https://api.github.com/repositories/17568185/contents/doc/swagger/swagger.yaml?ref={{swagger_web_api_branch}}
owner=root group=root mode=0644
-o /tmp/swagger/argo-web-api_swagger.yaml
with_items
:
swagger_docs
notify
:
restart apache
-
name
:
Convert
argo-web-api
swagger.yaml to swagger.json
-
name
:
Convert swagger.yaml to swagger.json
tags
:
swagger
tags
:
swagger
shell
:
>
shell
:
>
python -c 'import sys, yaml, json;
python -c 'import sys, yaml, json;
json.dump(yaml.load(sys.stdin), sys.stdout, indent=4)'
json.dump(yaml.load(sys.stdin), sys.stdout, indent=4)'
< /tmp/swagger/argo-web-api_swagger.yaml > /var/www/html/argo-web-api/swagger.json
< /tmp/swagger/{{ item.name }}_swagger.yaml > /var/www/html/{{ item.name }}/swagger.json
with_items
:
swagger_docs
-
name
:
Point argo-web-api swagger-ui to our own swagger.yaml definition
-
name
:
Make swagger.json point to corresponding api endpoint
tags
:
swagger
tags
:
swagger
replace
:
dest=/var/www/html/argo-web-api/index.html regexp='url = "http:\/\/petstore\.swagger\.io\/v2\/swagger\.json";' replace='url = "http://{{ swagger_ui_host }}:{{ swagger_ui_port }}/argo-web-api/swagger.json";' backup=yes
lineinfile
:
>
dest=/var/www/html/{{ item.name }}/swagger.json
regexp='( +)\"host\":\ \"(.+)\"\,'
line=' \"host\": \"{{ item.api_host }}\",'
state=present backup=yes
with_items
:
swagger_docs
notify
:
restart apache
-
name
:
Get latest argo-messaging swagger.yaml from our devel repo
-
name
:
Point swagger-ui to corresponding swagger definitions on host
tags
:
swagger
tags
:
swagger
command
:
>
replace
:
dest=/var/www/html/{{ item.name }}/index.html
curl -L -H "Accept: application/vnd.github.raw"
regexp='url = "http:\/\/petstore\.swagger\.io\/v2\/swagger\.json";'
https://api.github.com/repositories/17568185/contents/doc/swagger/swagger.yaml?ref={{swagger_messaging_branch}}
replace='url = "https://{{ inventory_hostname }}/{{ item.name }}/swagger.json";'
-o /tmp/swagger/argo-messaging_swagger.yaml
backup=yes
with_items
:
swagger_docs
-
name
:
Convert argo-messaging swagger.yaml to swagger.json
tags
:
swagger
shell
:
>
python -c 'import sys, yaml, json;
json.dump(yaml.load(sys.stdin), sys.stdout, indent=4)'
< /tmp/swagger/argo-messaging_swagger.yaml > /var/www/html/argo-web-api/swagger.json
-
name
:
Point argo-messaging swagger-ui to our own swagger.yaml definition
tags
:
swagger
replace
:
dest=/var/www/html/argo-messaging/index.html regexp='url = "http:\/\/petstore\.swagger\.io\/v2\/swagger\.json";' replace='url = "http://{{ swagger_ui_host }}:{{ swagger_ui_port }}/argo-messaging/swagger.json";' backup=yes
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment