mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-11 12:39:08 +00:00
Compare commits
6
Commits
v1.55.0
...
helm-chart
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ad03d663bb | ||
|
|
c10f85950a | ||
|
|
7d69220461 | ||
|
|
e316bd1a7b | ||
|
|
fd47a746af | ||
|
|
5038c7845f |
@@ -0,0 +1,73 @@
|
|||||||
|
name: Deploy K8S Modifications
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- beta
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
extract_environment:
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
outputs:
|
||||||
|
environment: ${{ steps.extract_environment.outputs.environment }}
|
||||||
|
steps:
|
||||||
|
- name: Extract Environment
|
||||||
|
run: |
|
||||||
|
if [ ${GITHUB_REF} == "refs/heads/main" ]; then
|
||||||
|
echo "environment=prd" >> $GITHUB_OUTPUT
|
||||||
|
elif [ ${GITHUB_REF} == "refs/heads/beta" ]; then
|
||||||
|
echo "environment=stg" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
id: extract_environment
|
||||||
|
|
||||||
|
helmfile-deploy:
|
||||||
|
needs: [extract_environment]
|
||||||
|
runs-on: [self-hosted, "prd-azure"]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up Helm
|
||||||
|
uses: azure/setup-helm@v1
|
||||||
|
with:
|
||||||
|
version: 'v3.9.0'
|
||||||
|
|
||||||
|
- name: Install Azure ClI
|
||||||
|
run: |
|
||||||
|
curl -sL https://aka.ms/InstallAzureCLIDeb | bash
|
||||||
|
|
||||||
|
- uses: azure/login@v2
|
||||||
|
with:
|
||||||
|
creds: '{"clientId":"${{ secrets.ARM_CLIENT_ID }}","clientSecret":"${{ secrets.ARM_CLIENT_SECRET }}","subscriptionId":"${{ secrets.ARM_SUBSCRIPTION_ID }}","tenantId":"${{ secrets.ARM_TENANT_ID }}"}'
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: '3.8'
|
||||||
|
|
||||||
|
- name: Install Helmfile
|
||||||
|
run: |
|
||||||
|
wget https://github.com/helmfile/helmfile/releases/download/v0.148.0/helmfile_0.148.0_linux_amd64.tar.gz
|
||||||
|
tar -xzf helmfile_0.148.0_linux_amd64.tar.gz
|
||||||
|
mv helmfile /usr/local/bin/
|
||||||
|
helmfile --version
|
||||||
|
|
||||||
|
- name: Install Helm Diff Plugin
|
||||||
|
run: helm plugin install https://github.com/databus23/helm-diff || true
|
||||||
|
|
||||||
|
- name: Setup kubectl
|
||||||
|
uses: azure/setup-kubectl@v1
|
||||||
|
with:
|
||||||
|
version: 'v1.30.1'
|
||||||
|
|
||||||
|
- name: Authenticate with cluster
|
||||||
|
env:
|
||||||
|
CLUSTER_NAME: platform-${{ needs.extract_environment.outputs.environment }}
|
||||||
|
run: az aks get-credentials --resource-group dadosfera-prd --name ${CLUSTER_NAME} --overwrite-existing
|
||||||
|
|
||||||
|
- name: Run Helmfile Apply
|
||||||
|
env:
|
||||||
|
ENV: ${{ needs.extract_environment.outputs.environment }}
|
||||||
|
run: helmfile -f helmfiles/${ENV}.yaml sync
|
||||||
@@ -3,6 +3,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
- beta
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
environment:
|
environment:
|
||||||
@@ -11,7 +12,6 @@ on:
|
|||||||
type: choice
|
type: choice
|
||||||
options:
|
options:
|
||||||
- stg
|
- stg
|
||||||
- stg2
|
|
||||||
- prd
|
- prd
|
||||||
push_to_dockerhub:
|
push_to_dockerhub:
|
||||||
description: "Push image to Dockerhub?"
|
description: "Push image to Dockerhub?"
|
||||||
@@ -34,6 +34,8 @@ jobs:
|
|||||||
echo "environment=${DEPLOY_ENV}" >> $GITHUB_OUTPUT
|
echo "environment=${DEPLOY_ENV}" >> $GITHUB_OUTPUT
|
||||||
elif [ ${GITHUB_REF} == "refs/heads/main" ]; then
|
elif [ ${GITHUB_REF} == "refs/heads/main" ]; then
|
||||||
echo "environment=prd" >> $GITHUB_OUTPUT
|
echo "environment=prd" >> $GITHUB_OUTPUT
|
||||||
|
elif [ ${GITHUB_REF} == "refs/heads/beta" ]; then
|
||||||
|
echo "environment=stg" >> $GITHUB_OUTPUT
|
||||||
fi
|
fi
|
||||||
id: extract_environment
|
id: extract_environment
|
||||||
|
|
||||||
@@ -48,38 +50,40 @@ jobs:
|
|||||||
|
|
||||||
- if: github.event_name != 'workflow_dispatch'
|
- if: github.event_name != 'workflow_dispatch'
|
||||||
name: Semantic Release
|
name: Semantic Release
|
||||||
uses: cycjimmy/semantic-release-action@v4
|
uses: cycjimmy/semantic-release-action@v3
|
||||||
id: semantic
|
id: semantic
|
||||||
with:
|
with:
|
||||||
extra_plugins: |
|
extra_plugins: |
|
||||||
conventional-changelog-eslint@4
|
conventional-changelog-eslint@4.0.0
|
||||||
branches: |
|
branches: |
|
||||||
[
|
[
|
||||||
'main'
|
'main',
|
||||||
|
{
|
||||||
|
name: 'alpha',
|
||||||
|
prerelease: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'beta',
|
||||||
|
prerelease: true
|
||||||
|
}
|
||||||
]
|
]
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
deploy-info:
|
build_ecr_image:
|
||||||
if: ${{ github.event_name == 'workflow_dispatch'}}
|
if: ${{ github.event_name == 'workflow_dispatch' || needs.semantic_release.outputs.new_release_published == 'true' }}
|
||||||
needs: [extract_environment, semantic_release]
|
needs: [extract_environment, semantic_release]
|
||||||
runs-on: ubuntu-latest
|
runs-on:
|
||||||
|
[self-hosted, "prd"]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Create summary
|
- name: Printing stats
|
||||||
env:
|
env:
|
||||||
EVENT: ${{ github.event_name }}
|
EVENT: ${{ github.event_name }}
|
||||||
IMAGE_TAG: ${{ needs.semantic_release.outputs.new_release_version }}
|
IMAGE_TAG: ${{ needs.semantic_release.outputs.new_release_version }}
|
||||||
ENV: ${{ needs.extract_environment.outputs.environment }}
|
ENV: ${{ needs.extract_environment.outputs.environment }}
|
||||||
run: echo "### Deploy da branch \`$GITHUB_REF_NAME\` no ambiente **$ENV** :rocket:" >> $GITHUB_STEP_SUMMARY
|
run: echo ${GITHUB_REF#refs/heads/}
|
||||||
|
|
||||||
deploy:
|
|
||||||
if: ${{ github.event_name == 'workflow_dispatch' || needs.semantic_release.outputs.new_release_published == 'true' }}
|
|
||||||
needs: [extract_environment, semantic_release]
|
|
||||||
runs-on:
|
|
||||||
[self-hosted, "${{ needs.extract_environment.outputs.environment }}"]
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
@@ -131,94 +135,83 @@ jobs:
|
|||||||
docker compose -f build.docker-compose.dockerhub.yml build
|
docker compose -f build.docker-compose.dockerhub.yml build
|
||||||
docker compose -f build.docker-compose.dockerhub.yml push
|
docker compose -f build.docker-compose.dockerhub.yml push
|
||||||
|
|
||||||
- name: Create ZIP file to Deploy AWS Beanstalk
|
# - name: Create ZIP file to Deploy AWS Beanstalk
|
||||||
env:
|
# env:
|
||||||
ENV: ${{ needs.extract_environment.outputs.environment }}
|
# ENV: ${{ needs.extract_environment.outputs.environment }}
|
||||||
IMAGE_TAG: ${{ needs.semantic_release.outputs.new_release_version }}
|
# IMAGE_TAG: ${{ needs.semantic_release.outputs.new_release_version }}
|
||||||
ACCOUNT_ID: ${{ steps.aws.outputs.aws-account-id }}
|
# ACCOUNT_ID: ${{ steps.aws.outputs.aws-account-id }}
|
||||||
NODE_EXPORTER_URL: ${{format('{0}.dkr.ecr.us-east-1.amazonaws.com\/monitoring\/node_exporter:latest', steps.aws.outputs.aws-account-id)}} # ${{needs.extract_environment.outputs.environment == 'prd' && '611330257153.dkr.ecr.us-east-1.amazonaws.com\/monitoring\/node_exporter:latest' || '468720548566.dkr.ecr.us-east-1.amazonaws.com\/monitoring\/node_exporter:latest'}}
|
# NODE_EXPORTER_URL: ${{needs.extract_environment.outputs.environment == 'prd' && '611330257153.dkr.ecr.us-east-1.amazonaws.com\/monitoring\/node_exporter:latest' || '468720548566.dkr.ecr.us-east-1.amazonaws.com\/monitoring\/node_exporter:latest'}}
|
||||||
run: |
|
# run: |
|
||||||
sed -i -e "s/\${ENV}/$ENV/g" docker-compose.yml
|
# sed -i -e "s/\${ENV}/$ENV/g" docker-compose.yml
|
||||||
sed -i -e "s/\${IMAGE_TAG}/$IMAGE_TAG/g" docker-compose.yml
|
# sed -i -e "s/\${IMAGE_TAG}/$IMAGE_TAG/g" docker-compose.yml
|
||||||
sed -i -e "s/\${ACCOUNT_ID}/$ACCOUNT_ID/g" docker-compose.yml
|
# sed -i -e "s/\${ACCOUNT_ID}/$ACCOUNT_ID/g" docker-compose.yml
|
||||||
sed -i -e "s/\${NODE_EXPORTER_URL}/$NODE_EXPORTER_URL/g" docker-compose.yml
|
# sed -i -e "s/\${NODE_EXPORTER_URL}/$NODE_EXPORTER_URL/g" docker-compose.yml
|
||||||
zip deploy.zip docker-compose.yml -r .ebextensions
|
# zip deploy.zip docker-compose.yml -r .ebextensions
|
||||||
|
|
||||||
- name: Deploy AWS Beanstalk
|
# - name: Deploy AWS Beanstalk
|
||||||
env:
|
# env:
|
||||||
ENV: ${{ needs.extract_environment.outputs.environment }}
|
# ENV: ${{ needs.extract_environment.outputs.environment }}
|
||||||
AWS_REGION: us-east-1
|
# AWS_REGION: us-east-1
|
||||||
APP_NAME: ${{ github.event.repository.name }}
|
# APP_NAME: ${{ github.event.repository.name }}
|
||||||
run: |
|
# run: |
|
||||||
eb use $APP_NAME-$ENV
|
# eb use $APP_NAME-$ENV
|
||||||
echo -e "deploy:\n artifact: deploy.zip" >> .elasticbeanstalk/config.yml
|
# echo -e "deploy:\n artifact: deploy.zip" >> .elasticbeanstalk/config.yml
|
||||||
eb deploy
|
# eb deploy
|
||||||
|
|
||||||
- name: Remove Docker's Trash
|
- name: Remove Docker's Trash
|
||||||
if: always()
|
if: always()
|
||||||
run: |
|
run: |
|
||||||
docker system prune --volumes -a -f
|
docker system prune --volumes -a -f
|
||||||
docker system df
|
docker system df
|
||||||
api_docs:
|
|
||||||
needs: [extract_environment, semantic_release, deploy]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Extract Docs BlockId and PageId
|
helmfile-deploy:
|
||||||
|
needs: [extract_environment, semantic_release, build_ecr_image]
|
||||||
|
runs-on: [self-hosted, "prd-azure"]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up Helm
|
||||||
|
uses: azure/setup-helm@v1
|
||||||
|
with:
|
||||||
|
version: 'v3.9.0'
|
||||||
|
|
||||||
|
- name: Install Azure ClI
|
||||||
|
run: |
|
||||||
|
curl -sL https://aka.ms/InstallAzureCLIDeb | bash
|
||||||
|
|
||||||
|
- uses: azure/login@v2
|
||||||
|
with:
|
||||||
|
creds: '{"clientId":"${{ secrets.ARM_CLIENT_ID }}","clientSecret":"${{ secrets.ARM_CLIENT_SECRET }}","subscriptionId":"${{ secrets.ARM_SUBSCRIPTION_ID }}","tenantId":"${{ secrets.ARM_TENANT_ID }}"}'
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: '3.8'
|
||||||
|
|
||||||
|
- name: Install Helmfile
|
||||||
|
run: |
|
||||||
|
wget https://github.com/helmfile/helmfile/releases/download/v0.148.0/helmfile_0.148.0_linux_amd64.tar.gz
|
||||||
|
tar -xzf helmfile_0.148.0_linux_amd64.tar.gz
|
||||||
|
mv helmfile /usr/local/bin/
|
||||||
|
helmfile --version
|
||||||
|
|
||||||
|
- name: Install Helm Diff Plugin
|
||||||
|
run: helm plugin install https://github.com/databus23/helm-diff || true
|
||||||
|
|
||||||
|
- name: Setup kubectl
|
||||||
|
uses: azure/setup-kubectl@v1
|
||||||
|
with:
|
||||||
|
version: 'v1.30.1'
|
||||||
|
|
||||||
|
- name: Authenticate with cluster
|
||||||
|
env:
|
||||||
|
CLUSTER_NAME: platform-${{ needs.extract_environment.outputs.environment }}
|
||||||
|
run: az aks get-credentials --resource-group dadosfera-prd --name ${CLUSTER_NAME} --overwrite-existing
|
||||||
|
|
||||||
|
- name: Run Helmfile Apply
|
||||||
env:
|
env:
|
||||||
ENV: ${{ needs.extract_environment.outputs.environment }}
|
ENV: ${{ needs.extract_environment.outputs.environment }}
|
||||||
STG2_DOCS_BLOCK_ID: ${{ secrets.DEV_DOCS_BLOCK_ID }}
|
IMAGE_TAG: ${{ needs.semantic_release.outputs.new_release_version }}
|
||||||
STG2_DOCS_PAGE_ID: ${{ secrets.DEV_DOCS_PAGE_ID }}
|
run: helmfile -f helmfiles/${ENV}.yaml sync --set image.tag=$IMAGE_TAG
|
||||||
STG_DOCS_BLOCK_ID: ${{ secrets.STG_DOCS_BLOCK_ID }}
|
|
||||||
STG_DOCS_PAGE_ID: ${{ secrets.STG_DOCS_PAGE_ID }}
|
|
||||||
PRD_DOCS_BLOCK_ID: ${{ secrets.PRD_DOCS_BLOCK_ID }}
|
|
||||||
PRD_DOCS_PAGE_ID: ${{ secrets.PRD_DOCS_PAGE_ID }}
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
if [ $ENV == "stg2" ]; then
|
|
||||||
echo "block_id=$STG2_DOCS_BLOCK_ID" >> $GITHUB_OUTPUT
|
|
||||||
echo "page_id=$STG2_DOCS_PAGE_ID" >> $GITHUB_OUTPUT
|
|
||||||
elif [ $ENV == "stg" ]; then
|
|
||||||
echo "block_id=$STG_DOCS_BLOCK_ID" >> $GITHUB_OUTPUT
|
|
||||||
echo "page_id=$STG_DOCS_PAGE_ID" >> $GITHUB_OUTPUT
|
|
||||||
elif [ $ENV == "prd" ]; then
|
|
||||||
echo "block_id=$PRD_DOCS_BLOCK_ID" >> $GITHUB_OUTPUT
|
|
||||||
echo "page_id=$PRD_DOCS_PAGE_ID" >> $GITHUB_OUTPUT
|
|
||||||
fi
|
|
||||||
id: extract_docs_info
|
|
||||||
|
|
||||||
- name: Generate API docs
|
|
||||||
env:
|
|
||||||
DOCS_URL: ${{ secrets.DOCS_URL }}
|
|
||||||
DOCS_API_TOKEN: ${{ secrets.DOCS_API_TOKEN }}
|
|
||||||
DOCS_PAGE_ID: ${{ steps.extract_docs_info.outputs.page_id }}
|
|
||||||
DOCS_BLOCK_ID: ${{ steps.extract_docs_info.outputs.block_id }}
|
|
||||||
EVENT: ${{ github.event_name }}
|
|
||||||
RELEASE_VERSION: ${{ needs.semantic_release.outputs.new_release_version }}
|
|
||||||
run: |
|
|
||||||
if [ ${EVENT} != "workflow_dispatch" ]; then
|
|
||||||
sed -i -E "s/(\"title\": )\"Maestro.+\"/\1\"Maestro - $RELEASE_VERSION\"/g" docsfera.json
|
|
||||||
fi
|
|
||||||
sed -i -e "s/\${DOCS_API_TOKEN}/$DOCS_API_TOKEN/g" docsfera.json
|
|
||||||
sed -i -e "s/\${DOCS_PAGE_ID}/$DOCS_PAGE_ID/g" docsfera.json
|
|
||||||
sed -i -e "s/\${DOCS_BLOCK_ID}/$DOCS_BLOCK_ID/g" docsfera.json
|
|
||||||
curl -X POST -H 'Content-Type: application/json' -d @docsfera.json $DOCS_URL
|
|
||||||
|
|
||||||
- name: Generate External API docs
|
|
||||||
env:
|
|
||||||
DOCS_URL: ${{ secrets.DOCS_URL }}
|
|
||||||
DOCS_API_TOKEN: ${{ secrets.DOCS_API_TOKEN }}
|
|
||||||
DOCS_PAGE_ID: ${{secrets.EXTERNAL_DOCS_PAGE_ID}}
|
|
||||||
DOCS_BLOCK_ID: ${{secrets.EXTERNAL_DOCS_BLOCK_ID}}
|
|
||||||
EVENT: ${{ github.event_name }}
|
|
||||||
RELEASE_VERSION: ${{ needs.semantic_release.outputs.new_release_version }}
|
|
||||||
run: |
|
|
||||||
if [ ${EVENT} != "workflow_dispatch" ]; then
|
|
||||||
sed -i -E "s/(\"title\": )\"Maestro.+\"/\1\"Maestro - $RELEASE_VERSION\"/g" docsfera.external.json
|
|
||||||
fi
|
|
||||||
sed -i -e "s/\${DOCS_API_TOKEN}/$DOCS_API_TOKEN/g" docsfera.external.json
|
|
||||||
sed -i -e "s/\${DOCS_PAGE_ID}/$DOCS_PAGE_ID/g" docsfera.external.json
|
|
||||||
sed -i -e "s/\${DOCS_BLOCK_ID}/$DOCS_BLOCK_ID/g" docsfera.external.json
|
|
||||||
curl -X POST -H 'Content-Type: application/json' -d @docsfera.external.json $DOCS_URL
|
|
||||||
|
|||||||
@@ -6,29 +6,18 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
runs-on: [self-hosted, prd]
|
runs-on: [self-hosted, prd]
|
||||||
|
env:
|
||||||
|
APP_NAME: ${{ github.event.repository.name }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Configure AWS
|
|
||||||
uses: aws-actions/configure-aws-credentials@v4
|
|
||||||
id: aws
|
|
||||||
with:
|
|
||||||
aws-region: us-east-1
|
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
env:
|
run: docker build -t ${APP_NAME}_teste --target test .
|
||||||
APP_NAME: ${{ github.event.repository.name }}
|
|
||||||
run: |
|
|
||||||
docker build -t $APP_NAME --target test .
|
|
||||||
|
|
||||||
- name: Run Test
|
- name: Run Test
|
||||||
env:
|
run: docker run ${APP_NAME}_teste
|
||||||
ENV: test
|
|
||||||
APP_NAME: ${{ github.event.repository.name }}
|
|
||||||
run: |
|
|
||||||
docker run --rm --entrypoint="npm" $APP_NAME run test
|
|
||||||
|
|
||||||
- name: Remove Docker's Trash
|
- name: Remove Docker's Trash
|
||||||
if: always()
|
if: always()
|
||||||
|
|||||||
@@ -0,0 +1,79 @@
|
|||||||
|
name: Validate K8S Modifications
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- stg
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
extract_environment:
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
outputs:
|
||||||
|
environment: ${{ steps.extract_environment.outputs.environment }}
|
||||||
|
steps:
|
||||||
|
- name: Extract Environment
|
||||||
|
run: |
|
||||||
|
if [ "${{ github.event.pull_request.base.ref }}" == "main" ]; then
|
||||||
|
echo "environment=prd" >> $GITHUB_OUTPUT
|
||||||
|
elif [ "${{ github.event.pull_request.base.ref }}" == "beta" ]; then
|
||||||
|
echo "environment=stg" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
id: extract_environment
|
||||||
|
|
||||||
|
helmfile-deploy:
|
||||||
|
needs: [extract_environment]
|
||||||
|
runs-on: [self-hosted, "prd-azure"]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Summary
|
||||||
|
env:
|
||||||
|
ENV: ${{ needs.extract_environment.outputs.environment }}
|
||||||
|
run: |
|
||||||
|
echo "### :rocket: Deploy da branch \`$GITHUB_REF_NAME\` para o environment ($ENV)" >> $GITHUB_STEP_SUMMARY
|
||||||
|
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up Helm
|
||||||
|
uses: azure/setup-helm@v1
|
||||||
|
with:
|
||||||
|
version: 'v3.9.0'
|
||||||
|
|
||||||
|
- name: Install Azure ClI
|
||||||
|
run: |
|
||||||
|
curl -sL https://aka.ms/InstallAzureCLIDeb | bash
|
||||||
|
|
||||||
|
- uses: azure/login@v2
|
||||||
|
with:
|
||||||
|
creds: '{"clientId":"${{ secrets.ARM_CLIENT_ID }}","clientSecret":"${{ secrets.ARM_CLIENT_SECRET }}","subscriptionId":"${{ secrets.ARM_SUBSCRIPTION_ID }}","tenantId":"${{ secrets.ARM_TENANT_ID }}"}'
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: '3.8'
|
||||||
|
|
||||||
|
- name: Install Helmfile
|
||||||
|
run: |
|
||||||
|
wget https://github.com/helmfile/helmfile/releases/download/v0.148.0/helmfile_0.148.0_linux_amd64.tar.gz
|
||||||
|
tar -xzf helmfile_0.148.0_linux_amd64.tar.gz
|
||||||
|
mv helmfile /usr/local/bin/
|
||||||
|
helmfile --version
|
||||||
|
|
||||||
|
- name: Install Helm Diff Plugin
|
||||||
|
run: helm plugin install https://github.com/databus23/helm-diff || true
|
||||||
|
|
||||||
|
- name: Setup kubectl
|
||||||
|
uses: azure/setup-kubectl@v1
|
||||||
|
with:
|
||||||
|
version: 'v1.30.1'
|
||||||
|
|
||||||
|
- name: Authenticate with cluster
|
||||||
|
env:
|
||||||
|
CLUSTER_NAME: platform-${{ needs.extract_environment.outputs.environment }}
|
||||||
|
run: az aks get-credentials --resource-group dadosfera-prd --name ${CLUSTER_NAME} --overwrite-existing
|
||||||
|
|
||||||
|
- name: Run Helmfile Diff
|
||||||
|
env:
|
||||||
|
ENV: ${{ needs.extract_environment.outputs.environment }}
|
||||||
|
run: helmfile -f helmfiles/${ENV}.yaml diff
|
||||||
+38
-16
@@ -1,21 +1,43 @@
|
|||||||
# install all dependencies
|
FROM node:18.17-alpine AS base_image
|
||||||
FROM node:18.17-alpine as packages
|
|
||||||
|
FROM base_image AS build_base
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY package.json package-lock.json ./
|
RUN apk update
|
||||||
RUN apk add --no-cache aws-cli \
|
# needed packages to build dependencies from source
|
||||||
&& aws codeartifact login --tool npm --namespace @dadosfera --repository dadosfera-npm --domain dadosfera --domain-owner 611330257153 --region us-east-1 \
|
RUN apk add --no-cache aws-cli
|
||||||
&& npm install
|
COPY package*.json ./
|
||||||
|
|
||||||
|
|
||||||
|
# run aws cli without mounting secret, because CI already has AWS credentials
|
||||||
|
FROM build_base AS ci_image
|
||||||
|
RUN aws codeartifact login --tool npm --namespace @dadosfera --repository dadosfera-npm --domain dadosfera --domain-owner 611330257153 --region us-east-1
|
||||||
|
RUN npm ci
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
|
||||||
# unit test specific build
|
# unit test specific build
|
||||||
FROM node:18.17-alpine as test
|
FROM ci_image AS test
|
||||||
WORKDIR /app
|
ENV DUC_URL=0.0.0.0:50051
|
||||||
COPY --from=packages /app/node_modules ./node_modules
|
ENTRYPOINT ["npm", "run", "test"]
|
||||||
COPY . ./
|
|
||||||
|
|
||||||
FROM node:18.17-alpine
|
|
||||||
WORKDIR /app
|
# dev build
|
||||||
COPY . /app/
|
FROM build_base AS dev
|
||||||
COPY --from=packages /app/node_modules ./node_modules
|
RUN --mount=type=secret,id=aws,target=/root/.aws/credentials \
|
||||||
|
aws codeartifact login --tool npm --namespace @dadosfera --repository dadosfera-npm --domain dadosfera --domain-owner 611330257153 --region us-east-1
|
||||||
|
# flag --build-from-source is required to force-build sqlite3
|
||||||
|
RUN npm ci
|
||||||
|
COPY . .
|
||||||
|
ENTRYPOINT npm run start:dev
|
||||||
|
|
||||||
|
|
||||||
|
FROM ci_image AS prod_build
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
EXPOSE 3333
|
|
||||||
ENTRYPOINT npm run start
|
|
||||||
|
FROM base_image
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --from=prod_build /app/dist ./dist
|
||||||
|
COPY --from=prod_build /app/node_modules ./node_modules
|
||||||
|
COPY --from=prod_build /app/package*.json ./
|
||||||
|
ENTRYPOINT npm run start:prod
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
version: "3.8"
|
|
||||||
services:
|
services:
|
||||||
maestro:
|
maestro:
|
||||||
build: .
|
build: .
|
||||||
image: dadosfera/maestro_${ENV}:${IMAGE_TAG}
|
image: dadosfera/maestro_${ENV}:${IMAGE_TAG}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
version: "3.8"
|
|
||||||
services:
|
services:
|
||||||
maestro:
|
maestro:
|
||||||
build: .
|
build: .
|
||||||
image: ${ACCOUNT_ID}.dkr.ecr.us-east-1.amazonaws.com/microservices/maestro_${ENV}:${IMAGE_TAG}
|
image: ${ACCOUNT_ID}.dkr.ecr.us-east-1.amazonaws.com/microservices/maestro_prd:${IMAGE_TAG}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
version: "3.8"
|
|
||||||
services:
|
services:
|
||||||
maestro:
|
maestro:
|
||||||
image: dadosfera/maestro_${ENV}:${IMAGE_TAG}
|
image: dadosfera/maestro_${ENV}:${IMAGE_TAG}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
version: "3.8"
|
|
||||||
services:
|
services:
|
||||||
maestro:
|
maestro:
|
||||||
image: ${ACCOUNT_ID}.dkr.ecr.us-east-1.amazonaws.com/microservices/maestro_${ENV}:${IMAGE_TAG}
|
image: ${ACCOUNT_ID}.dkr.ecr.us-east-1.amazonaws.com/microservices/maestro_${ENV}:${IMAGE_TAG}
|
||||||
|
|||||||
+2
-2
@@ -5447,7 +5447,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"info": {
|
"info": {
|
||||||
"title": "Maestro - feat/rls",
|
"title": "Maestro",
|
||||||
"description": "This is the Maestro API",
|
"description": "This is the Maestro API",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"contact": {}
|
"contact": {}
|
||||||
@@ -8238,4 +8238,4 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
charts:
|
||||||
|
- name: maestro
|
||||||
|
chart: ../maestro
|
||||||
|
values:
|
||||||
|
- ../maestro/values.yaml
|
||||||
|
set:
|
||||||
|
- name: maestro.duc_url
|
||||||
|
value: duc.dadosfera.ai
|
||||||
|
- name: hostname
|
||||||
|
value: maestro.dadosfera.ai
|
||||||
|
- name: maestro.pi_factory_url
|
||||||
|
value: pi-factory.dadosfera.ai
|
||||||
|
- name: maestro.in_factory_url
|
||||||
|
value: in-factory.dadosfera.ai
|
||||||
|
- name: maestro.tr_factory_url
|
||||||
|
value: in-factory.dadosfera.ai
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
charts:
|
||||||
|
- name: maestro
|
||||||
|
chart: ../maestro
|
||||||
|
values:
|
||||||
|
- ../maestro/values.yaml
|
||||||
|
set:
|
||||||
|
- name: maestro.duc_url
|
||||||
|
value: duc-temp.dadosfera.ai
|
||||||
|
- name: hostname
|
||||||
|
value: maestro-temp.dadosfera.ai
|
||||||
|
- name: maestro.pi_factory_url
|
||||||
|
value: pi-factory-temp.dadosfera.ai
|
||||||
|
- name: maestro.in_factory_url
|
||||||
|
value: in-factory-temp.dadosfera.ai
|
||||||
|
- name: maestro.tr_factory_url
|
||||||
|
value: in-factory-temp.dadosfera.ai
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
# Patterns to ignore when building packages.
|
||||||
|
# This supports shell glob matching, relative path matching, and
|
||||||
|
# negation (prefixed with !). Only one pattern per line.
|
||||||
|
.DS_Store
|
||||||
|
# Common VCS dirs
|
||||||
|
.git/
|
||||||
|
.gitignore
|
||||||
|
.bzr/
|
||||||
|
.bzrignore
|
||||||
|
.hg/
|
||||||
|
.hgignore
|
||||||
|
.svn/
|
||||||
|
# Common backup files
|
||||||
|
*.swp
|
||||||
|
*.bak
|
||||||
|
*.tmp
|
||||||
|
*.orig
|
||||||
|
*~
|
||||||
|
# Various IDEs
|
||||||
|
.project
|
||||||
|
.idea/
|
||||||
|
*.tmproj
|
||||||
|
.vscode/
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
apiVersion: v2
|
||||||
|
name: maestro
|
||||||
|
description: A Helm chart for Kubernetes
|
||||||
|
|
||||||
|
# A chart can be either an 'application' or a 'library' chart.
|
||||||
|
#
|
||||||
|
# Application charts are a collection of templates that can be packaged into versioned archives
|
||||||
|
# to be deployed.
|
||||||
|
#
|
||||||
|
# Library charts provide useful utilities or functions for the chart developer. They're included as
|
||||||
|
# a dependency of application charts to inject those utilities and functions into the rendering
|
||||||
|
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
|
||||||
|
type: application
|
||||||
|
|
||||||
|
# This is the chart version. This version number should be incremented each time you make changes
|
||||||
|
# to the chart and its templates, including the app version.
|
||||||
|
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
||||||
|
version: 0.1.0
|
||||||
|
|
||||||
|
# This is the version number of the application being deployed. This version number should be
|
||||||
|
# incremented each time you make changes to the application. Versions are not expected to
|
||||||
|
# follow Semantic Versioning. They should reflect the version the application is using.
|
||||||
|
# It is recommended to use it with quotes.
|
||||||
|
appVersion: "1.16.0"
|
||||||
@@ -0,0 +1,112 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: maestro
|
||||||
|
namespace: applications
|
||||||
|
labels:
|
||||||
|
app: maestro
|
||||||
|
|
||||||
|
spec:
|
||||||
|
replicas: {{ .Values.replicaCount }}
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: maestro
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
rollingUpdate:
|
||||||
|
maxSurge: 25%
|
||||||
|
maxUnavailable: 25%
|
||||||
|
type: RollingUpdate
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: maestro
|
||||||
|
|
||||||
|
spec:
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: {{ .Values.imagePullSecrets }}
|
||||||
|
nodeSelector:
|
||||||
|
"beta.kubernetes.io/os": linux
|
||||||
|
affinity:
|
||||||
|
nodeAffinity:
|
||||||
|
requiredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
nodeSelectorTerms:
|
||||||
|
- matchExpressions:
|
||||||
|
- key: application
|
||||||
|
operator: In
|
||||||
|
values:
|
||||||
|
- backend
|
||||||
|
|
||||||
|
containers:
|
||||||
|
- name: maestro
|
||||||
|
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
|
||||||
|
ports:
|
||||||
|
- containerPort: {{ .Values.containerPort }}
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: {{ .Values.resources.requests.cpu }}
|
||||||
|
memory: {{ .Values.resources.requests.memory }}
|
||||||
|
limits:
|
||||||
|
cpu: {{ .Values.resources.limits.cpu }}
|
||||||
|
memory: {{ .Values.resources.limits.memory }}
|
||||||
|
env:
|
||||||
|
- name: AWS_IDENTITY_POOL_ID
|
||||||
|
value: {{ .Values.maestro.aws_identity_pool_id }}
|
||||||
|
- name: AWS_REGION
|
||||||
|
value: "us-east-1"
|
||||||
|
- name: BASE_HOST
|
||||||
|
value: "maestro_prd"
|
||||||
|
- name: BUCKET_CUSTOMER_CSV_ASSETS
|
||||||
|
value: {{ .Values.maestro.bucket_customer_csv_assets }}
|
||||||
|
- name: CONNECTORS_INDEX
|
||||||
|
value: "connectors"
|
||||||
|
- name: DUC_URL
|
||||||
|
value: {{ .Values.maestro.duc_url }}
|
||||||
|
- name: ELASTIC_APM_ENVIRONMENT
|
||||||
|
value: {{ .Values.maestro.env }}
|
||||||
|
- name: ELASTIC_APM_SERVER_URL
|
||||||
|
value: "https://apm-server.dadosfera.ai"
|
||||||
|
- name: ELASTIC_APM_SERVICE_NAME
|
||||||
|
value: {{ .Values.maestro.apm_service }}
|
||||||
|
- name: ENV
|
||||||
|
value: {{ .Values.maestro.env }}
|
||||||
|
- name: INFACTORY_URL
|
||||||
|
value: {{ .Values.maestro.in_factory_url }}
|
||||||
|
- name: LOGGER_GELF_HOST
|
||||||
|
value: "logstash-pipelines.dadosfera.ai"
|
||||||
|
- name: LOGGER_GELF_PORT
|
||||||
|
value: "{{ .Values.maestro.logger_gelf_port }}"
|
||||||
|
- name: NIMBUS_BASE_URL
|
||||||
|
value: "http://nimbus-api"
|
||||||
|
- name: NPM_TOKEN
|
||||||
|
value: {{ .Values.maestro.npm_token }}
|
||||||
|
- name: PB_TOKEN_PATH
|
||||||
|
value: {{ .Values.maestro.pb_token_path }}
|
||||||
|
- name: PIFACTORY_URL
|
||||||
|
value: {{ .Values.maestro.pi_factory_url }}
|
||||||
|
- name: SM_OAUTH_PATH
|
||||||
|
value: {{ .Values.maestro.sm_oauth_path }}
|
||||||
|
- name: TRFACTORY_URL
|
||||||
|
value: {{ .Values.maestro.tr_factory_url }}
|
||||||
|
- name: UPLOAD_FILE_AGENT_CONNECTION
|
||||||
|
value: {{ .Values.maestro.upload_file_agent_connection }}
|
||||||
|
- name: JWT_PRIVATE_KEY
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: prd-duc
|
||||||
|
key: jwt_token
|
||||||
|
- name: AWS_ACCESS_KEY_ID
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: prd-maestro
|
||||||
|
key: AWS_ACCESS_KEY_ID
|
||||||
|
- name: AWS_SECRET_ACCESS_KEY
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: prd-maestro
|
||||||
|
key: AWS_SECRET_ACCESS_KEY
|
||||||
|
- name: AWS_DEFAULT_REGION
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: prd-maestro
|
||||||
|
key: AWS_DEFAULT_REGION
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
nginx.ingress.kubernetes.io/proxy-body-size: "0"
|
||||||
|
nginx.ingress.kubernetes.io/server-snippet: |
|
||||||
|
underscores_in_headers on;
|
||||||
|
ignore_invalid_headers on;
|
||||||
|
|
||||||
|
generation: 1
|
||||||
|
labels:
|
||||||
|
app: maestro
|
||||||
|
name: maestro
|
||||||
|
namespace: applications
|
||||||
|
spec:
|
||||||
|
ingressClassName: nginx
|
||||||
|
rules:
|
||||||
|
- host: {{ .Values.hostname }}
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- backend:
|
||||||
|
service:
|
||||||
|
name: maestro
|
||||||
|
port:
|
||||||
|
number: {{ .Values.ingress.port }}
|
||||||
|
path: /
|
||||||
|
pathType: Prefix
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
apiVersion: external-secrets.io/v1beta1
|
||||||
|
kind: ExternalSecret
|
||||||
|
metadata:
|
||||||
|
name: prd-maestro
|
||||||
|
namespace: applications
|
||||||
|
labels:
|
||||||
|
app: maestro
|
||||||
|
spec:
|
||||||
|
refreshInterval: 1h
|
||||||
|
secretStoreRef:
|
||||||
|
name: secretsmanager-prd
|
||||||
|
kind: SecretStore
|
||||||
|
target:
|
||||||
|
name: prd-maestro
|
||||||
|
creationPolicy: Owner
|
||||||
|
data:
|
||||||
|
- secretKey: AWS_ACCESS_KEY_ID
|
||||||
|
remoteRef:
|
||||||
|
key: prd/microservices/aws_credentials/maestro
|
||||||
|
version: "AWSCURRENT"
|
||||||
|
property: AWS_ACCESS_KEY_ID
|
||||||
|
|
||||||
|
- secretKey: AWS_SECRET_ACCESS_KEY
|
||||||
|
remoteRef:
|
||||||
|
key: prd/microservices/aws_credentials/maestro
|
||||||
|
version: "AWSCURRENT"
|
||||||
|
property: AWS_SECRET_ACCESS_KEY
|
||||||
|
|
||||||
|
- secretKey: AWS_DEFAULT_REGION
|
||||||
|
remoteRef:
|
||||||
|
key: prd/microservices/aws_credentials/maestro
|
||||||
|
version: "AWSCURRENT"
|
||||||
|
property: AWS_DEFAULT_REGION
|
||||||
|
|
||||||
|
- secretKey: jwt_token
|
||||||
|
remoteRef:
|
||||||
|
key: {{ .Values.maestro.jwt_token_secret_id }}
|
||||||
|
version: "AWSCURRENT"
|
||||||
|
property: token
|
||||||
|
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: maestro
|
||||||
|
namespace: applications
|
||||||
|
labels:
|
||||||
|
app: maestro
|
||||||
|
|
||||||
|
spec:
|
||||||
|
type: ClusterIP
|
||||||
|
ports:
|
||||||
|
- name: maestro
|
||||||
|
protocol: TCP
|
||||||
|
port: {{ .Values.service.port }}
|
||||||
|
targetPort: {{ .Values.service.targetPort }}
|
||||||
|
selector:
|
||||||
|
app: maestro
|
||||||
|
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
# Default values for metabase.
|
||||||
|
# This is a YAML-formatted file.
|
||||||
|
# Declare variables to be passed into your templates.
|
||||||
|
|
||||||
|
replicaCount: 3
|
||||||
|
hostname: maestro-temp.dadosfera.ai
|
||||||
|
image:
|
||||||
|
repository: 611330257153.dkr.ecr.us-east-1.amazonaws.com/microservices/maestro_prd
|
||||||
|
pullPolicy: IfNotPresent
|
||||||
|
# Overrides the image tag whose default is the chart appVersion.
|
||||||
|
tag: 1.56.0
|
||||||
|
containerPort: 3333
|
||||||
|
imagePullSecrets: "applications-secrets-ecr-auth-token-external-secret"
|
||||||
|
service:
|
||||||
|
type: ClusterIP
|
||||||
|
port: 3333
|
||||||
|
targetPort: 3333
|
||||||
|
ingress:
|
||||||
|
enabled: false
|
||||||
|
port: 3333
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: 100m
|
||||||
|
memory: 1500Mi
|
||||||
|
limits:
|
||||||
|
cpu: 2000m
|
||||||
|
memory: 2Gi
|
||||||
|
maestro:
|
||||||
|
aws_identity_pool_id: "us-east-1_Mrezsw9Sn"
|
||||||
|
duc_url: duc.dadosfera.ai
|
||||||
|
in_factory_url: in-factory.dadosfera.ai
|
||||||
|
bucket_customer_csv_assets: "customers-csv-assets-prd-611330257153"
|
||||||
|
env: prd
|
||||||
|
apm_service: maestro
|
||||||
|
jwt_token_secret_id: prd/root/jwt_token
|
||||||
|
logger_gelf_port: "1026"
|
||||||
|
npm_token: npm_Xp17h3daMkORcZ55NY95Ez4gRfdzsQ3UvINP
|
||||||
|
pb_token_path: prd/root/productboard_token
|
||||||
|
pi_factory_url: pi-factory.dadosfera.ai
|
||||||
|
sm_oauth_path: prd/root/oauth_applications
|
||||||
|
tr_factory_url: in-factory.dadosfera.ai
|
||||||
|
upload_file_agent_connection: cbc2f881-58c4-4d60-8003-0979b0b5b911
|
||||||
|
|
||||||
|
autoscaling:
|
||||||
|
enabled: false
|
||||||
|
minReplicas: 1
|
||||||
|
maxReplicas: 100
|
||||||
|
targetCPUUtilizationPercentage: 80
|
||||||
|
targetMemoryUtilizationPercentage: 80
|
||||||
Generated
+1
-2
@@ -7,7 +7,6 @@
|
|||||||
"": {
|
"": {
|
||||||
"name": "maestro",
|
"name": "maestro",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"hasInstallScript": true,
|
|
||||||
"license": "UNLICENSED",
|
"license": "UNLICENSED",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@aws-sdk/client-secrets-manager": "^3.414.0",
|
"@aws-sdk/client-secrets-manager": "^3.414.0",
|
||||||
@@ -77,7 +76,7 @@
|
|||||||
"typescript": "^4.9.5"
|
"typescript": "^4.9.5"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.17.0"
|
"node": "18.17"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@ampproject/remapping": {
|
"node_modules/@ampproject/remapping": {
|
||||||
|
|||||||
+3
-3
@@ -6,10 +6,10 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"license": "UNLICENSED",
|
"license": "UNLICENSED",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.17.0"
|
"node": "18.17"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"preinstall": "aws codeartifact login --tool npm --namespace @dadosfera --repository dadosfera-npm --domain dadosfera --domain-owner 611330257153 --region us-east-1",
|
"co:login": "aws codeartifact login --tool npm --namespace @dadosfera --repository dadosfera-npm --domain dadosfera --domain-owner 611330257153 --region us-east-1",
|
||||||
"proto-update": "npm i @dadosfera/protospack-v2@latest --save-exact",
|
"proto-update": "npm i @dadosfera/protospack-v2@latest --save-exact",
|
||||||
"prebuild": "rimraf dist",
|
"prebuild": "rimraf dist",
|
||||||
"build": "nest build",
|
"build": "nest build",
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
"start:prod": "node dist/main",
|
"start:prod": "node dist/main",
|
||||||
"docs": "export KILL_AFTER_START=1 && nest start && export INTERNAL_SWAGGER=true && nest start",
|
"docs": "export KILL_AFTER_START=1 && nest start && export INTERNAL_SWAGGER=true && nest start",
|
||||||
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
|
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
|
||||||
"test": "jest",
|
"test": "jest --detectOpenHandles --forceExit",
|
||||||
"test:watch": "jest --watch",
|
"test:watch": "jest --watch",
|
||||||
"test:cov": "jest --coverage",
|
"test:cov": "jest --coverage",
|
||||||
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
|
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
|
||||||
|
|||||||
@@ -6,7 +6,9 @@ import {
|
|||||||
import { credentials } from '@grpc/grpc-js';
|
import { credentials } from '@grpc/grpc-js';
|
||||||
import { Catalog } from '@dadosfera/protospack-v2';
|
import { Catalog } from '@dadosfera/protospack-v2';
|
||||||
|
|
||||||
const isLocalConnection = !!process.env.PIFACTORY_URL?.includes('0.0.0.0');
|
const isLocalConnection =
|
||||||
|
process.env.PIFACTORY_URL.startsWith('pi-factory:') ||
|
||||||
|
process.env.PIFACTORY_URL.includes('0.0.0.0');
|
||||||
|
|
||||||
export class CatalogClientConfiguration {
|
export class CatalogClientConfiguration {
|
||||||
public name = 'CatalogClientConfiguration';
|
public name = 'CatalogClientConfiguration';
|
||||||
|
|||||||
@@ -6,7 +6,9 @@ import {
|
|||||||
} from '@nestjs/microservices';
|
} from '@nestjs/microservices';
|
||||||
import { ConnectionTest } from '@dadosfera/protospack-v2';
|
import { ConnectionTest } from '@dadosfera/protospack-v2';
|
||||||
|
|
||||||
const isLocalConnection = !!process.env.INFACTORY_URL?.includes('0.0.0.0');
|
const isLocalConnection =
|
||||||
|
process.env.INFACTORY_URL.startsWith('in-factory:') ||
|
||||||
|
process.env.INFACTORY_URL.includes('0.0.0.0');
|
||||||
|
|
||||||
export class ConnectionTestClientConfiguration {
|
export class ConnectionTestClientConfiguration {
|
||||||
private config: GrpcOptions = {
|
private config: GrpcOptions = {
|
||||||
|
|||||||
@@ -6,7 +6,9 @@ import {
|
|||||||
} from '@nestjs/microservices';
|
} from '@nestjs/microservices';
|
||||||
import { ConnectionManager } from '@dadosfera/protospack-v2';
|
import { ConnectionManager } from '@dadosfera/protospack-v2';
|
||||||
|
|
||||||
const isLocalConnection = !!process.env.INFACTORY_URL?.includes('0.0.0.0');
|
const isLocalConnection =
|
||||||
|
process.env.INFACTORY_URL.startsWith('in-factory:') ||
|
||||||
|
process.env.INFACTORY_URL.includes('0.0.0.0');
|
||||||
|
|
||||||
export class ConnectionClientConfiguration {
|
export class ConnectionClientConfiguration {
|
||||||
public name = 'ConnectionClientConfiguration';
|
public name = 'ConnectionClientConfiguration';
|
||||||
|
|||||||
@@ -6,7 +6,9 @@ import {
|
|||||||
} from '@nestjs/microservices';
|
} from '@nestjs/microservices';
|
||||||
import { ConnectorManager } from '@dadosfera/protospack-v2';
|
import { ConnectorManager } from '@dadosfera/protospack-v2';
|
||||||
|
|
||||||
const isLocalConnection = !!process.env.INFACTORY_URL?.includes('0.0.0.0');
|
const isLocalConnection =
|
||||||
|
process.env.INFACTORY_URL.startsWith('in-factory:') ||
|
||||||
|
process.env.INFACTORY_URL.includes('0.0.0.0');
|
||||||
|
|
||||||
export class ConnectorClientConfiguration {
|
export class ConnectorClientConfiguration {
|
||||||
public name = 'ConnectorClientConfiguration';
|
public name = 'ConnectorClientConfiguration';
|
||||||
|
|||||||
@@ -9,7 +9,9 @@ import {
|
|||||||
ProtoPaths,
|
ProtoPaths,
|
||||||
} from '@dadosfera/protospack-v2/dist/lib/Duc';
|
} from '@dadosfera/protospack-v2/dist/lib/Duc';
|
||||||
|
|
||||||
const isLocalConnection = !!process.env.DUC_URL?.includes('0.0.0.0');
|
const isLocalConnection =
|
||||||
|
process.env.DUC_URL.startsWith('duc:') ||
|
||||||
|
process.env.DUC_URL.includes('0.0.0.0');
|
||||||
|
|
||||||
export class DucClient {
|
export class DucClient {
|
||||||
public name = 'DucClient';
|
public name = 'DucClient';
|
||||||
|
|||||||
@@ -6,7 +6,9 @@ import {
|
|||||||
type GrpcOptions,
|
type GrpcOptions,
|
||||||
} from '@nestjs/microservices';
|
} from '@nestjs/microservices';
|
||||||
|
|
||||||
const isLocalConnection = !!process.env.INFACTORY_URL?.includes('0.0.0.0');
|
const isLocalConnection =
|
||||||
|
process.env.INFACTORY_URL.startsWith('in-factory:') ||
|
||||||
|
process.env.INFACTORY_URL.includes('0.0.0.0');
|
||||||
export class InputsGrpcClient {
|
export class InputsGrpcClient {
|
||||||
public readonly name = 'InputsGrpcClient';
|
public readonly name = 'InputsGrpcClient';
|
||||||
private config: GrpcOptions = {
|
private config: GrpcOptions = {
|
||||||
|
|||||||
@@ -6,7 +6,9 @@ import {
|
|||||||
} from '@nestjs/microservices';
|
} from '@nestjs/microservices';
|
||||||
import { NetworkConfig } from '@dadosfera/protospack-v2';
|
import { NetworkConfig } from '@dadosfera/protospack-v2';
|
||||||
|
|
||||||
const isLocalConnection = !!process.env.INFACTORY_URL?.includes('0.0.0.0');
|
const isLocalConnection =
|
||||||
|
process.env.INFACTORY_URL.startsWith('in-factory:') ||
|
||||||
|
process.env.INFACTORY_URL.includes('0.0.0.0');
|
||||||
|
|
||||||
export class NetworkConfigGrpcClient {
|
export class NetworkConfigGrpcClient {
|
||||||
public name = 'NetworkConfigGrpcClient';
|
public name = 'NetworkConfigGrpcClient';
|
||||||
|
|||||||
@@ -6,7 +6,9 @@ import {
|
|||||||
import { PipelinePackages, PipelineProtoFilePath } from '@dadosfera/protospack';
|
import { PipelinePackages, PipelineProtoFilePath } from '@dadosfera/protospack';
|
||||||
import { credentials } from '@grpc/grpc-js';
|
import { credentials } from '@grpc/grpc-js';
|
||||||
|
|
||||||
const isLocalConnection = !!process.env.PIFACTORY_URL?.includes('0.0.0.0');
|
const isLocalConnection =
|
||||||
|
process.env.PIFACTORY_URL.startsWith('pi-factory:') ||
|
||||||
|
process.env.PIFACTORY_URL.includes('0.0.0.0');
|
||||||
|
|
||||||
export class PipelinesClientConfiguration {
|
export class PipelinesClientConfiguration {
|
||||||
public name = 'PipelinesClientConfiguration';
|
public name = 'PipelinesClientConfiguration';
|
||||||
|
|||||||
@@ -9,7 +9,9 @@ import {
|
|||||||
} from '@dadosfera/protospack-v2/dist/lib/PipelineV2';
|
} from '@dadosfera/protospack-v2/dist/lib/PipelineV2';
|
||||||
import { credentials } from '@grpc/grpc-js';
|
import { credentials } from '@grpc/grpc-js';
|
||||||
|
|
||||||
const isLocalConnection = !!process.env.PIFACTORY_URL?.includes('0.0.0.0');
|
const isLocalConnection =
|
||||||
|
process.env.PIFACTORY_URL.startsWith('pi-factory:') ||
|
||||||
|
process.env.PIFACTORY_URL.includes('0.0.0.0');
|
||||||
|
|
||||||
export class PipelinesClientConfiguration {
|
export class PipelinesClientConfiguration {
|
||||||
public name = 'PipelinesClientConfiguration';
|
public name = 'PipelinesClientConfiguration';
|
||||||
|
|||||||
@@ -6,7 +6,9 @@ import {
|
|||||||
import { credentials } from '@grpc/grpc-js';
|
import { credentials } from '@grpc/grpc-js';
|
||||||
import { Transformation } from '@dadosfera/protospack-v2';
|
import { Transformation } from '@dadosfera/protospack-v2';
|
||||||
|
|
||||||
const isLocalConnection = !!process.env.INFACTORY_URL?.includes('0.0.0.0');
|
const isLocalConnection =
|
||||||
|
process.env.INFACTORY_URL.startsWith('in-factory:') ||
|
||||||
|
process.env.INFACTORY_URL.includes('0.0.0.0');
|
||||||
|
|
||||||
export class TransformationsClientConfiguration {
|
export class TransformationsClientConfiguration {
|
||||||
public name = 'TransformationsClientConfiguration';
|
public name = 'TransformationsClientConfiguration';
|
||||||
|
|||||||
Reference in New Issue
Block a user