Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
Signed-off-by: Rajpal Chauhan <[email protected]>
  • Loading branch information
rajpalc7 committed Feb 26, 2024
1 parent 2f4f7b0 commit cd48413
Showing 1 changed file with 69 additions and 69 deletions.
138 changes: 69 additions & 69 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,37 +144,37 @@ jobs:
SOURCE_IMAGE_TAG: ${{ matrix.SOURCE_IMAGE_TAG }}
file: ${{ matrix.SOURCE_CONTEXT_DIR }}/${{ matrix.DOCKER_FILE_PATH }}

# - name: Extract Tags
# id: extract
# if: contains(fromJSON('["aries-endorser-db"]'), matrix.service)
# run: echo "tags=$(echo '${{ steps.meta.outputs.tags }}' | grep -oE ':([^[:space:]]+)' | sed '/workflow/d' | sed 's/://g' | tr '\n' ' ')" >> $GITHUB_OUTPUT
- name: Extract Tags
id: extract
if: contains(fromJSON('["aries-endorser-db"]'), matrix.service)
run: echo "tags=$(echo '${{ steps.meta.outputs.tags }}' | grep -oE ':([^[:space:]]+)' | sed '/workflow/d' | sed 's/://g' | tr '\n' ' ')" >> $GITHUB_OUTPUT

# - name: Pull database image
# if: contains(fromJSON('["aries-endorser-db"]'), matrix.service)
# run: |
# docker pull ${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }}
- name: Pull database image
if: contains(fromJSON('["aries-endorser-db"]'), matrix.service)
run: |
docker pull ${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }}
# - name: Build database image
# id: build_image
# if: contains(fromJSON('["aries-endorser-db"]'), matrix.service)
# uses: redhat-actions/s2i-build@v2
# with:
# path_context: ${{ matrix.PATH }}
# # Builder image for a java projectE_IMAG
# builder_image: ${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }}
# image: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }}
# tags: ${{ steps.extract.outputs.tags }}
- name: Build database image
id: build_image
if: contains(fromJSON('["aries-endorser-db"]'), matrix.service)
uses: redhat-actions/s2i-build@v2
with:
path_context: ${{ matrix.PATH }}
# Builder image for a java projectE_IMAG
builder_image: ${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }}
image: ${{ matrix.service }}
tags: ${{ steps.extract.outputs.tags }}

# - name: Push database image
# id: push
# if: contains(fromJSON('["aries-endorser-db"]'), matrix.service)
# uses: redhat-actions/push-to-registry@v2
# with:
# tags: ${{ steps.build_image.outputs.tags }}
# image: ${{ steps.build_image.outputs.image }}
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
# registry: ${{ env.GITHUB_IMAGE_REPO }}
- name: Push database image
id: push
if: contains(fromJSON('["aries-endorser-db"]'), matrix.service)
uses: redhat-actions/push-to-registry@v2
with:
tags: ${{ steps.build_image.outputs.tags }}
image: ${{ steps.build_image.outputs.image }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ${{ env.GITHUB_IMAGE_REPO }}

- name: Log in to the GHCR
uses: docker/login-action@v3
Expand All @@ -194,14 +194,14 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
outputs: type=image,name=target

# - name: Display ${{ matrix.service }} image results
# id: digests
# if: contains(fromJSON('["aries-endorser-db"]'), matrix.service)
# run: |
# echo "registry_path=${{ steps.push.outputs.registry-paths }}"
# digest=${{ steps.push.outputs.digest }}
# echo "digest=${digest}"
# echo "${{ matrix.service }}_digest=${digest}" >> $GITHUB_OUTPUT
- name: Display ${{ matrix.service }} image results
id: digests
if: contains(fromJSON('["aries-endorser-db"]'), matrix.service)
run: |
echo "registry_path=${{ steps.push.outputs.registry-paths }}"
digest=${{ steps.push.outputs.digest }}
echo "digest=${digest}"
echo "${{ matrix.service }}_digest=${digest}" >> $GITHUB_OUTPUT
- name: Display ${{ matrix.service}} image results
id: digest
Expand All @@ -213,41 +213,41 @@ jobs:
echo "${{ matrix.service }}_digest=${digest}" >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
deploy2dev:
needs: build
env:
ENVIRONMENT: dev
permissions:
packages: write
runs-on: ubuntu-latest
environment: dev
strategy:
# Serialize the deployments
max-parallel: 1
matrix:
include:
# - service: aries-endorser-db
- service: aries-endorser-agent
- service: aries-endorser-backup
- service: aries-endorser-proxy
- service: aries-endorser-api
# deploy2dev:
# needs: build
# env:
# ENVIRONMENT: dev
# permissions:
# packages: write
# runs-on: ubuntu-latest
# environment: dev
# strategy:
# # Serialize the deployments
# max-parallel: 1
# matrix:
# include:
# # - service: aries-endorser-db
# - service: aries-endorser-agent
# - service: aries-endorser-backup
# - service: aries-endorser-proxy
# - service: aries-endorser-api

steps:
- name: Checkout
uses: actions/checkout@v4
# steps:
# - name: Checkout
# uses: actions/checkout@v4

- name: Deploy to ${{ env.ENVIRONMENT }}
uses: ./.github/workflows/actions/deploy
with:
environment: ${{ env.ENVIRONMENT }}
ghcr_token: ${{ secrets.GITHUB_TOKEN }}
github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }}
image_digest: ${{ needs.build.outputs[format ('{0}_digest', matrix.service)] }}
openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ matrix.service }}
openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }}
namespace: ${{ vars.NAMESPACE }}
deployment_configuration: ${{ matrix.service }}
openshift_token: ${{ secrets.OPENSHIFT_TOKEN }}
# - name: Deploy to ${{ env.ENVIRONMENT }}
# uses: ./.github/workflows/actions/deploy
# with:
# environment: ${{ env.ENVIRONMENT }}
# ghcr_token: ${{ secrets.GITHUB_TOKEN }}
# github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }}
# image_digest: ${{ needs.build.outputs[format ('{0}_digest', matrix.service)] }}
# openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ matrix.service }}
# openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }}
# namespace: ${{ vars.NAMESPACE }}
# deployment_configuration: ${{ matrix.service }}
# openshift_token: ${{ secrets.OPENSHIFT_TOKEN }}
# rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }}

# # deploy2test:
Expand Down

0 comments on commit cd48413

Please sign in to comment.