Compare commits
32 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ad2ee20cb4 | |||
| bff2c0abff | |||
| 2012ff2d81 | |||
| f9fca8c0a0 | |||
| 782ad9aadc | |||
| bb116a2780 | |||
| 086d68bfaf | |||
| dbe89a5cc4 | |||
| 80c1a5a9b7 | |||
| 0ec68b07bc | |||
| 2237d84ad2 | |||
| 8208b46622 | |||
| b22e210578 | |||
| 70d8fe4906 | |||
| b0d9105ceb | |||
| 771281d8af | |||
| c6dbbd3fd4 | |||
| c1c1232c87 | |||
| 3a4c96f0dc | |||
| 13b7ccb1bf | |||
| 82af370358 | |||
| 84a35b08a1 | |||
| 95795a0079 | |||
| 6f88c7a2b8 | |||
| 175b94b680 | |||
| 6363e7a9d5 | |||
| 043ab1fdfc | |||
| 15bb0872f8 | |||
| 1b2aaff753 | |||
| 772a1ac9e9 | |||
| 2340355e6c | |||
| 43acc8f809 |
@ -4,8 +4,7 @@ name: CI & CD
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
#- dev
|
||||
- dev
|
||||
|
||||
jobs:
|
||||
lint_commits:
|
||||
@ -24,12 +23,11 @@ jobs:
|
||||
run: npm ci --no-audit
|
||||
|
||||
- name: Lint Commit Messages
|
||||
# Se qualquer mensagem não corresponder ao Conventional Commits, este step falha
|
||||
run: npx commitlint --from=origin/master --to=HEAD
|
||||
run: npx commitlint --from=origin/dev --to=HEAD
|
||||
|
||||
release:
|
||||
name: Release
|
||||
needs: lint_commits # só roda se lint_commits passar
|
||||
needs: lint_commits
|
||||
runs-on: [self-hosted]
|
||||
outputs:
|
||||
sha_short: ${{ steps.commit_short.outputs.sha_short }}
|
||||
@ -71,12 +69,12 @@ jobs:
|
||||
build_and_push:
|
||||
name: Docker | Build and Push
|
||||
needs: release
|
||||
if: ${{ needs.release.outputs.is_tagged == 'true' }} # só roda se semantic-release criou tag
|
||||
if: ${{ needs.release.outputs.is_tagged == 'true' }}
|
||||
runs-on: [self-hosted]
|
||||
env:
|
||||
DEJO_NODE_AWS_REGION: us-east-1
|
||||
AWS_ECR_REPOSITORY: dev-dejo/dejo-node
|
||||
DISABLE_DISCORD_NOTIFY: true
|
||||
DISABLE_DISCORD_NOTIFY: false
|
||||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
||||
sha_short: ${{ needs.release.outputs.sha_short }}
|
||||
steps:
|
||||
@ -114,10 +112,12 @@ jobs:
|
||||
password: ${{ secrets.DEJO_NODE_AWS_SECRET_KEY }}
|
||||
|
||||
- name: Build and Push Backend
|
||||
id: build_push
|
||||
continue-on-error: true
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: infrastructure
|
||||
file: infrastructure/Dockerfile
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
push: true
|
||||
tags: |
|
||||
${{ secrets.DEV_DEJO_AWS_ECR_REGISTRY }}/${{ env.AWS_ECR_REPOSITORY }}:latest
|
||||
@ -125,11 +125,29 @@ jobs:
|
||||
cache-from: type=local,src=/tmp/.buildx-cache
|
||||
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new
|
||||
|
||||
- name: Discord | Notify Error (Build)
|
||||
if: steps.build_push.outcome == 'failure' && env.DISABLE_DISCORD_NOTIFY != 'true'
|
||||
run: |
|
||||
curl -X POST -H "Content-Type: application/json" \
|
||||
-d '{"content":":x: Falha no build/push do Docker. Veja logs."}' \
|
||||
"${DISCORD_WEBHOOK}"
|
||||
|
||||
- name: Fail job if build_push failed
|
||||
if: steps.build_push.outcome == 'failure'
|
||||
run: exit 1
|
||||
|
||||
- name: Moving Cache
|
||||
run: |
|
||||
rm -rf /tmp/.buildx-cache
|
||||
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
|
||||
|
||||
- name: Discord | Notify Success (Build)
|
||||
if: steps.build_push.outcome == 'success' && env.DISABLE_DISCORD_NOTIFY != 'true'
|
||||
run: |
|
||||
curl -X POST -H "Content-Type: application/json" \
|
||||
-d '{"content":":white_check_mark: Build e push do Docker concluídos com sucesso."}' \
|
||||
"${DISCORD_WEBHOOK}"
|
||||
|
||||
kustomize_apply:
|
||||
name: Kubernetes | Kustomize Apply
|
||||
needs: build_and_push
|
||||
@ -137,6 +155,8 @@ jobs:
|
||||
env:
|
||||
DEJO_NODE_AWS_REGION: us-east-1
|
||||
KUBE_NAMESPACE: dejo-node
|
||||
DISABLE_DISCORD_NOTIFY: false
|
||||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v3
|
||||
@ -151,11 +171,31 @@ jobs:
|
||||
aws-region: ${{ env.DEJO_NODE_AWS_REGION }}
|
||||
|
||||
- name: Apply Kustomize
|
||||
id: kustomize
|
||||
continue-on-error: true
|
||||
run: |
|
||||
echo "${{ secrets.DEJO_NODE_KUBE_CONFIG_DATA_DEV }}" | base64 -d > kubeconfig
|
||||
export KUBECONFIG=$PWD/kubeconfig
|
||||
kubectl apply -k infrastructure/kubernetes/dev -n "${KUBE_NAMESPACE}"
|
||||
|
||||
- name: Discord | Notify Error (Kustomize)
|
||||
if: steps.kustomize.outcome == 'failure' && env.DISABLE_DISCORD_NOTIFY != 'true'
|
||||
run: |
|
||||
curl -X POST -H "Content-Type: application/json" \
|
||||
-d '{"content":":x: Falha ao aplicar Kustomize. Veja logs."}' \
|
||||
"${DISCORD_WEBHOOK}"
|
||||
|
||||
- name: Fail job if kustomize failed
|
||||
if: steps.kustomize.outcome == 'failure'
|
||||
run: exit 1
|
||||
|
||||
- name: Discord | Notify Success (Kustomize)
|
||||
if: steps.kustomize.outcome == 'success' && env.DISABLE_DISCORD_NOTIFY != 'true'
|
||||
run: |
|
||||
curl -X POST -H "Content-Type: application/json" \
|
||||
-d '{"content":":white_check_mark: Kustomize aplicado com sucesso."}' \
|
||||
"${DISCORD_WEBHOOK}"
|
||||
|
||||
deploy_backend:
|
||||
name: Kubernetes | Deploy App
|
||||
needs: kustomize_apply
|
||||
@ -165,7 +205,7 @@ jobs:
|
||||
AWS_ECR_REPOSITORY: dev-dejo/dejo-node
|
||||
KUBE_NAMESPACE: dejo-node
|
||||
KUBE_DEPLOY_NAME: api-app
|
||||
DISABLE_DISCORD_NOTIFY: true
|
||||
DISABLE_DISCORD_NOTIFY: false
|
||||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
||||
sha_short: ${{ needs.release.outputs.sha_short }}
|
||||
steps:
|
||||
@ -182,6 +222,8 @@ jobs:
|
||||
aws-region: ${{ env.DEJO_NODE_AWS_REGION }}
|
||||
|
||||
- name: Deploy API
|
||||
id: deploy_api
|
||||
continue-on-error: true
|
||||
run: |
|
||||
echo "${{ secrets.DEJO_NODE_KUBE_CONFIG_DATA_DEV }}" | base64 -d > kubeconfig
|
||||
export KUBECONFIG=$PWD/kubeconfig
|
||||
@ -189,24 +231,21 @@ jobs:
|
||||
${{ env.KUBE_DEPLOY_NAME }}="${{ secrets.DEV_DEJO_AWS_ECR_REGISTRY }}/${{ env.AWS_ECR_REPOSITORY }}:${{ env.sha_short }}" \
|
||||
--record -n "${KUBE_NAMESPACE}"
|
||||
|
||||
- name: Verify Rollout
|
||||
run: |
|
||||
echo "${{ secrets.DEJO_NODE_KUBE_CONFIG_DATA_DEV }}" | base64 -d > kubeconfig
|
||||
export KUBECONFIG=$PWD/kubeconfig
|
||||
kubectl rollout status deployment/${{ env.KUBE_DEPLOY_NAME }} -n "${KUBE_NAMESPACE}"
|
||||
|
||||
- name: Discord | Notify Error
|
||||
if: ${{ failure() && env.DISABLE_DISCORD_NOTIFY != 'true' }}
|
||||
- name: Discord | Notify Error (Deploy)
|
||||
if: steps.deploy_api.outcome == 'failure' && env.DISABLE_DISCORD_NOTIFY != 'true'
|
||||
run: |
|
||||
curl -X POST -H "Content-Type: application/json" \
|
||||
-d '{"content":":x: Erro durante o deploy! Veja logs."}' \
|
||||
"${{ env.DISCORD_WEBHOOK }}"
|
||||
exit 1
|
||||
"${DISCORD_WEBHOOK}"
|
||||
|
||||
- name: Discord | Notify Success
|
||||
if: ${{ success() && env.DISABLE_DISCORD_NOTIFY != 'true' }}
|
||||
- name: Fail job if deploy_api failed
|
||||
if: steps.deploy_api.outcome == 'failure'
|
||||
run: exit 1
|
||||
|
||||
- name: Discord | Notify Success (Deploy)
|
||||
if: steps.deploy_api.outcome == 'success' && env.DISABLE_DISCORD_NOTIFY != 'true'
|
||||
run: |
|
||||
curl -X POST -H "Content-Type: application/json" \
|
||||
-d '{"content":":white_check_mark: Deploy concluído com sucesso! :rocket:"}' \
|
||||
"${{ env.DISCORD_WEBHOOK }}"
|
||||
"${DISCORD_WEBHOOK}"
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"branches": ["master"],
|
||||
"branches": ["dev"],
|
||||
"plugins": [
|
||||
[
|
||||
"@semantic-release/commit-analyzer",
|
||||
|
||||
53
CHANGELOG.md
53
CHANGELOG.md
@ -1,8 +1,61 @@
|
||||
# [1.6.0](https://git.dejodigital.com.br/dejo-core/dejo-node/compare/v1.5.0...v1.6.0) (2025-06-13)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* teste deploy Upgrade karpenter k8s v.027 para 1.20 ([bff2c0a](https://git.dejodigital.com.br/dejo-core/dejo-node/commit/bff2c0abff5908cd03240c33ef0a6eb4b64b79ff))
|
||||
|
||||
# [1.5.0](https://git.dejodigital.com.br/dejo-core/dejo-node/compare/v1.4.0...v1.5.0) (2025-06-12)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Alteração trigger deploy branch master para dev ([dbe89a5](https://git.dejodigital.com.br/dejo-core/dejo-node/commit/dbe89a5cc4132c867a09827a005436bc538933fd))
|
||||
* Alteração trigger deploy branch master para dev ([0ec68b0](https://git.dejodigital.com.br/dejo-core/dejo-node/commit/0ec68b07bc208c59ad5d431cfc89b561cc82991e))
|
||||
* Alteração trigger deploy branch master para dev ([8208b46](https://git.dejodigital.com.br/dejo-core/dejo-node/commit/8208b46622afda1aa2c052547cb5273b6c0c0639))
|
||||
* Alteração trigger deploy branch master para dev ([70d8fe4](https://git.dejodigital.com.br/dejo-core/dejo-node/commit/70d8fe490602a3a1bc9f0fd9f6011678f9b7f875))
|
||||
* Alteração trigger deploy branch master para dev ([6363e7a](https://git.dejodigital.com.br/dejo-core/dejo-node/commit/6363e7a9d59f01c0b6b5bd2f024a63aedfd954bb))
|
||||
* Alteração trigger deploy branch master para dev ([15bb087](https://git.dejodigital.com.br/dejo-core/dejo-node/commit/15bb0872f818e2a7868b87ee53ed8fbbeafa1322))
|
||||
* Alteração trigger deploy branch master para dev ([1b2aaff](https://git.dejodigital.com.br/dejo-core/dejo-node/commit/1b2aaff753dfd3da0ceb616446607ad4823676fe))
|
||||
* Alteração trigger deploy branch master para dev ([772a1ac](https://git.dejodigital.com.br/dejo-core/dejo-node/commit/772a1ac9e91200666e41211e2c264eb70e214b39))
|
||||
* resolve conflitos em CHANGELOG.md após merge de master ([f9fca8c](https://git.dejodigital.com.br/dejo-core/dejo-node/commit/f9fca8c0a00af28c7905ad3a3ca03d55bb5ce714))
|
||||
|
||||
# [1.3.0](https://git.dejodigital.com.br/dejo-core/dejo-node/compare/v1.2.0...v1.3.0) (2025-06-11)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Alteração trigger deploy branch master para dev ([13b7ccb](https://git.dejodigital.com.br/dejo-core/dejo-node/commit/13b7ccb1bf718b16dcad3dd81fe4e8cb9dd2a31c))
|
||||
|
||||
# [1.2.0](https://git.dejodigital.com.br/dejo-core/dejo-node/compare/v1.1.0...v1.2.0) (2025-06-11)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Alteração trigger deploy branch master para dev ([84a35b0](https://git.dejodigital.com.br/dejo-core/dejo-node/commit/84a35b08a157a50edaddb87cacf1ec585e7f2b5d))
|
||||
|
||||
# [1.1.0](https://git.dejodigital.com.br/dejo-core/dejo-node/compare/v1.0.0...v1.1.0) (2025-06-11)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Alteração trigger deploy branch master para dev ([6f88c7a](https://git.dejodigital.com.br/dejo-core/dejo-node/commit/6f88c7a2b86899fed822aa42c8c1dd9720865fef))
|
||||
* Alteração trigger deploy branch master para dev ([2340355](https://git.dejodigital.com.br/dejo-core/dejo-node/commit/2340355e6cbe57bcd52d9b038f4661f03d3c0401))
|
||||
* Alteração trigger deploy branch master para dev ([43acc8f](https://git.dejodigital.com.br/dejo-core/dejo-node/commit/43acc8f809ffcb75e4b9f3cb1e5199a572900c6a))
|
||||
|
||||
# 1.0.0 (2025-06-11)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
<<<<<<< HEAD
|
||||
* Alteração trigger deploy branch master para dev ([15bb087](https://git.dejodigital.com.br/dejo-core/dejo-node/commit/15bb0872f818e2a7868b87ee53ed8fbbeafa1322))
|
||||
* Alteração trigger deploy branch master para dev ([1b2aaff](https://git.dejodigital.com.br/dejo-core/dejo-node/commit/1b2aaff753dfd3da0ceb616446607ad4823676fe))
|
||||
* Alteração trigger deploy branch master para dev ([772a1ac](https://git.dejodigital.com.br/dejo-core/dejo-node/commit/772a1ac9e91200666e41211e2c264eb70e214b39))
|
||||
=======
|
||||
>>>>>>> 4ef86c0 (chore(release): 1.0.0 [skip ci])
|
||||
=======
|
||||
>>>>>>> master
|
||||
* CI/CD - Conventional Commits e Semantic Release ([2c1f871](https://git.dejodigital.com.br/dejo-core/dejo-node/commit/2c1f8715dde4084a08117bffae1bbc40e7b9a95c))
|
||||
* CI/CD - Conventional Commits e Semantic Release ([cc93db0](https://git.dejodigital.com.br/dejo-core/dejo-node/commit/cc93db0d9a8e1358ca1e3e6128d1d710fc35e5b6))
|
||||
* CI/CD - Conventional Commits e Semantic Release ([abf3c77](https://git.dejodigital.com.br/dejo-core/dejo-node/commit/abf3c771e539afa48de8139ed7adb81341e80600))
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
// commitlint.config.js
|
||||
module.exports = {
|
||||
extends: ['@commitlint/config-conventional']
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user