diff --git a/.github/workflows/api.image+upload.yaml b/.github/workflows/api.image+upload.yaml deleted file mode 100644 index 2e6104292..000000000 --- a/.github/workflows/api.image+upload.yaml +++ /dev/null @@ -1,95 +0,0 @@ -name: API Deploy to Amazon ECR - -on: - push: - branches: - - master - paths: - - "api/**" - workflow_dispatch: - -env: - ecr_url: public.ecr.aws/bisonai/orakl-api - -jobs: - prepare: - name: Prepare Build - runs-on: ubuntu-latest - - outputs: - tag_date: ${{ steps.tag.outputs.date }} - tag_git_hash: ${{ steps.tag.outputs.git_hash }} - version: ${{ steps.package.outputs.version }} - - steps: - - uses: actions/checkout@v3 - - - name: Get time TAG - id: tag - run: | - echo "date=$(date +'%Y%m%d.%H%M')" >> $GITHUB_OUTPUT - echo "git_hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - - - name: Get package version - id: package - run: | - version=$(cat "./api/.version") - echo "version=${version}" >> $GITHUB_OUTPUT - - build: - name: Build - runs-on: ubuntu-latest - needs: prepare - - permissions: - id-token: write - contents: read - - outputs: - tag_date: ${{ steps.tag.outputs.date }} - tag_git_hash: ${{ steps.tag.outputs.git_hash }} - - steps: - - uses: actions/checkout@v3 - - - name: Setup Go - uses: actions/setup-go@v4 - with: - go-version: "1.22.3" - check-latest: true - cache-dependency-path: | - ./api/go.sum - - - name: Docker build orakl-api - run: SERVICE_NAME=orakl-api docker compose -f docker-compose.build.yaml build - - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 - with: - aws-region: us-east-1 - role-to-assume: ${{ secrets.ROLE_ARN }} - - - name: Login to Amazon ECR - id: login-ecr-public - uses: aws-actions/amazon-ecr-login@v1 - with: - registry-type: public - - - name: Publish Image to ECR(api) - run: | - docker tag orakl-api ${{ env.ecr_url }}:latest - docker push ${{ env.ecr_url }}:latest - docker tag ${{ env.ecr_url}}:latest ${{ env.ecr_url }}:v${{ needs.prepare.outputs.version }}.${{ needs.prepare.outputs.tag_date }}.${{ needs.prepare.outputs.tag_git_hash }} - docker push ${{ env.ecr_url }}:v${{ needs.prepare.outputs.version }}.${{ needs.prepare.outputs.tag_date }}.${{ needs.prepare.outputs.tag_git_hash }} - - # After Migration => uncommented - # create-helmchart-pr: - # needs: [prepare, build] - # uses: ./.github/workflows/create-helmchart-pr.yaml - # with: - # project-name: "api" - # version: ${{ needs.prepare.outputs.version }} - # tag_date: ${{ needs.prepare.outputs.tag_date }} - # tag_git_hash: ${{ needs.prepare.outputs.tag_git_hash }} - # secrets: - # PAT: ${{ secrets.PAT }} diff --git a/.github/workflows/boot-api.image+upload.yaml b/.github/workflows/boot-api.image+upload.yaml deleted file mode 100644 index dab2c2f6b..000000000 --- a/.github/workflows/boot-api.image+upload.yaml +++ /dev/null @@ -1,75 +0,0 @@ -name: Boot API Deploy to Amazon ECR - -on: - push: - branches: - - master - paths: - - "node/pkg/boot/**" - - "node/cmd/boot_api/**" - workflow_dispatch: - -env: - ecr_url: public.ecr.aws/bisonai/orakl-boot-api - -jobs: - prepare: - name: Prepare Build - runs-on: ubuntu-latest - - outputs: - tag_date: ${{ steps.tag.outputs.date }} - tag_git_hash: ${{ steps.tag.outputs.git_hash }} - - steps: - - uses: actions/checkout@v3 - - name: Get time TAG - id: tag - run: | - echo "date=$(date -u +'%Y%m%d.%H%M')" >> $GITHUB_OUTPUT - echo "git_hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - - build: - name: Build - runs-on: ubuntu-latest - needs: prepare - - permissions: - id-token: write - contents: read - - outputs: - tag_date: ${{ steps.tag.outputs.date }} - tag_git_hash: ${{ steps.tag.outputs.git_hash }} - - steps: - - uses: actions/checkout@v3 - - name: Setup Go - uses: actions/setup-go@v4 - with: - go-version: "1.22.3" - check-latest: true - cache-dependency-path: | - ./node/go.sum - ./node/go.mod - - name: Docker build orakl-boot-api - run: SERVICE_NAME=orakl-boot-api docker compose -f docker-compose.build.yaml build - - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 - with: - aws-region: us-east-1 - role-to-assume: ${{ secrets.ROLE_ARN }} - - - name: Login to Amazon ECR - id: login-ecr-public - uses: aws-actions/amazon-ecr-login@v1 - with: - registry-type: public - - - name: Publish Image to ECR(boot-api) - run: | - docker tag orakl-boot-api ${{ env.ecr_url }}:latest - docker push ${{ env.ecr_url }}:latest - docker tag ${{ env.ecr_url }}:latest ${{ env.ecr_url }}:v0.0.1.${{ needs.prepare.outputs.tag_date }}.${{ needs.prepare.outputs.tag_git_hash }} - docker push ${{ env.ecr_url }}:v0.0.1.${{ needs.prepare.outputs.tag_date }}.${{ needs.prepare.outputs.tag_git_hash }} diff --git a/.github/workflows/cli.image+upload.yaml b/.github/workflows/cli.image+upload.yaml deleted file mode 100644 index b5d35ddc7..000000000 --- a/.github/workflows/cli.image+upload.yaml +++ /dev/null @@ -1,85 +0,0 @@ -name: CLI Deploy to Amazon ECR - -on: - push: - branches: - - master - paths: - - "cli/**" - workflow_dispatch: - -env: - ecr_url: public.ecr.aws/bisonai/orakl-cli - -jobs: - prepare: - name: Prepare Build - runs-on: ubuntu-latest - - outputs: - tag_date: ${{ steps.tag.outputs.date }} - tag_git_hash: ${{ steps.tag.outputs.git_hash }} - version: ${{ steps.package.outputs.version }} - - steps: - - uses: actions/checkout@v3 - - - name: Get time TAG - id: tag - run: | - echo "date=$(date +'%Y%m%d.%H%M')" >> $GITHUB_OUTPUT - echo "git_hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - - - name: Get package version - id: package - run: | - echo "version=$(node -p -e "require('./cli/package.json').version")" >> $GITHUB_OUTPUT - - build: - name: Build - runs-on: ubuntu-latest - needs: prepare - - permissions: - id-token: write - contents: read - - outputs: - tag_date: ${{ steps.tag.outputs.date }} - tag_git_hash: ${{ steps.tag.outputs.git_hash }} - - steps: - - uses: actions/checkout@v3 - - - name: Docker build orakl-cli - run: SERVICE_NAME=orakl-cli docker compose -f docker-compose.build.yaml build - - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 - with: - aws-region: us-east-1 - role-to-assume: ${{ secrets.ROLE_ARN }} - - - name: Login to Amazon ECR - id: login-ecr-public - uses: aws-actions/amazon-ecr-login@v1 - with: - registry-type: public - - - name: Publish Image to ECR(cli) - run: | - docker tag orakl-cli ${{ env.ecr_url }}:latest - docker push ${{ env.ecr_url }}:latest - docker tag ${{ env.ecr_url }}:latest ${{ env.ecr_url }}:v${{ needs.prepare.outputs.version }}.${{ needs.prepare.outputs.tag_date }}.${{ needs.prepare.outputs.tag_git_hash }} - docker push ${{ env.ecr_url }}:v${{ needs.prepare.outputs.version }}.${{ needs.prepare.outputs.tag_date }}.${{ needs.prepare.outputs.tag_git_hash }} - - create-helmchart-pr: - needs: [prepare, build] - uses: ./.github/workflows/create-helmchart-pr.yaml - with: - project-name: "cli" - version: ${{ needs.prepare.outputs.version }} - tag_date: ${{ needs.prepare.outputs.tag_date }} - tag_git_hash: ${{ needs.prepare.outputs.tag_git_hash }} - secrets: - PAT: ${{ secrets.PAT }} diff --git a/.github/workflows/core.image+upload.yaml b/.github/workflows/core.image+upload.yaml deleted file mode 100644 index acc201f06..000000000 --- a/.github/workflows/core.image+upload.yaml +++ /dev/null @@ -1,85 +0,0 @@ -name: Core Deploy to Amazon ECR - -on: - push: - branches: - - master - paths: - - "core/**" - workflow_dispatch: - -env: - ecr_url: public.ecr.aws/bisonai/orakl-core - -jobs: - prepare: - name: Prepare Build - runs-on: ubuntu-latest - - outputs: - tag_date: ${{ steps.tag.outputs.date }} - tag_git_hash: ${{ steps.tag.outputs.git_hash }} - version: ${{ steps.package.outputs.version }} - - steps: - - uses: actions/checkout@v3 - - - name: Get time TAG - id: tag - run: | - echo "date=$(date +'%Y%m%d.%H%M')" >> $GITHUB_OUTPUT - echo "git_hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - - - name: Get package version - id: package - run: | - echo "version=$(node -p -e "require('./core/package.json').version")" >> $GITHUB_OUTPUT - - build: - name: Build - runs-on: ubuntu-latest - needs: prepare - - permissions: - id-token: write - contents: read - - outputs: - tag_date: ${{ steps.tag.outputs.date }} - tag_git_hash: ${{ steps.tag.outputs.git_hash }} - - steps: - - uses: actions/checkout@v3 - - - name: Docker build orakl-core - run: SERVICE_NAME=orakl-core docker compose -f docker-compose.build.yaml build - - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 - with: - aws-region: us-east-1 - role-to-assume: ${{ secrets.ROLE_ARN }} - - - name: Login to Amazon ECR - id: login-ecr-public - uses: aws-actions/amazon-ecr-login@v1 - with: - registry-type: public - - - name: Publish Image to ECR(core) - run: | - docker tag orakl-core ${{ env.ecr_url }}:latest - docker push ${{ env.ecr_url }}:latest - docker tag ${{ env.ecr_url }}:latest ${{ env.ecr_url }}:v${{ needs.prepare.outputs.version }}.${{ needs.prepare.outputs.tag_date }}.${{ needs.prepare.outputs.tag_git_hash }} - docker push ${{ env.ecr_url }}:v${{ needs.prepare.outputs.version }}.${{ needs.prepare.outputs.tag_date }}.${{ needs.prepare.outputs.tag_git_hash }} - - create-helmchart-pr: - needs: [prepare, build] - uses: ./.github/workflows/create-helmchart-pr.yaml - with: - project-name: "aggregator" - version: ${{ needs.prepare.outputs.version }} - tag_date: ${{ needs.prepare.outputs.tag_date }} - tag_git_hash: ${{ needs.prepare.outputs.tag_git_hash }} - secrets: - PAT: ${{ secrets.PAT }} diff --git a/.github/workflows/create-helmchart-pr.yaml b/.github/workflows/create-helmchart-pr.yaml deleted file mode 100644 index f9b22e641..000000000 --- a/.github/workflows/create-helmchart-pr.yaml +++ /dev/null @@ -1,70 +0,0 @@ -name: "create-helmchart-pr" - -on: - workflow_call: - inputs: - project-name: - required: true - type: string - version: - required: true - type: string - tag_date: - required: true - type: string - tag_git_hash: - required: true - type: string - - secrets: - PAT: - required: true - -jobs: - create-helmchart-pr: - runs-on: ubuntu-latest - strategy: - matrix: - environment: ["baobab", "cypress"] - include: - - environment: "baobab" - base: "gcp-baobab-prod" - - environment: "cypress" - base: "gcp-cypress-prod" - steps: - - name: Find Original PR - uses: jwalton/gh-find-current-pr@master - id: findPr - with: - state: closed - - name: Checkout code - uses: actions/checkout@v4 - with: - ref: ${{ matrix.base }} - repository: "Bisonai/orakl-helm-charts" - token: ${{ secrets.PAT }} - - - name: Install YQ - uses: dcarbone/install-yq-action@v1.1.1 - - - name: Create commits - run: | - set -e - git config --global user.email "orakl-bot@users.noreply.github.com" - git config --global user.name "orakl-bot" - - yq eval '.global.image.tag = "v${{ inputs.version }}.${{ inputs.tag_date }}.${{ inputs.tag_git_hash }}"' -i ./${{ inputs.project-name }}/values.yaml - yq eval '.appVersion = "v${{ inputs.version }}.${{ inputs.tag_date }}.${{ inputs.tag_git_hash }}"' -i ./${{ inputs.project-name }}/Chart.yaml - git add . - git commit -m "feat: deploy v${{ inputs.version }}.${{ inputs.tag_date }}.${{ inputs.tag_git_hash }}" - - - name: create PR - uses: peter-evans/create-pull-request@v6 - with: - token: ${{ secrets.PAT }} - commit-message: "feat: deploy v${{ inputs.version }}.${{ inputs.tag_date }}.${{ inputs.tag_git_hash }}" - title: "deploy ${{ matrix.environment }}-${{ inputs.project-name }}-v${{ inputs.version }}.${{ inputs.tag_date }}.${{ inputs.tag_git_hash }}" - body: "${{ matrix.environment }}-${{ inputs.project-name }}-v${{ inputs.version }}.${{ inputs.tag_date }}.${{ inputs.tag_git_hash }}\n### ${{ steps.findPr.outputs.title }}\n ${{ steps.findPr.outputs.body }}\n - PR: ${{ steps.findPr.outputs.pr }}" - base: "${{ matrix.base }}" - branch: "deploy/${{ matrix.environment }}-${{ inputs.project-name }}-v${{ inputs.version }}.${{ inputs.tag_date }}.${{ inputs.tag_git_hash }}" - reviewers: "Bisonai/orakl-team" diff --git a/.github/workflows/delegator.image+upload.yaml b/.github/workflows/delegator.image+upload.yaml deleted file mode 100644 index 3c56c3200..000000000 --- a/.github/workflows/delegator.image+upload.yaml +++ /dev/null @@ -1,92 +0,0 @@ -name: Go Delegator Deploy to Amazon ECR - -on: - push: - branches: - - master - paths: - - "delegator/**" - workflow_dispatch: -env: - ecr_url: public.ecr.aws/bisonai/orakl-delegator - -jobs: - prepare: - name: Prepare Build - runs-on: ubuntu-latest - - outputs: - tag_date: ${{ steps.tag.outputs.date }} - tag_git_hash: ${{ steps.tag.outputs.git_hash }} - version: ${{ steps.package.outputs.version }} - - steps: - - uses: actions/checkout@v3 - - - name: Get time TAG - id: tag - run: | - echo "date=$(date +'%Y%m%d.%H%M')" >> $GITHUB_OUTPUT - echo "git_hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - - - name: Get package version - id: package - run: | - version=$(cat "./delegator/.version") - echo "version=${version}" >> $GITHUB_OUTPUT - build: - name: Build - runs-on: ubuntu-latest - needs: prepare - - permissions: - id-token: write - contents: read - - outputs: - tag_date: ${{ steps.tag.outputs.date }} - tag_git_hash: ${{ steps.tag.outputs.git_hash }} - - steps: - - uses: actions/checkout@v3 - - - name: Setup Go - uses: actions/setup-go@v4 - with: - go-version: "1.22.3" - check-latest: true - cache-dependency-path: | - ./delegator/go.sum - - - name: Docker build orakl-delegator - run: SERVICE_NAME=orakl-delegator docker compose -f docker-compose.build.yaml build - - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 - with: - aws-region: us-east-1 - role-to-assume: ${{ secrets.ROLE_ARN }} - - - name: Login to Amazon ECR - id: login-ecr-public - uses: aws-actions/amazon-ecr-login@v1 - with: - registry-type: public - - - name: Publish Image to ECR(delegator) - run: | - docker tag orakl-delegator ${{ env.ecr_url }}:latest - docker push ${{ env.ecr_url }}:latest - docker tag ${{ env.ecr_url }}:latest ${{ env.ecr_url }}:v${{ needs.prepare.outputs.version }}.${{ needs.prepare.outputs.tag_date }}.${{ needs.prepare.outputs.tag_git_hash }} - docker push ${{ env.ecr_url }}:v${{ needs.prepare.outputs.version }}.${{ needs.prepare.outputs.tag_date }}.${{ needs.prepare.outputs.tag_git_hash }} - - # create-helmchart-pr: - # needs: [prepare, build] - # uses: ./.github/workflows/create-helmchart-pr.yaml - # with: - # project-name: "delegator" - # version: ${{ needs.prepare.outputs.version }} - # tag_date: ${{ needs.prepare.outputs.tag_date }} - # tag_git_hash: ${{ needs.prepare.outputs.tag_git_hash }} - # secrets: - # PAT: ${{ secrets.PAT }} diff --git a/.github/workflows/deployment.yaml b/.github/workflows/deployment.yaml new file mode 100644 index 000000000..28fd630b0 --- /dev/null +++ b/.github/workflows/deployment.yaml @@ -0,0 +1,191 @@ +name: Dispatch Deploy + +on: + workflow_dispatch: + inputs: + application: + description: "Application to deploy" + required: true + type: choice + options: + - "cli" + - "aggregator" + - "vrf" + - "api" + - "request-response" + - "delegator" + - "fetcher" + - "por" + - "node" + - "boot-api" + - "sentinel" + network: + description: "Network to deploy to" + required: true + type: choice + options: + - "Baobab" + - "Cypress" + +jobs: + prepare: + name: Prepare + runs-on: ubuntu-latest + if: ${{ github.event.inputs.network == 'Baobab' }} + + outputs: + tag_date: ${{ steps.tag.outputs.date }} + tag_git_hash: ${{ steps.tag.outputs.git_hash }} + service: ${{ steps.tag.outputs.service }} + ecr_url: ${{ steps.tag.outputs.ecr_url }} + version: ${{ steps.package.outputs.version }} + + steps: + - uses: actions/checkout@master + + - name: Get time TAG + id: tag + run: | + echo "date=$(date +'%Y%m%d.%H%M')" >> $GITHUB_OUTPUT + echo "git_hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + service="${{ github.event.inputs.application }}" + if [[ "${{ github.event.inputs.application }}" == "vrf" || "${{ github.event.inputs.application }}" == "request-response" || "${{ github.event.inputs.application }}" == "aggregator" ]]; then + service="core" + fi + echo "service=$service" >> $GITHUB_OUTPUT + echo "ecr_url=public.ecr.aws/bisonai/orakl-${service}" >> $GITHUB_OUTPUT + + - name: Get package version + id: package + run: | + if [[ "${{ steps.tag.outputs.service }}" == "cli" || "${{ steps.tag.outputs.service }}" == "fetcher" || "${{ steps.tag.outputs.service }}" == "core" ]]; then + echo "version=$(node -p -e "require('./"${{ steps.tag.outputs.service }}"/package.json').version")" >> $GITHUB_OUTPUT + else + if [[ "${{ steps.tag.outputs.service }} "" == "boot-api"]]; then + version=$(cat ./node/.version) + else + version=$(cat ./"${{ steps.tag.outputs.service }}"/.version) + fi + echo "version=$version" >> $GITHUB_OUTPUT + fi + + build: + name: Build + runs-on: ubuntu-latest + needs: prepare + if: ${{ github.event.inputs.network == 'Baobab' }} + + permissions: + id-token: write + contents: read + + outputs: + img_tag: ${{ steps.img-tag.outputs.img_tag }} + + steps: + - uses: actions/checkout@master + + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version: "1.22.3" + check-latest: true + cache-dependency-path: | + ./${{ needs.prepare.outputs.service }}/go.sum + ./${{ needs.prepare.outputs.service }}/go.mod + if: ${{ needs.prepare.outputs.service != 'core' || needs.prepare.outputs.service != 'fetcher' || needs.prepare.outputs.service != 'cli' }} + + - name: docker build ${{ inputs.application }} + run: SERVICE_NAME=orakl-${{ needs.prepare.outputs.service }} docker compose -f docker-compose.build.yaml build + + - name: configure aws credentials + uses: aws-actions/configure-aws-credentials@v2 + with: + aws-region: us-east-1 + role-to-assume: ${{ secrets.ROLE_ARN }} + + - name: login to amazon ecr + id: login-ecr-public + uses: aws-actions/amazon-ecr-login@v1 + with: + registry-type: public + + - name: publish image to ecr + run: | + docker tag orakl-${{ needs.prepare.outputs.service }} ${{ needs.prepare.outputs.ecr_url }}:latest + docker push ${{ needs.prepare.outputs.ecr_url }}:latest + docker tag ${{ needs.prepare.outputs.ecr_url }}:latest ${{ needs.prepare.outputs.ecr_url }}:v${{ needs.prepare.outputs.version }}.${{ needs.prepare.outputs.tag_date }}.${{ needs.prepare.outputs.tag_git_hash }} + docker push ${{ needs.prepare.outputs.ecr_url }}:v${{ needs.prepare.outputs.version }}.${{ needs.prepare.outputs.tag_date }}.${{ needs.prepare.outputs.tag_git_hash }} + + - name: image tag output + id: img-tag + run: echo "img_tag=v${{ needs.prepare.outputs.version }}.${{ needs.prepare.outputs.tag_date }}.${{ needs.prepare.outputs.tag_git_hash }}" >> $GITHUB_OUTPUT + + post-slack-image-upload: + name: Slack message for image upload + needs: [prepare, build] + uses: ./.github/workflows/post.slack.yaml + with: + status: "Success" + slack-message: "${{ github.event.inputs.network }} ${{ github.event.inputs.application }}* : *${{ needs.prepare.outputs.service }}* ${{ needs.prepare.outputs.version }}.${{ needs.prepare.outputs.tag_date }}.${{ needs.prepare.outputs.tag_git_hash }} is uploaded" + secrets: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + if: ${{ github.event.inputs.network == 'Baobab' && success() }} + + image-update: + name: Update image tag + needs: [prepare, build] + uses: ./.github/workflows/update.image-tag.yaml + with: + network: "baobab" + project-name: ${{ github.event.inputs.application }} + version: ${{ needs.prepare.outputs.version }} + image-tag: ${{ needs.build.outputs.img_tag }} + tag_date: ${{ needs.prepare.outputs.tag_date }} + tag_git_hash: ${{ needs.prepare.outputs.tag_git_hash }} + secrets: + PAT: ${{ secrets.PAT }} + if: ${{ github.event.inputs.network == 'Baobab' }} + + post-slack-baobab-tag-update-success: + name: Post slack message for tag update success + needs: [prepare, build, image-update] + uses: ./.github/workflows/post.slack.yaml + with: + status: "Success" + slack-message: "${{ github.event.inputs.network }} *${{ github.event.inputs.application }}* : *${{ needs.prepare.outputs.service }}* new image tag ${{ needs.prepare.outputs.version }}.${{ needs.prepare.outputs.tag_date }}.${{ needs.prepare.outputs.tag_git_hash }} is updated" + secrets: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + if: ${{ github.event.inputs.network == 'Baobab' && success() }} + + cypress-image-update: + name: cypress image update + uses: ./.github/workflows/update.image-tag.yaml + with: + network: "cypress" + project-name: ${{ github.event.inputs.application }} + secrets: + PAT: ${{ secrets.PAT }} + if: ${{ github.event.inputs.network == 'Cypress' }} + + post-slack-cypress-tag-update-success: + name: Post slack message for tag update success + needs: [cypress-image-update] + uses: ./.github/workflows/post.slack.yaml + with: + status: "Success" + slack-message: "${{ github.event.inputs.network }} *${{ github.event.inputs.application }}* is updated" + secrets: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + if: ${{ github.event.inputs.network == 'Cypress' && success() }} + + post-slack-tag-update-failure: + name: Post to a slack message for tag update failure + needs: [prepare, build, image-update] + uses: ./.github/workflows/post.slack.yaml + with: + status: "Failed" + slack-message: "${{ github.event.inputs.network }} *${{ github.event.inputs.application }}* git action failed" + secrets: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + if: ${{ github.event.inputs.network == 'Baobab' && failure() }} diff --git a/.github/workflows/fetcher.image+upload.yaml b/.github/workflows/fetcher.image+upload.yaml deleted file mode 100644 index 0895464df..000000000 --- a/.github/workflows/fetcher.image+upload.yaml +++ /dev/null @@ -1,85 +0,0 @@ -name: Fetcher Deploy to Amazon ECR - -on: - push: - branches: - - master - paths: - - "fetcher/**" - workflow_dispatch: - -env: - ecr_url: public.ecr.aws/bisonai/orakl-fetcher - -jobs: - prepare: - name: Prepare Build - runs-on: ubuntu-latest - - outputs: - tag_date: ${{ steps.tag.outputs.date }} - tag_git_hash: ${{ steps.tag.outputs.git_hash }} - version: ${{ steps.package.outputs.version }} - - steps: - - uses: actions/checkout@v3 - - - name: Get time TAG - id: tag - run: | - echo "date=$(date +'%Y%m%d.%H%M')" >> $GITHUB_OUTPUT - echo "git_hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - - - name: Get package version - id: package - run: | - echo "version=$(node -p -e "require('./fetcher/package.json').version")" >> $GITHUB_OUTPUT - - build: - name: Build - runs-on: ubuntu-latest - needs: prepare - - permissions: - id-token: write - contents: read - - outputs: - tag_date: ${{ steps.tag.outputs.date }} - tag_git_hash: ${{ steps.tag.outputs.git_hash }} - - steps: - - uses: actions/checkout@v3 - - - name: Docker build orakl-fetcher - run: SERVICE_NAME=orakl-fetcher docker compose -f docker-compose.build.yaml build - - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 - with: - aws-region: us-east-1 - role-to-assume: ${{ secrets.ROLE_ARN }} - - - name: Login to Amazon ECR - id: login-ecr-public - uses: aws-actions/amazon-ecr-login@v1 - with: - registry-type: public - - - name: Publish Image to ECR(fetcher) - run: | - docker tag orakl-fetcher ${{ env.ecr_url }}:latest - docker push ${{ env.ecr_url }}:latest - docker tag ${{ env.ecr_url }}:latest ${{ env.ecr_url }}:v${{ needs.prepare.outputs.version }}.${{ needs.prepare.outputs.tag_date }}.${{ needs.prepare.outputs.tag_git_hash }} - docker push ${{ env.ecr_url }}:v${{ needs.prepare.outputs.version }}.${{ needs.prepare.outputs.tag_date }}.${{ needs.prepare.outputs.tag_git_hash }} - - create-helmchart-pr: - needs: [prepare, build] - uses: ./.github/workflows/create-helmchart-pr.yaml - with: - project-name: "fetcher" - version: ${{ needs.prepare.outputs.version }} - tag_date: ${{ needs.prepare.outputs.tag_date }} - tag_git_hash: ${{ needs.prepare.outputs.tag_git_hash }} - secrets: - PAT: ${{ secrets.PAT }} diff --git a/.github/workflows/monitor.image+upload.yaml b/.github/workflows/monitor.image+upload.yaml deleted file mode 100644 index 0befdec53..000000000 --- a/.github/workflows/monitor.image+upload.yaml +++ /dev/null @@ -1,72 +0,0 @@ -name: Monitor Deploy to Amazon ECR - -on: - push: - branches: - - master - paths: - - "monitor/**" - workflow_dispatch: - -env: - ecr_url: public.ecr.aws/bisonai/orakl-general - -jobs: - prepare: - name: Prepare Build - runs-on: ubuntu-latest - - outputs: - tag_date: ${{ steps.tag.outputs.date }} - tag_git_hash: ${{ steps.tag.outputs.git_hash }} - version: ${{ steps.package.outputs.version }} - - steps: - - uses: actions/checkout@v3 - - - name: Get time TAG - id: tag - run: | - echo "date=$(date +'%Y%m%d.%H%M')" >> $GITHUB_OUTPUT - echo "git_hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - - - name: Get package version - id: package - run: | - echo "version=$(node -p -e "require('./package.json').version")" >> $GITHUB_OUTPUT - - build: - name: Build - runs-on: ubuntu-latest - needs: prepare - - permissions: - id-token: write - contents: read - - outputs: - tag_date: ${{ steps.tag.outputs.date }} - tag_git_hash: ${{ steps.tag.outputs.git_hash }} - - steps: - - uses: actions/checkout@v3 - - - name: Docker build orakl-monitor - run: SERVICE_NAME=orakl-general docker-compose -f docker-compose.build.yaml build - - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 - with: - aws-region: us-east-1 - role-to-assume: ${{ secrets.ROLE_ARN }} - - - name: Login to Amazon ECR - id: login-ecr-public - uses: aws-actions/amazon-ecr-login@v1 - with: - registry-type: public - - - name: Publish Image to ECR - run: | - docker tag orakl-general ${{ env.ecr_url }}:monitor.v${{ needs.prepare.outputs.version }}.${{ needs.prepare.outputs.tag_date }}.${{ needs.prepare.outputs.tag_git_hash }} - docker push ${{ env.ecr_url }}:monitor.v${{ needs.prepare.outputs.version }}.${{ needs.prepare.outputs.tag_date }}.${{ needs.prepare.outputs.tag_git_hash }} diff --git a/.github/workflows/node.image+upload.yaml b/.github/workflows/node.image+upload.yaml deleted file mode 100644 index 095042750..000000000 --- a/.github/workflows/node.image+upload.yaml +++ /dev/null @@ -1,74 +0,0 @@ -name: Orakl Node Deploy to Amazon ECR - -on: - push: - branches: - - master - paths: - - "node/**" - workflow_dispatch: - -env: - ecr_url: public.ecr.aws/bisonai/orakl-node - -jobs: - prepare: - name: Prepare Build - runs-on: ubuntu-latest - - outputs: - tag_date: ${{ steps.tag.outputs.date }} - tag_git_hash: ${{ steps.tag.outputs.git_hash }} - - steps: - - uses: actions/checkout@v3 - - name: Get time TAG - id: tag - run: | - echo "date=$(date -u +'%Y%m%d.%H%M')" >> $GITHUB_OUTPUT - echo "git_hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - - build: - name: Build - runs-on: ubuntu-latest - needs: prepare - - permissions: - id-token: write - contents: read - - outputs: - tag_date: ${{ steps.tag.outputs.date }} - tag_git_hash: ${{ steps.tag.outputs.git_hash }} - - steps: - - uses: actions/checkout@v3 - - name: Setup Go - uses: actions/setup-go@v4 - with: - go-version: "1.22.3" - check-latest: true - cache-dependency-path: | - ./node/go.sum - ./node/go.mod - - name: Docker build orakl-node - run: SERVICE_NAME=orakl-node docker compose -f docker-compose.build.yaml build - - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 - with: - aws-region: us-east-1 - role-to-assume: ${{ secrets.ROLE_ARN }} - - - name: Login to Amazon ECR - id: login-ecr-public - uses: aws-actions/amazon-ecr-login@v1 - with: - registry-type: public - - - name: Publish Image to ECR(orakl-node) - run: | - docker tag orakl-node ${{ env.ecr_url }}:latest - docker push ${{ env.ecr_url }}:latest - docker tag ${{ env.ecr_url }}:latest ${{ env.ecr_url }}:v0.0.1.${{ needs.prepare.outputs.tag_date }}.${{ needs.prepare.outputs.tag_git_hash }} - docker push ${{ env.ecr_url }}:v0.0.1.${{ needs.prepare.outputs.tag_date }}.${{ needs.prepare.outputs.tag_git_hash }} diff --git a/.github/workflows/por.image+upload.yaml b/.github/workflows/por.image+upload.yaml deleted file mode 100644 index 38c2323d3..000000000 --- a/.github/workflows/por.image+upload.yaml +++ /dev/null @@ -1,75 +0,0 @@ -name: POR Deploy to Amazon ECR - -on: - push: - branches: - - master - paths: - - "node/pkg/por/**" - - "node/cmd/por/**" - workflow_dispatch: - -env: - ecr_url: public.ecr.aws/bisonai/orakl-por - -jobs: - prepare: - name: Prepare Build - runs-on: ubuntu-latest - - outputs: - tag_date: ${{ steps.tag.outputs.date }} - tag_git_hash: ${{ steps.tag.outputs.git_hash }} - - steps: - - uses: actions/checkout@v3 - - name: Get time TAG - id: tag - run: | - echo "date=$(date -u +'%Y%m%d.%H%M')" >> $GITHUB_OUTPUT - echo "git_hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - - build: - name: Build - runs-on: ubuntu-latest - needs: prepare - - permissions: - id-token: write - contents: read - - outputs: - tag_date: ${{ steps.tag.outputs.date }} - tag_git_hash: ${{ steps.tag.outputs.git_hash }} - - steps: - - uses: actions/checkout@v3 - - name: Setup Go - uses: actions/setup-go@v4 - with: - go-version: "1.22.3" - check-latest: true - cache-dependency-path: | - ./node/go.sum - ./node/go.mod - - name: Docker build orakl-por - run: SERVICE_NAME=orakl-por docker compose -f docker-compose.build.yaml build - - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 - with: - aws-region: us-east-1 - role-to-assume: ${{ secrets.ROLE_ARN }} - - - name: Login to Amazon ECR - id: login-ecr-public - uses: aws-actions/amazon-ecr-login@v1 - with: - registry-type: public - - - name: Publish Image to ECR(por) - run: | - docker tag orakl-por ${{ env.ecr_url }}:latest - docker push ${{ env.ecr_url }}:latest - docker tag ${{ env.ecr_url }}:latest ${{ env.ecr_url }}:v0.0.1.${{ needs.prepare.outputs.tag_date }}.${{ needs.prepare.outputs.tag_git_hash }} - docker push ${{ env.ecr_url }}:v0.0.1.${{ needs.prepare.outputs.tag_date }}.${{ needs.prepare.outputs.tag_git_hash }} diff --git a/.github/workflows/post.slack.yaml b/.github/workflows/post.slack.yaml new file mode 100644 index 000000000..2697e8fd3 --- /dev/null +++ b/.github/workflows/post.slack.yaml @@ -0,0 +1,42 @@ +name: Post to a Slack channel + +on: + workflow_call: + inputs: + slack-message: + required: true + type: string + status: + required: true + type: string + secrets: + SLACK_BOT_TOKEN: + required: true + +jobs: + post-to-slack: + name: Post a message to a Slack channel + runs-on: ubuntu-latest + + permissions: + id-token: write + contents: read + + steps: + - name: Set Slack Payload + id: set-payload + run: | + if [ "${{ inputs.status }}" == "Success" ]; then + echo "::set-output name=payload::{\"text\":\":white_check_mark: ${{ inputs.slack-message }}\",\"attachments\":[{\"color\":\"28a745\",\"fields\":[{\"title\":\"Status\",\"short\":true,\"value\":\"${{ inputs.status }}\"}]}]}" + else + echo "::set-output name=payload::{\"text\":\":exclamation: ${{ inputs.slack-message }}\",\"attachments\":[{\"color\":\"E96D76\",\"fields\":[{\"title\":\"Status\",\"short\":true,\"value\":\"${{ inputs.status }}\"}]}]}" + fi + + - name: Post to a Slack channel + id: slack + uses: slackapi/slack-github-action@v1.26.0 + with: + channel-id: 'orakl-notification' + payload: ${{ steps.set-payload.outputs.payload }} + env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} diff --git a/.github/workflows/sentinel.image+upload.yaml b/.github/workflows/sentinel.image+upload.yaml deleted file mode 100644 index 9fb836b2b..000000000 --- a/.github/workflows/sentinel.image+upload.yaml +++ /dev/null @@ -1,74 +0,0 @@ -name: sentinel deploy to Amazon ECR - -on: - push: - branches: - - master - paths: - - "sentinel/**" - workflow_dispatch: - -env: - ecr_url: public.ecr.aws/bisonai/orakl-sentinel - -jobs: - prepare: - name: Prepare Build - runs-on: ubuntu-latest - - outputs: - tag_date: ${{ steps.tag.outputs.date }} - tag_git_hash: ${{ steps.tag.outputs.git_hash }} - - steps: - - uses: actions/checkout@v3 - - name: Get time TAG - id: tag - run: | - echo "date=$(date -u +'%Y%m%d.%H%M')" >> $GITHUB_OUTPUT - echo "git_hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - - build: - name: Build - runs-on: ubuntu-latest - needs: prepare - - permissions: - id-token: write - contents: read - - outputs: - tag_date: ${{ steps.tag.outputs.date }} - tag_git_hash: ${{ steps.tag.outputs.git_hash }} - - steps: - - uses: actions/checkout@v3 - - name: Setup Go - uses: actions/setup-go@v4 - with: - go-version: "1.22.3" - check-latest: true - cache-dependency-path: | - ./sentinel/go.sum - ./sentinel/go.mod - - name: Docker build orakl-sentinel - run: SERVICE_NAME=orakl-sentinel docker compose -f docker-compose.build.yaml build - - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 - with: - aws-region: us-east-1 - role-to-assume: ${{ secrets.ROLE_ARN }} - - - name: Login to Amazon ECR - id: login-ecr-public - uses: aws-actions/amazon-ecr-login@v1 - with: - registry-type: public - - - name: Publish Image to ECR(sentinel) - run: | - docker tag orakl-sentinel ${{ env.ecr_url }}:latest - docker push ${{ env.ecr_url }}:latest - docker tag ${{ env.ecr_url }}:latest ${{ env.ecr_url }}:v0.0.1.${{ needs.prepare.outputs.tag_date }}.${{ needs.prepare.outputs.tag_git_hash }} - docker push ${{ env.ecr_url }}:v0.0.1.${{ needs.prepare.outputs.tag_date }}.${{ needs.prepare.outputs.tag_git_hash }} diff --git a/.github/workflows/tag+deploy.yaml b/.github/workflows/tag+deploy.yaml new file mode 100644 index 000000000..2a31d0113 --- /dev/null +++ b/.github/workflows/tag+deploy.yaml @@ -0,0 +1,183 @@ +name: Build and Deploy + +on: + push: + tags: + - "**" + +jobs: + prepare: + name: Prepare + runs-on: ubuntu-latest + + outputs: + tag_date: ${{ steps.hash.outputs.date }} + tag_git_hash: ${{ steps.hash.outputs.git_hash }} + service: ${{ steps.extract_tags.outputs.service }} + version: ${{ steps.extract_tags.outputs.version }} + ecr_url: ${{ steps.extract_tags.outputs.ecr_url }} + app_name: ${{ steps.extract_tags.outputs.app_name }} + + steps: + - uses: actions/checkout@master + + - name: get date and git hash + id: hash + run: | + echo "date=$(date +'%Y%m%d.%H%M')" >> $GITHUB_OUTPUT + echo "git_hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + + - name: Check if ref is a tag + id: check_tag + run: | + echo "Tag name from GITHUB_REF_NAME: $GITHUB_REF_NAME" + echo "tag: ${{github.ref_name}}" + if [ "${GITHUB_REF_TYPE}" != "tag" ]; then + echo "This workflow only processes tags. Exiting." + exit 0 + fi + + - name: extract version and service from tag + id: extract_tags + run: | + tag_ref=${GITHUB_REF#refs/tags/} + echo "Tag: $tag_ref" + + # Extract service name and version from the tag (e.g., service_name/v1.2.3) + if [[ $tag_ref =~ ^([a-zA-Z0-9]+-?[a-zA-Z0-9]+)/v([0-9]+\.[0-9]+\.[0-9]+)$ ]]; then + service="${BASH_REMATCH[1]}" + version="${BASH_REMATCH[2]}" + echo "Found service: $service" + echo "Found version: $version" + echo "app_name=${service}" >> $GITHUB_OUTPUT + if [[ "$service" == "vrf" || "$service" == "request-response" || "$service" == "aggregator" ]]; then + service="core" + fi + + echo "service=${service}" >> $GITHUB_OUTPUT + echo "version=${version}" >> $GITHUB_OUTPUT + echo "ecr_url=public.ecr.aws/bisonai/orakl-${service}" >> $GITHUB_OUTPUT + else + echo "Tag does not match the pattern." + exit 1 + fi + + build: + name: Build + runs-on: ubuntu-latest + needs: prepare + + permissions: + id-token: write + contents: read + + outputs: + img_tag: ${{ steps.img-tag.outputs.img_tag }} + + steps: + - uses: actions/checkout@v4 + + - name: docker build ${{ needs.prepare.outputs.service }} + run: SERVICE_NAME=orakl-${{ needs.prepare.outputs.service }} docker compose -f docker-compose.build.yaml build + + - name: configure aws credentials + uses: aws-actions/configure-aws-credentials@v2 + with: + aws-region: us-east-1 + role-to-assume: ${{ secrets.ROLE_ARN }} + + - name: login to amazon ecr + id: login-ecr-public + uses: aws-actions/amazon-ecr-login@v1 + with: + registry-type: public + + - name: publish image to ecr + run: | + docker tag orakl-${{ needs.prepare.outputs.service }} ${{ needs.prepare.outputs.ecr_url }}:latest + docker push ${{ needs.prepare.outputs.ecr_url }}:latest + docker tag ${{ needs.prepare.outputs.ecr_url }}:latest ${{ needs.prepare.outputs.ecr_url }}:v${{ needs.prepare.outputs.version }}.${{ needs.prepare.outputs.tag_date }}.${{ needs.prepare.outputs.tag_git_hash }} + docker push ${{ needs.prepare.outputs.ecr_url }}:v${{ needs.prepare.outputs.version }}.${{ needs.prepare.outputs.tag_date }}.${{ needs.prepare.outputs.tag_git_hash }} + + - name: image tag output + id: img-tag + run: echo "img_tag=v${{ needs.prepare.outputs.version }}.${{ needs.prepare.outputs.tag_date }}.${{ needs.prepare.outputs.tag_git_hash }}" >> $GITHUB_OUTPUT + + post-slack-image-upload: + name: Slack message for image upload + needs: [prepare, build] + uses: ./.github/workflows/post.slack.yaml + with: + status: "Success" + slack-message: "*${{ needs.prepare.outputs.app_name }}* : *${{ needs.prepare.outputs.service }}* ${{ needs.prepare.outputs.version }}.${{ needs.prepare.outputs.tag_date }}.${{ needs.prepare.outputs.tag_git_hash }} is uploaded" + secrets: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + if: ${{ success() }} + + image-update: + name: Update image tag + needs: [prepare, build] + uses: ./.github/workflows/update.image-tag.yaml + with: + network: "baobab" + project-name: ${{ needs.prepare.outputs.app_name }} + version: ${{ needs.prepare.outputs.version }} + image-tag: ${{ needs.build.outputs.img_tag }} + tag_date: ${{ needs.prepare.outputs.tag_date }} + tag_git_hash: ${{ needs.prepare.outputs.tag_git_hash }} + secrets: + PAT: ${{ secrets.PAT }} + if: ${{ success() }} + + # update-package-json-version: + # name: Update package.json version + # needs: [prepare, build, image-update] + # runs-on: ubuntu-latest + # steps: + + # - name: Read package.json + # id: package + # uses: juliangruber/read-file-action@v1 + # with: + # path: ./package.json + # - name: Echo package.json + # run: echo "${{ steps.package.outputs.content }}" + + # - name: update package.json version + # if: needs.prepare.outputs.version + # run: | + # version=v${{ needs.prepare.outputs.version }} + # echo "updating package.json to version $version" + # cd ./${{ needs.prepare.outputs.service }} + # npm version $version --no-git-tag-version + + # - name: commit updated package.json + # if: needs.prepare.outputs.version + # run: | + # git config --global user.name 'github-actions' + # git config --global user.email 'github-actions@github.com' + # git add package.json + # git commit -m "chore: update package.json version to ${{ needs.prepare.outputs.version }}" + # git push origin HEAD:${{ github.ref_name }} + + post-slack-tag-update-success: + name: Post slack message for tag update success + needs: [prepare, build, image-update] + uses: ./.github/workflows/post.slack.yaml + if: ${{ success() }} + with: + status: "Success" + slack-message: "*${{ needs.prepare.outputs.app_name }}* : *${{ needs.prepare.outputs.service }}* new image tag ${{ needs.prepare.outputs.version }}.${{ needs.prepare.outputs.tag_date }}.${{ needs.prepare.outputs.tag_git_hash }} is updated" + secrets: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + + post-slack-tag-update-failure: + name: Post to a slack message for tag update failure + needs: [prepare, build, image-update] + if: ${{ failure() }} + uses: ./.github/workflows/post.slack.yaml + with: + status: "Failed" + slack-message: "*${{ needs.prepare.outputs.app_name }}* git action failed" + secrets: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} diff --git a/.github/workflows/update.image-tag.yaml b/.github/workflows/update.image-tag.yaml new file mode 100644 index 000000000..7ebdf3c0b --- /dev/null +++ b/.github/workflows/update.image-tag.yaml @@ -0,0 +1,95 @@ +name: "update-image-tag" + +on: + workflow_call: + inputs: + network: + required: true + type: string + project-name: + required: true + type: string + version: + required: false + type: string + image-tag: + required: false + type: string + tag_date: + required: false + type: string + tag_git_hash: + required: false + type: string + secrets: + PAT: + required: true + +jobs: + update-image-tag: + name: Push to Orakl Helm Charts + runs-on: ubuntu-latest + + permissions: + id-token: write + contents: read + + steps: + - name: Checkout gitops + run: | + echo Checking out ${GITHUB_SERVER_URL}/bisonai/orakl-helm-charts.git + rm -rf ./gitops_tmp + GH_URL=$(echo "$GITHUB_SERVER_URL" | sed 's,://,://x-access-token:'"${{ secrets.PAT }}"'@,g') + git clone --depth 1 --no-single-branch ${GH_URL}/bisonai/orakl-helm-charts.git ./gitops_tmp + shell: bash + + - name: Verify and Checkout Branch + run: | + cd ./gitops_tmp/ + git fetch origin idc-fly:idc-fly + git checkout idc-fly + + - name: Update image tag in values.${{ inputs.network }}.yaml files + run: | + cd ./gitops_tmp/${{ inputs.project-name }}/ + echo "Updating image tag in values.${{ inputs.network }}.yaml files" + + if [[ "${{ inputs.network}}" == "cypress" ]]; then + + if [[ "${{ inputs.project-name }}" == "vrf" || "${{ inputs.project-name }}" == "request-response" || "${{ inputs.project-name }}" == "aggregator" ]]; then + listener_baobab_tag=$(grep -oP 'listenerTag: "\K[^"]+' values.baobab.yaml) + sed -i 's/listenerTag: .*$/listenerTag: "$listener_baobab_tag"/g' values.${{ inputs.network }}.yaml + reporter_baobab_tag=$(grep -oP 'reporterTag: "\K[^"]+' values.baobab.yaml) + sed -i 's/reporterTag: .*$/reporterTag: "$reporter_baobab_tag"/g' values.${{ inputs.network }}.yaml + worker_baobab_tag=$(grep -oP 'workerTag: "\K[^"]+' values.baobab.yaml) + sed -i 's/workerTag: .*$/workerTag: "$worker_baobab_tag"/g' values.${{ inputs.network }}.yaml + fi + + baobab_tag=$(grep -oP 'tag: "\K[^"]+' values.baobab.yaml) + sed -i "s/tag: \".*\"/tag: \"$baobab_tag\"/" values.${{ inputs.network }}.yaml + + else + + if [[ "${{ inputs.project-name }}" == "vrf" || "${{ inputs.project-name }}" == "request-response" || "${{ inputs.project-name }}" == "aggregator" ]]; then + sed -i 's/listenerTag: .*$/listenerTag: "${{ inputs.image-tag }}"/g' values.${{ inputs.network }}.yaml + sed -i 's/reporterTag: .*$/reporterTag: "${{ inputs.image-tag }}"/g' values.${{ inputs.network }}.yaml + sed -i 's/workerTag: .*$/workerTag: "${{ inputs.image-tag }}"/g' values.${{ inputs.network }}.yaml + fi + + sed -i 's/tag: .*$/tag: "${{ inputs.image-tag }}"/g' values.${{ inputs.network }}.yaml + sed -i 's/appVersion: .*$/appVersion: "${{ inputs.image-tag }}"/g' values.${{ inputs.network }}.yaml + + sed -i 's/^appVersion:.*$/appVersion: v'${{ inputs.version }}'.'${{ inputs.tag_date }}'.'${{ inputs.tag_git_hash }}'/' Chart.yaml + + fi + shell: bash + + - name: Commit and Push Changes + run: | + cd ./gitops_tmp/ + git config --global user.name 'github-actions' + git config --global user.email 'github-actions@github.com' + git add . + git commit -m 'v${{ inputs.version }}.${{ inputs.tag_date }}.${{ inputs.tag_git_hash }} is updated' + git push origin idc-fly + shell: bash diff --git a/node/.version b/node/.version new file mode 100644 index 000000000..8a9ecc2ea --- /dev/null +++ b/node/.version @@ -0,0 +1 @@ +0.0.1 \ No newline at end of file