mirror of
https://github.com/dadosfera/maestro.git
synced 2026-08-31 19:58:21 +00:00
DOCS: Add Docs to Docsfera
This commit is contained in:
@@ -134,3 +134,74 @@ jobs:
|
||||
run: |
|
||||
docker system prune --volumes -a -f
|
||||
docker system df
|
||||
api_docs:
|
||||
needs: [extract_environment, semantic_release, deploy]
|
||||
runs-on:
|
||||
[self-hosted, '${{ needs.extract_environment.outputs.environment }}']
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Extract Docs PageId
|
||||
if: needs.semantic_release.outputs.new_release_published == 'true'
|
||||
env:
|
||||
ENV: ${{ needs.extract_environment.outputs.environment }}
|
||||
DEV_DOCS_PAGE_ID: ${{ secrets.DEV_DOCS_PAGE_ID }}
|
||||
STG_DOCS_PAGE_ID: ${{ secrets.STG_DOCS_PAGE_ID }}
|
||||
PRD_DOCS_PAGE_ID: ${{ secrets.PRD_DOCS_PAGE_ID }}
|
||||
shell: bash
|
||||
run: |
|
||||
if [ $ENV == "dev" ]; then
|
||||
echo "##[set-output name=result;]$(echo $DEV_DOCS_PAGE_ID)"
|
||||
elif [ $ENV == "stg" ]; then
|
||||
echo "##[set-output name=result;]$(echo $STG_DOCS_PAGE_ID)"
|
||||
elif [ $ENV == "prd" ]; then
|
||||
echo "##[set-output name=result;]$(echo $PRD_DOCS_PAGE_ID)"
|
||||
fi
|
||||
id: extract_docs_page_id
|
||||
|
||||
- name: Extract Docs BlockId
|
||||
if: needs.semantic_release.outputs.new_release_published == 'true'
|
||||
env:
|
||||
ENV: ${{ needs.extract_environment.outputs.environment }}
|
||||
DEV_DOCS_BLOCK_ID: ${{ secrets.DEV_DOCS_BLOCK_ID }}
|
||||
STG_DOCS_BLOCK_ID: ${{ secrets.STG_DOCS_BLOCK_ID }}
|
||||
PRD_DOCS_BLOCK_ID: ${{ secrets.PRD_DOCS_BLOCK_ID }}
|
||||
shell: bash
|
||||
run: |
|
||||
if [ $ENV == "dev" ]; then
|
||||
echo "##[set-output name=result;]$(echo $DEV_DOCS_BLOCK_ID)"
|
||||
elif [ $ENV == "stg" ]; then
|
||||
echo "##[set-output name=result;]$(echo $STG_DOCS_BLOCK_ID)"
|
||||
elif [ $ENV == "prd" ]; then
|
||||
echo "##[set-output name=result;]$(echo $PRD_DOCS_BLOCK_ID)"
|
||||
fi
|
||||
id: extract_docs_block_id
|
||||
|
||||
- name: Generate API docs
|
||||
if: needs.semantic_release.outputs.new_release_published == 'true'
|
||||
env:
|
||||
ENV: ${{ needs.extract_environment.outputs.environment }}
|
||||
DOCS_URL: ${{ secrets.DOCS_URL }}
|
||||
DOCS_API_TOKEN: ${{ secrets.DOCS_API_TOKEN }}
|
||||
DOCS_PAGE_ID: ${{ steps.extract_docs_page_id.outputs.result }}
|
||||
DOCS_BLOCK_ID: ${{ steps.extract_docs_block_id.outputs.result }}
|
||||
continue-on-error: true
|
||||
run: |
|
||||
curl -XPOST \
|
||||
--url $DOCS_URL \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data '{
|
||||
"service": "$DOCS_API_TOKEN",
|
||||
"pageId": "$DOCS_PAGE_ID",
|
||||
"blockId": "$DOCS_BLOCK_ID",
|
||||
"schema": "../swagger.json"
|
||||
}'
|
||||
|
||||
|
||||
- name: Cleanup Docker's Leftovers
|
||||
if: always()
|
||||
continue-on-error: true
|
||||
run: |
|
||||
docker system prune
|
||||
docker rmi -f $(docker images -aq)
|
||||
|
||||
@@ -38,5 +38,3 @@ lerna-debug.log*
|
||||
*.env
|
||||
|
||||
.env
|
||||
|
||||
swagger.json
|
||||
+4
-4
@@ -43,11 +43,11 @@ async function bootstrap() {
|
||||
|
||||
await writeFileSync('swagger.json', JSON.stringify(document));
|
||||
|
||||
if (process.env.ENV != 'stg' && process.env.ENV != 'prd')
|
||||
SwaggerModule.setup('api', app, document);
|
||||
// if (process.env.ENV != 'stg' && process.env.ENV != 'prd')
|
||||
// SwaggerModule.setup('api', app, document);
|
||||
|
||||
const swaggerDoc = process.env.ENV === 'dev' ? document : documentEmpty;
|
||||
SwaggerModule.setup('api', app, swaggerDoc);
|
||||
// const swaggerDoc = process.env.ENV === 'dev' ? document : documentEmpty;
|
||||
// SwaggerModule.setup('api', app, swaggerDoc);
|
||||
|
||||
await app.listen(3333);
|
||||
}
|
||||
|
||||
@@ -17,8 +17,9 @@ export class NetworkConfigGrpcClient {
|
||||
NetworkConfig.ProtoPackages.ReadPackage,
|
||||
NetworkConfig.ProtoPackages.WritePackage,
|
||||
],
|
||||
credentials:
|
||||
process.env.ENV === 'local' ? undefined : credentials.createSsl(),
|
||||
credentials: undefined,
|
||||
// credentials:
|
||||
// process.env.ENV === 'local' ? undefined : credentials.createSsl(),
|
||||
protoPath: [
|
||||
NetworkConfig.ProtoPaths.ReadFilePath,
|
||||
NetworkConfig.ProtoPaths.WriteFilePath,
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user