From b42034e747a0cd48c1885da55cf63884550dda46 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E5=88=98=E6=B4=AA=E9=9D=92?= Date: Tue, 13 Oct 2020 00:25:42 +0800 Subject: [PATCH] =?utf8?q?feat:=20authx-service=20=E7=9A=84=20poa=20api-do?= =?utf8?q?cs=20=E7=9A=84=E5=88=9D=E5=A7=8B=E5=8C=96=E5=B7=A5=E5=85=B7?= =?utf8?q?=EF=BC=8C=E6=94=AF=E6=8C=81=20POA=5FSA=20=E6=9C=8D=E5=8A=A1?= =?utf8?q?=E5=9C=B0=E5=9D=80=E7=9A=84=E5=8F=AF=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../9.poa-api-docs-installer.yaml | 1 + poa-api-docs/docker-entrypoint.sh | 4 ++ poa-api-docs/exec.sh | 37 +++++++++++-------- 3 files changed, 27 insertions(+), 15 deletions(-) diff --git a/deploy-manifests/k8s-rancher/1.authx-service/0.authx-service/9.poa-api-docs-installer.yaml b/deploy-manifests/k8s-rancher/1.authx-service/0.authx-service/9.poa-api-docs-installer.yaml index 2b5d006..41fa706 100644 --- a/deploy-manifests/k8s-rancher/1.authx-service/0.authx-service/9.poa-api-docs-installer.yaml +++ b/deploy-manifests/k8s-rancher/1.authx-service/0.authx-service/9.poa-api-docs-installer.yaml @@ -11,6 +11,7 @@ data: # 平台OpenAPI的外网访问地址, # **修改** 学校的根域名 POA_SERVER_URL: http://poa.paas.xxx.edu.cn + POA_SA_SERVER_URL: http://poa-sa-svc.poa.svc.cluster.local:8443 --- diff --git a/poa-api-docs/docker-entrypoint.sh b/poa-api-docs/docker-entrypoint.sh index 31b34bc..3381313 100644 --- a/poa-api-docs/docker-entrypoint.sh +++ b/poa-api-docs/docker-entrypoint.sh @@ -16,6 +16,10 @@ if [ "$1" = 'app' ]; then replace_file "/root/poa-api-docs/communicate-center-poa.v1.yaml" "POA_SERVER_URL" "$POA_SERVER_URL" fi + # if [ -n "$POA_SA_SERVER_URL" ]; then + # replace_file "/root/poa-api-docs/exec.sh" "POA_SA_SERVER_URL" "$POA_SA_SERVER_URL" + # fi + set -ex; exec /root/poa-api-docs/exec.sh else diff --git a/poa-api-docs/exec.sh b/poa-api-docs/exec.sh index 6ea097d..bfe4bc6 100644 --- a/poa-api-docs/exec.sh +++ b/poa-api-docs/exec.sh @@ -4,52 +4,59 @@ cd /root/poa-api-docs ls -al +if [ -z "$POA_SA_SERVER_URL" ]; then + POA_SA_SERVER_URL="http://poa-sa-svc.poa.svc.cluster.local:8443" +fi + +echo "POA_SA_SERVER_URL2=${POA_SA_SERVER_URL}" + + # user-data-service-poa.v1.yaml -curl -i -s -X DELETE 'http://poa-sa-svc.poa.svc.cluster.local:8443/v1/services/user' +curl -i -s -X DELETE "${POA_SA_SERVER_URL}/v1/services/user" # 1. 创建服务 -curl -i -s -X POST 'http://poa-sa-svc.poa.svc.cluster.local:8443/v1/services' -H 'Content-Type: application/json' -d '{"id": "user", "origin": "http://user-data-service-poa-svc.user-data-service.svc.cluster.local:8080", "name": "用户服务", "description": "用户服务"}' +curl -i -s -X POST "${POA_SA_SERVER_URL}/v1/services" -H 'Content-Type: application/json' -d '{"id": "user", "origin": "http://user-data-service-poa-svc.user-data-service.svc.cluster.local:8080", "name": "用户服务", "description": "用户服务"}' # 2. 创建版本 -curl -i -s -X POST 'http://poa-sa-svc.poa.svc.cluster.local:8443/v1/services/user/apiVersions/v1' +curl -i -s -X POST "${POA_SA_SERVER_URL}/v1/services/user/apiVersions/v1" # 3. 上传OAS Yaml -curl -i -s -X POST 'http://poa-sa-svc.poa.svc.cluster.local:8443/v1/services/user/apiVersions/v1/apiSpecs' -H 'Content-Type: application/yaml' --data-binary @user-data-service-poa.v1.yaml +curl -i -s -X POST "${POA_SA_SERVER_URL}/v1/services/user/apiVersions/v1/apiSpecs" -H 'Content-Type: application/yaml' --data-binary @user-data-service-poa.v1.yaml # 4. 发布版本 -curl -i -s -X POST 'http://poa-sa-svc.poa.svc.cluster.local:8443/v1/services/user/apiVersions/v1/publish' +curl -i -s -X POST "${POA_SA_SERVER_URL}/v1/services/user/apiVersions/v1/publish" # user-authorization-service-poa.v1.yaml -curl -i -s -X DELETE 'http://poa-sa-svc.poa.svc.cluster.local:8443/v1/services/authz' +curl -i -s -X DELETE "${POA_SA_SERVER_URL}/v1/services/authz" # 1. 创建服务 -curl -i -s -X POST 'http://poa-sa-svc.poa.svc.cluster.local:8443/v1/services' -H 'Content-Type: application/json' -d '{"id": "authz", "origin": "http://user-authorization-poa-svc.user-authorization-service.svc.cluster.local:8080", "name": "授权服务", "description": "授权服务"}' +curl -i -s -X POST "${POA_SA_SERVER_URL}/v1/services' -H 'Content-Type: application/json" -d '{"id": "authz", "origin": "http://user-authorization-poa-svc.user-authorization-service.svc.cluster.local:8080", "name": "授权服务", "description": "授权服务"}' # 2. 创建版本 -curl -i -s -X POST 'http://poa-sa-svc.poa.svc.cluster.local:8443/v1/services/authz/apiVersions/v1' +curl -i -s -X POST "${POA_SA_SERVER_URL}/v1/services/authz/apiVersions/v1" # 3. 上传OAS Yaml -curl -i -s -X POST 'http://poa-sa-svc.poa.svc.cluster.local:8443/v1/services/authz/apiVersions/v1/apiSpecs' -H 'Content-Type: application/yaml' --data-binary @user-authorization-service-poa.v1.yaml +curl -i -s -X POST "${POA_SA_SERVER_URL}/v1/services/authz/apiVersions/v1/apiSpecs" -H 'Content-Type: application/yaml' --data-binary @user-authorization-service-poa.v1.yaml # 4. 发布版本 -curl -i -s -X POST 'http://poa-sa-svc.poa.svc.cluster.local:8443/v1/services/authz/apiVersions/v1/publish' +curl -i -s -X POST "${POA_SA_SERVER_URL}/v1/services/authz/apiVersions/v1/publish" # communicate-center-poa.v1.yaml -curl -i -s -X DELETE 'http://poa-sa-svc.poa.svc.cluster.local:8443/v1/services/communicate' +curl -i -s -X DELETE "${POA_SA_SERVER_URL}/v1/services/communicate" # 1. 创建服务 -curl -i -s -X POST 'http://poa-sa-svc.poa.svc.cluster.local:8443/v1/services' -H 'Content-Type: application/json' -d '{"id": "communicate", "origin": "http://communicate-center-poa-svc.communicate-center.svc.cluster.local:8080", "name": "通信服务", "description": "通信服务"}' +curl -i -s -X POST "${POA_SA_SERVER_URL}/v1/services' -H 'Content-Type: application/json" -d '{"id": "communicate", "origin": "http://communicate-center-poa-svc.communicate-center.svc.cluster.local:8080", "name": "通信服务", "description": "通信服务"}' # 2. 创建版本 -curl -i -s -X POST 'http://poa-sa-svc.poa.svc.cluster.local:8443/v1/services/communicate/apiVersions/v1' +curl -i -s -X POST "${POA_SA_SERVER_URL}/v1/services/communicate/apiVersions/v1" # 3. 上传OAS Yaml -curl -i -s -X POST 'http://poa-sa-svc.poa.svc.cluster.local:8443/v1/services/communicate/apiVersions/v1/apiSpecs' -H 'Content-Type: application/yaml' --data-binary @communicate-center-poa.v1.yaml +curl -i -s -X POST "${POA_SA_SERVER_URL}/v1/services/communicate/apiVersions/v1/apiSpecs" -H 'Content-Type: application/yaml' --data-binary @communicate-center-poa.v1.yaml # 4. 发布版本 -curl -i -s -X POST 'http://poa-sa-svc.poa.svc.cluster.local:8443/v1/services/communicate/apiVersions/v1/publish' +curl -i -s -X POST "${POA_SA_SERVER_URL}/v1/services/communicate/apiVersions/v1/publish" -- 2.17.1