Skip to content

Commit

Permalink
fix(slack): fix mm customer name
Browse files Browse the repository at this point in the history
  • Loading branch information
alonp99 authored and r4zendev committed Jan 21, 2025
1 parent 1904c99 commit d334a7a
Show file tree
Hide file tree
Showing 119 changed files with 1,591 additions and 4,454 deletions.
1 change: 0 additions & 1 deletion .github/workflows/db-ops.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ jobs:
runs-on: ubuntu-latest
needs: [update-helm-chart,build-and-push-ee-image]
if: ${{ needs.update-helm-chart.result == 'success' }}
environment: ${{ github.event.client_payload.environment }}
permissions:
contents: read
packages: write
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/deploy-wf-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ jobs:
docker tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}:${{ env.SHORT_HASH }}-sb ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}:${{ env.SHORT_HASH }}-${{ inputs.environment }}
docker tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}:${{ env.SHORT_HASH }}-sb ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}:${{ inputs.environment }}
docker tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}:${{ env.SHORT_HASH }}-sb ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}:latest
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}:latest
else
docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}:${{ env.SHORT_HASH }}-dev
docker tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}:${{ env.SHORT_HASH }}-dev ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}:${{ env.SHORT_HASH }}-${{ inputs.environment }}
Expand Down Expand Up @@ -257,7 +256,6 @@ jobs:
runs-on: ubuntu-latest
needs: [update-helm-chart,build-and-push-ee-image]
if: ${{ needs.update-helm-chart.result == 'success' }}
environment: ${{ inputs.environment }}
permissions:
contents: read
packages: write
Expand Down
54 changes: 15 additions & 39 deletions .github/workflows/hotfix-wf-service.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Hotfix on workflows-service
name: Under Testing - Hotfix on workflows-service

on:
workflow_dispatch:
Expand Down Expand Up @@ -34,7 +34,6 @@ jobs:
docker_image: ${{ steps.docker-version.outputs.image }} # ghcr.io/ballerine-io/workflows-service
docker_tag: ${{ steps.docker-version.outputs.tag }} # <short_sha>-<branch_name>
docker_full_image: ${{ steps.docker-version.outputs.full_image }} # ghcr.io/ballerine-io/workflows-service:<short_sha>-<branch_name>
sanitized-branch: ${{ steps.sanitized-branch.outputs.sanitized-branch-name }}

steps:
- name: Checkout repository
Expand Down Expand Up @@ -62,10 +61,6 @@ jobs:
uses: ./.github/actions/bump-version
with:
tag: ${{ steps.version.outputs.tag }}

- name: "Determine Branch"
id: sanitized-branch
uses: transferwise/sanitize-branch-name@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
Expand Down Expand Up @@ -99,9 +94,8 @@ jobs:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=${{ github.ref_name }}
type=raw,value=${{ inputs.environment }}
type=raw,value=${{ steps.version.outputs.sha_short }}-${{ inputs.environment }}
type=raw,value=${{ steps.version.outputs.sha_short }}-${{ steps.sanitized-branch.outputs.sanitized-branch-name }}
type=raw,value=dev
type=raw,value=${{ steps.version.outputs.sha_short }}-${{ github.ref_name }}
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'prod') }}
type=sha,format=short
Expand All @@ -110,7 +104,7 @@ jobs:
run: |
DOCKER_IMAGE=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
DOCKER_TAG=${{ steps.version.outputs.sha_short }}-${{ github.ref_name }}
DOCKER_FULL_IMAGE=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.sha_short }}-${{ steps.sanitized-branch.outputs.sanitized-branch-name }}
DOCKER_FULL_IMAGE=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.sha_short }}-${{ github.ref_name }}
echo "DOCKER_IMAGE=$DOCKER_IMAGE"
echo "DOCKER_TAG=$DOCKER_TAG"
Expand All @@ -126,8 +120,8 @@ jobs:
echo "sha_short: ${{ steps.version.outputs.sha_short }}"
echo "docker_meta-tags: ${{ steps.docker_meta.outputs.tags }}"
echo "bump-version-version: ${{ steps.bump-version.outputs.version }}-hotfix"
echo "bump-version-tag: ${{ steps.bump-version.outputs.tag }}-hotfix"
echo "bump-version-version: ${{ steps.bump-version.outputs.version }}"
echo "bump-version-tag: ${{ steps.bump-version.outputs.tag }}"
- name: Build and push Docker image
uses: docker/build-push-action@v5
Expand All @@ -139,7 +133,7 @@ jobs:
cache-to: type=local,dest=/tmp/.buildx-cache
tags: ${{ steps.docker_meta.outputs.tags }}
build-args: |
"RELEASE=${{ steps.bump-version.outputs.tag }}-hotfix"
"RELEASE=${{ steps.bump-version.outputs.tag }}"
"SHORT_SHA=${{ steps.version.outputs.sha_short }}"
- name: Scan Docker Image
Expand All @@ -154,23 +148,6 @@ jobs:
trivyignores: ./.trivyignore
vuln-type: 'os,library'
severity: 'CRITICAL'

