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 Mar 6, 2024
1 parent 3c8d020 commit 6206666
Showing 1 changed file with 87 additions and 15 deletions.
102 changes: 87 additions & 15 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,43 +7,114 @@ on:
description: 'Service to build and deploy'
required: true
default: 'aries-endorser-agent'
default: 'aries-endorser-git-agent'
git_repo_url:
endorser_agent_git_repo_url:
description: 'Git repository URL'
required: true
default: 'hyperledger/aries-endorser-service'
git_ref:
endorser_agent_git_ref:
description: 'Git reference (branch or tag)'
required: false
default: ''
docker_file_path:
endorser_agent_docker_file_path:
description: 'Path to Dockerfile'
required: true
default: 'Dockerfile.acapy'
source_context_dir:
endorser_agent_source_context_dir:
description: 'Source context directory for the build'
required: true
default: 'docker/acapy'
source_image_registry:
endorser_agent_source_image_registry:
description: 'Source image registry'
required: false
default: ''
source_image_name:
endorser_agent_source_image_name:
description: 'Source image name'
required: false
default: ''
source_image_tag:
endorser_agent_source_image_tag:
description: 'Source image tag'
required: false
default: ''
registry_username_secret_name:
endorser_agent_registry_username_secret_name:
description: 'Secret name for registry username'
required: false
default: 'ARTIFACTORY_USERNAME'
registry_password_secret_name:
endorser_agent_registry_password_secret_name:
description: 'Secret name for registry password'
required: false
default: 'ARTIFACTORY_PASSWORD'
endorser_db_git_repo_url:
description: 'Git repository URL'
required: true
default: 'hyperledger/aries-endorser-service'
endorser_db_git_ref:
description: 'Git reference (branch or tag)'
required: false
default: ''
endorser_db_docker_file_path:
description: 'Path to Dockerfile'
required: true
default: 'Dockerfile.acapy'
endorser_db_source_context_dir:
description: 'Source context directory for the build'
required: true
default: 'docker/acapy'
endorser_db_source_image_registry:
description: 'Source image registry'
required: false
default: ''
endorser_db_source_image_name:
description: 'Source image name'
required: false
default: ''
endorser_db_source_image_tag:
description: 'Source image tag'
required: false
default: ''
endorser_db_registry_username_secret_name:
description: 'Secret name for registry username'
required: false
default: 'ARTIFACTORY_USERNAME'
endorser_db_registry_password_secret_name:
description: 'Secret name for registry password'
required: false
default: 'ARTIFACTORY_PASSWORD'
endorser_backup_git_repo_url:
description: 'Git repository URL'
required: true
default: 'hyperledger/aries-endorser-service'
endorser_backup_git_ref:
description: 'Git reference (branch or tag)'
required: false
default: ''
endorser_backup_docker_file_path:
description: 'Path to Dockerfile'
required: true
default: 'Dockerfile.acapy'
endorser_backup_source_context_dir:
description: 'Source context directory for the build'
required: true
default: 'docker/acapy'
endorser_backup_source_image_registry:
description: 'Source image registry'
required: false
default: ''
endorser_backup_source_image_name:
description: 'Source image name'
required: false
default: ''
endorser_backup_source_image_tag:
description: 'Source image tag'
required: false
default: ''
endorser_backup_registry_username_secret_name:
description: 'Secret name for registry username'
required: false
default: 'ARTIFACTORY_USERNAME'
endorser_backup_registry_password_secret_name:
description: 'Secret name for registry password'
required: false
default: 'ARTIFACTORY_PASSWORD'
push:
branches:
- enhancement
Expand All @@ -68,7 +139,7 @@ jobs:
matrix:
include:
- service: aries-endorser-agent
GIT_REPO_URL: hyperledger/aries-endorser-service
GIT_REPO_URL: ${{ github.event.inputs.endorser_agent_git_repo_url || 'hyperledger/aries-endorser-service' }}
GIT_REF: ""
DOCKER_FILE_PATH: Dockerfile.acapy # The docker path, file, is the relative path to the docker file from the root of the repo.
SOURCE_CONTEXT_DIR: docker/acapy # The context dir, context, sets the context for the build. i.e. where the build will source files from
Expand Down Expand Up @@ -175,8 +246,9 @@ jobs:
- 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 '/enhancement/d' | sed 's/://g' | tr '\n' ' ')" >> $GITHUB_OUTPUT

run: |
echo "tags=$(echo '${{ steps.meta.outputs.tags }}' | grep -oE ':([^[:space:]]+)' | sed '/enhancement/d' | sed 's/://g' | tr '\n' ' ')" >> $GITHUB_OUTPUT
single_tag=$( cut -d " " -f 1 << "$tags" ) >> $GITHUB_OUTPUT
- name: Pull database image
if: contains(fromJSON('["aries-endorser-db"]'), matrix.service)
run: |
Expand All @@ -198,8 +270,8 @@ jobs:
id: apply_labels
if: contains(fromJSON('["aries-endorser-db"]'), matrix.service)
run: |
echo "FROM "docker tag "${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }}" "${{ matrix.SERVICE }}:${{ steps.extract.outputs.tags }}"
docker push "${{ matrix.SERVICE }}:${{ steps.extract.outputs.tags }}"
echo "FROM ${{ steps.build_image.outputs.image }}:${{ steps.extract.outputs.single_tag }} | --label ca.bc.gov.digitaltrust.build.source-location=${{ github.repositoryUrl }} --label ca.bc.gov.digitaltrust.build.commit.id=${{ github.sha }} -
- name: Push database image
id: push
Expand Down

0 comments on commit 6206666

Please sign in to comment.