-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (65 loc) · 4.28 KB
/
swagger-convert.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Download and commit updated OPENAPI spec files
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
schedule:
- cron: '0 22 * * *' # Everyday at 6PM (before CI/CD)
jobs:
get_and_commit_swagger_export_files:
runs-on: ubuntu-latest
env:
TARGET_FOLDER: "docs/.vuepress/public/specs"
SERVER_URL: "https://repository.exoplatform.org"
M2_REPO_PREFIX: "service/local/artifact/maven/redirect?"
url:
r=exo-snapshots&g=org.exoplatform.commons&a=commons-component-common&v=7.0.x-exo-SNAPSHOT&c=swagger&e=yaml
r=exo-snapshots&g=org.exoplatform.social&a=social-component-service&v=7.0.x-exo-SNAPSHOT&c=swagger&e=yaml
r=exo-snapshots&g=org.exoplatform.gatein.portal&a=exo.portal.component.portal&v=7.0.x-exo-SNAPSHOT&c=swagger&e=yaml
r=exo-snapshots&g=org.exoplatform.ecms&a=ecms-core-services&v=7.0.x-SNAPSHOT&c=swagger&e=yaml
r=exo-addons-snapshots&g=org.exoplatform.addons.dlp&a=dlp-services&v=7.0.x-SNAPSHOT&c=swagger&e=yaml
r=exo-addons-snapshots&g=org.exoplatform.anti-malware&a=anti-malware-services&v=7.0.x-SNAPSHOT&c=swagger&e=yaml
r=exo-addons-snapshots&g=org.exoplatform.addons.app-center&a=app-center-services&v=7.0.x-exo-SNAPSHOT&c=swagger&e=yaml
r=exo-addons-snapshots&g=org.exoplatform.addons.kudos&a=kudos-services&v=7.0.x-exo-SNAPSHOT&c=swagger&e=yaml
r=exo-addons-snapshots&g=org.exoplatform.addons.multifactor-authentication&a=multifactor-authentication-services&v=7.0.x-SNAPSHOT&c=swagger&e=yaml
r=exo-addons-snapshots&g=org.exoplatform.addons.web-conferencing&a=web-conferencing-services&v=7.0.x-SNAPSHOT&c=swagger&e=yaml
r=exo-addons-snapshots&g=org.exoplatform.addons.onlyoffice&a=exo-onlyoffice-editor-services&v=7.0.x-SNAPSHOT&c=swagger&e=yaml
r=exo-addons-snapshots&g=org.exoplatform.addons.chat&a=chat-services&v=7.0.x-SNAPSHOT&c=swagger&e=yaml
r=exo-addons-snapshots&g=org.exoplatform.addons.poll&a=poll-services&v=7.0.x-exo-SNAPSHOT&c=swagger&e=yaml
r=exo-addons-snapshots&g=org.exoplatform.addons.perk-store&a=perk-store-services&v=7.0.x-exo-SNAPSHOT&c=swagger&e=yaml
r=exo-addons-snapshots&g=org.exoplatform.addons.notes&a=notes-service&v=7.0.x-exo-SNAPSHOT&c=swagger&e=yaml
r=exo-addons-snapshots&g=org.exoplatform.addons.task&a=task-management-services&v=7.0.x-exo-SNAPSHOT&c=swagger&e=yaml
r=exo-addons-snapshots&g=org.exoplatform.addons.wallet&a=wallet-api&v=7.0.x-exo-SNAPSHOT&c=swagger&e=yaml
r=exo-addons-snapshots&g=org.exoplatform.addons.gamification&a=gamification-services&v=7.0.x-exo-SNAPSHOT&c=swagger&e=yaml
r=exo-addons-snapshots&g=org.exoplatform.processes&a=processes-services&v=7.0.x-SNAPSHOT&c=swagger&e=yaml
r=exo-snapshots&g=org.exoplatform.documents&a=documents-services&v=7.0.x-SNAPSHOT&c=swagger&e=yaml
r=exo-snapshots&g=org.exoplatform.agenda&a=agenda-services&v=7.0.x-SNAPSHOT&c=swagger&e=yaml
r=exo-addons-snapshots&g=org.exoplatform.addons.news&a=news-services&v=7.0.x-SNAPSHOT&c=swagger&e=yaml
steps:
# Check-out the repository under $GITHUB_WORKSPACE
- uses: actions/checkout@v3
with:
token: ${{ secrets.SWF_TOKEN }}
- name: Download nexus metadata
run: |
cd $TARGET_FOLDER
for item in ${url}
do
file_name=$(echo ${item} | grep -o -P '(?<=m.).*(?=&a)')
final_name=${file_name//./_}
STATUSCODE=$(curl -s -L ${SERVER_URL}/${M2_REPO_PREFIX}${item} --write-out '%{http_code}' --output ${final_name}_swagger.yaml)
if test $STATUSCODE -ne 200; then
echo "ERROR: ${final_name}_swagger.yaml : download Error. Status code : ${STATUSCODE}"
echo ${SERVER_URL}/${M2_REPO_PREFIX}${item}
echo "No files downloaded : nothing to commit"
exit 1
else
echo "${final_name}_swagger.yaml download OK"
fi
done
cd $GITHUB_WORKSPACE
git status
git config --global user.email "exo-swf@exoplatform.com"
git config --global user.name "eXo Software Factory"
git add -A
git diff-index --quiet HEAD || git commit -m "Automated integration of OPENAPI spec files"
git push