- name: Update Service version in Environment
run: |
if [ "${{ inputs.environment }}" == "prod" ]; then
ENV="PROD"
elif [ "${{ inputs.environment }}" == "sb" ]; then
ENV="SB"
else
ENV="DEV"
fi
echo "$ENV"
curl -X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GH_CI_ENV_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/repos/ballerine-io/ballerine/actions/variables/${ENV^^}_WF_SHORT_SHA" \
-d "{\"name\":\"${ENV}_WF_SHORT_SHA\",\"value\":\"${{ steps.version.outputs.sha_short }}\"}"

build-and-push-ee-image:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -244,14 +221,14 @@ jobs:
images: ${{needs.build-and-push-image.outputs.docker_image}}-ee
tags: |
type=raw,value=${{ inputs.environment }}
type=raw,value=${{ needs.build-and-push-image.outputs.sha_short }}-${{ steps.lastcommit.outputs.shorthash }}-${{ needs.build-and-push-image.outputs.sanitized-branch }}
type=raw,value=${{ needs.build-and-push-image.outputs.sha_short }}-${{ steps.lastcommit.outputs.shorthash }}-${{ inputs.environment }}
type=sha,format=short
- name: Docker metadata version
id: docker-version
run: |
DOCKER_IMAGE=${{needs.build-and-push-image.outputs.docker_image}}-ee
DOCKER_TAG=${{ needs.build-and-push-image.outputs.sha_short }}-${{ steps.lastcommit.outputs.shorthash }}-${{ needs.build-and-push-image.outputs.sanitized-branch }}
DOCKER_TAG=${{ needs.build-and-push-image.outputs.sha_short }}-${{ steps.lastcommit.outputs.shorthash }}-${{ inputs.environment }}
DOCKER_FULL_IMAGE=$DOCKER_IMAGE:$DOCKER_TAG
echo "DOCKER_IMAGE=$DOCKER_IMAGE"
Expand Down Expand Up @@ -315,21 +292,20 @@ jobs:
repository: ballerine-io/cloud-infra-config
branch: main
commitChange: true
message: "Performed HotFix to ${{ inputs.environment }} wf-service application image Version to ${{ needs.build-and-push-image.outputs.sha_short }}-${{ needs.build-and-push-ee-image.outputs.SUBMODULE_SHORT_HASH }}-${{ needs.build-and-push-image.outputs.sanitized-branch }} - (Commit hash: ${{ github.sha }}, commit message: ${{ github.event.head_commit.message }})"
message: "Performed HotFix to ${{ inputs.environment }} wf-service image Version to ${{ needs.build-and-push-image.outputs.sha_short }}-${{ needs.build-and-push-ee-image.outputs.SUBMODULE_SHORT_HASH }}-${{ inputs.environment }} - (Commit hash: ${{ github.sha }}, commit message: ${{ github.event.head_commit.message }})"
token: ${{ secrets.GIT_TOKEN }}
changes: |
{
"kubernetes/helm/wf-service/${{steps.update_helm_check.outputs.file_name}}": {
"image.tag": "${{ needs.build-and-push-image.outputs.sha_short }}-${{ needs.build-and-push-ee-image.outputs.SUBMODULE_SHORT_HASH }}-${{ needs.build-and-push-image.outputs.sanitized-branch }}",
"prismaMigrate.image.tag": "${{ needs.build-and-push-image.outputs.sha_short }}-${{ needs.build-and-push-ee-image.outputs.SUBMODULE_SHORT_HASH }}-${{ needs.build-and-push-image.outputs.sanitized-branch }}",
"dbMigrate.image.tag": "${{ needs.build-and-push-image.outputs.sha_short }}-${{ needs.build-and-push-ee-image.outputs.SUBMODULE_SHORT_HASH }}-${{ needs.build-and-push-image.outputs.sanitized-branch }}",
"dataSync.image.tag": "${{ needs.build-and-push-image.outputs.sha_short }}-${{ needs.build-and-push-ee-image.outputs.SUBMODULE_SHORT_HASH }}-${{ needs.build-and-push-image.outputs.sanitized-branch }}"
"image.tag": "${{ needs.build-and-push-image.outputs.sha_short }}-${{ needs.build-and-push-ee-image.outputs.SUBMODULE_SHORT_HASH }}-${{ inputs.environment }}",
"prismaMigrate.image.tag": "${{ needs.build-and-push-image.outputs.sha_short }}-${{ needs.build-and-push-ee-image.outputs.SUBMODULE_SHORT_HASH }}-${{ inputs.environment }}",
"dbMigrate.image.tag": "${{ needs.build-and-push-image.outputs.sha_short }}-${{ needs.build-and-push-ee-image.outputs.SUBMODULE_SHORT_HASH }}-${{ inputs.environment }}",
"dataSync.image.tag": "${{ needs.build-and-push-image.outputs.sha_short }}-${{ needs.build-and-push-ee-image.outputs.SUBMODULE_SHORT_HASH }}-${{ inputs.environment }}"
}
}
send-to-slack:
runs-on: ubuntu-latest
needs: [update-helm-chart,build-and-push-ee-image,build-and-push-image]
environment: ${{ inputs.environment }}
if: ${{ needs.update-helm-chart.result == 'success' }}
permissions:
contents: read
Expand All @@ -341,7 +317,7 @@ jobs:
uses: slackapi/slack-github-action@v1.26.0
with:
channel-id: '${{ secrets.ARGO_SLACK_CHANNEL_ID }}'
slack-message: "Hotfix on Wf-service app Deployment in ${{ inputs.environment }} with tag ${{ needs.build-and-push-image.outputs.sha_short }}-${{ needs.build-and-push-ee-image.outputs.SUBMODULE_SHORT_HASH }}-${{ needs.build-and-push-image.outputs.sanitized-branch }} build result: ${{ job.status }}. successfully updated the hotfix on wf-service helm values for ${{ inputs.environment }}."
slack-message: "Hotfix on Wf-service Deployment in ${{ inputs.environment }} with tag ${{ needs.build-and-push-image.outputs.sha_short }}-${{ needs.build-and-push-ee-image.outputs.SUBMODULE_SHORT_HASH }}-${{ inputs.environment }} build result: ${{ job.status }}. successfully updated the hotfix on wf-service helm values for ${{ inputs.environment }}."
env:
SLACK_BOT_TOKEN: ${{ secrets.ARGO_SLACK_BOT_TOKEN }}

Expand Down
Loading

0 comments on commit d334a7a

Please sign in to comment.