Skip to content

Commit

Permalink
test govstack 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Somanath Hugar committed Oct 12, 2023
1 parent 0193b27 commit a55a15d
Show file tree
Hide file tree
Showing 7 changed files with 291 additions and 45 deletions.
Binary file added .DS_Store
Binary file not shown.
223 changes: 219 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,233 @@
version: 2.1
setup: true

orbs:
test-harness: govstack-working-group/testutils@1.0.1
test-harness: govstack-working-group/testutils@1.0.4
aws-eks: circleci/aws-eks@2.2.0
slack: circleci/slack@4.12.5
helm: circleci/helm@2.0.1
kubernetes: circleci/kubernetes@1.3
aws-cli: circleci/aws-cli@4.0.0

jobs:
deploy-g2psandbox-govstack-chart:
docker:
- image: cimg/python:3.10
steps:
- checkout
- aws-cli/setup:
role_arn: "${AWS_CIRCLECI_ROLE_ARN}"
region: AWS_REGION
profile_name: "playground"
role_session_name: deploy-test
session_duration: '1800'
- helm/install-helm-client:
version: "v3.8.2"
- run:
name: Update kubeconfig
command: |
aws eks update-kubeconfig --name ${EKS_CLUSTER}
# Deploy Helm chart to EKS
- run:
name: Deploy Helm chart to EKS
command: |
# Install Helm chart
helm dep up helm/govstack-chart
helm upgrade --install -f helm/govstack-chart/values.yaml g2p-sandbox helm/govstack-chart --create-namespace --namespace paymenthub
# helm upgrade --install g2p-sandbox ./helm/govstack-chart
deploy-fineract-helm-chart:
docker:
- image: cimg/python:3.10
steps:
- checkout
- aws-cli/setup:
role_arn: "${AWS_CIRCLECI_ROLE_ARN}"
region: AWS_REGION
profile_name: "playground"
role_session_name: deploy-test
session_duration: '1800'
- helm/install-helm-client:
version: "v3.8.2"
- run:
name: Update kubeconfig
command: |
aws eks update-kubeconfig --name ${EKS_CLUSTER}
- helm/upgrade-helm-chart:
add-repo: "https://fynarfin.io/images/fineract/"
chart: "https://fynarfin.io/images/fineract/fin-engine-1.1.0-SNAPSHOT.tgz"
release-name: fineract
namespace: fineract
recreate-pods: true
wait: true
timeout: "300s"

create-secret:
docker:
- image: cimg/base:2022.06
steps:
- checkout
# - setup_remote_docker:
# version: 20.10.14
- aws-cli/setup:
role_arn: "${AWS_CIRCLECI_ROLE_ARN}"
region: AWS_REGION
profile_name: "playground"
role_session_name: deploy-test
session_duration: '1800'
- run:
name: Update kubeconfig
command: |
aws eks update-kubeconfig --name ${EKS_CLUSTER}
- kubernetes/install-kubectl
# - aws-eks/update-kubeconfig-with-authenticator:
# cluster-name: "GStack-sb-eks-plg"
# aws-region: "$REGION"
- run: |
cd helm/kibana-secret/
make secrets || echo "kibana" already exists
- run: |
cd helm/es-secret/
make secrets || echo "elastic-certificates" already exists
- run: |
export ENV_NAMESPACE=paymenthub
kubectl delete secret bulk-processor-secret -n $ENV_NAMESPACE || echo "delete the secret if exist"
kubectl create secret generic bulk-processor-secret \
--from-literal=aws-access-key="$S3_ACCESS_KEY_ID" \
--from-literal=aws-secret-key="$S3_SECRET_ACCESS_KEY" -n $ENV_NAMESPACE
# - run: |
# kubectl delete secret bulk-processor-secret -n paymenthub || echo "delete the secret if exist"
# kubectl create secret generic bulk-processor-secret \
# --from-literal=aws-access-key="$S3_ACCESS_KEY_ID" \
# --from-literal=aws-secret-key="$S3_SECRET_ACCESS_KEY" -n paymenthub

deploying-bpmns:
docker:
- image: cimg/base:2022.06
# - image: 'curlimages/curl:8.2.1'
steps:
- checkout
- aws-cli/setup:
role_arn: "${AWS_CIRCLECI_ROLE_ARN}"
region: AWS_REGION
profile_name: "playground"
role_session_name: deploy-test
session_duration: '1800'
- run:
name: Update kubeconfig
command: |
aws eks update-kubeconfig --name ${EKS_CLUSTER}
- run:
name: download and execute the bpmn upload
command: |
curl -o deployBpmn.sh https://raw.githubusercontent.com/openMF/ph-ee-env-labs/master/orchestration/deployBpmn.sh
chmod +x deployBpmn.sh
sh deployBpmn.sh
helm-test:
docker:
- image: cimg/python:3.10
steps:
- checkout
- aws-cli/setup:
role_arn: "${AWS_CIRCLECI_ROLE_ARN}"
region: AWS_REGION
profile_name: "playground"
role_session_name: deploy-test
session_duration: '1800'
- kubernetes/install-kubectl
- run:
name: Update kubeconfig
command: |
aws eks update-kubeconfig --name ${EKS_CLUSTER}
- helm/install-helm-client:
version: "v3.8.2"
- run:
name: Run Helm Tests
command: |
helm test g2p-sandbox --namespace paymenthub || echo test
- run:
name: Fetch Integration Test Report
command: |
#!/bin/bash
mkdir -p integration_report/test-report
kubectl cp paymenthub/`kubectl get pods -n paymenthub | grep g2p-sandbox-test-connection |cut -d " " -f1`:/ph-ee-connector-integration-test/build integration_report/test-report
# Specify the path to the downloaded file
downloaded_file="integration_report/test-report/cucumber.xml"
# Loop until the file is not empty
while [ ! -s $downloaded_file ]; do
echo "File is empty, waiting..."
sleep 60 # You can adjust the sleep interval as needed
kubectl cp paymenthub/`kubectl get pods -n paymenthub | grep g2p-sandbox-test-connection |cut -d " " -f1`:/ph-ee-connector-integration-test/build/ integration_report/test-report
downloaded_file="integration_report/test-report/cucumber.xml "
done
echo "File is no longer empty, processing..."
# kubectl cp paymenthub/`kubectl get pods -n paymenthub | grep g2p-sandbox-test-connection |cut -d " " -f1`:/ph-ee-connector-integration-test/build integration_report/test-report
# - run:
# name: Fetch Integration Test Report
# command: |
# kubectl cp -n $KUBE_NAMESPACE <pod-name>:<path-to-report-file> ./integration_report # Replace <pod-name> and <path-to-report-file>
# - run:
# name: List Contents of Integration Report Directory
# command: |
# ls -l /tmp/integration_report
- store_test_results:
path: integration_report/test-report/cucumber.xml
- store_artifacts:
path: integration_report/test-report/reports/tests/test
# path: integration_report/test-report/reports/tests/test
# - store_test_results:
# path: integration_reports/test-report/cucumber.xml
# - store_artifacts:
# path: ph-ee-integration-test/build/reports/tests/test

workflows:
test_everything:
deploy:
jobs:
- test-harness/create-config:
post-steps: # Persist to workspace has to be defined in main workflow
- persist_to_workspace:
root: workspace
paths:
- generated.yml
context: # CircleCI context containing AWS credentials
- AWS
- playground
- test-harness/execute-tests:
requires:
- test-harness/create-config
- test-harness/create-config
context: # CircleCI context containing AWS credentials
- AWS
- playground
- deploy-g2psandbox-govstack-chart:
context: # CircleCI context containing AWS credentials
- AWS
- playground
- deploy-fineract-helm-chart:
context:
- AWS
- playground
- create-secret:
requires:
- deploy-g2psandbox-govstack-chart
- deploy-fineract-helm-chart
context:
- AWS
- playground
- deploying-bpmns:
requires:
- deploy-g2psandbox-govstack-chart
- deploy-fineract-helm-chart
context:
- AWS
- playground
- helm-test:
requires:
- create-secret
# - deploying-bpmns
context:
- AWS
- playground

5 changes: 4 additions & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,7 @@ your own secrets, then start up via docker compose.
2. `curl -k https://localhost/processes/14`
3. `curl -k -X POST https://localhost/processes/14/start`
4. `curl -k https://localhost/instances`
5. `curl -k https://localhost/instances/12`
5. `curl -k https://localhost/instances/12`

## deployment and config script for govstack BB-payment sandbox
1.
Binary file added helm/.DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion helm/govstack-chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ appVersion: 1.1.0

dependencies:
- name: ph-ee-g2psandbox
repository: https://fynarfin.io/images/ph-ee-g2psandbox-1.2.0
repository: https://fynarfin.io/images/ph-ee-g2psandbox-1.2.0/
version: 1.2.0
14 changes: 8 additions & 6 deletions helm/govstack-chart/config/application-tenants.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
bpmns.tenants[0].id= "lion"
bpmns.tenants[0].flows.payment-transfer= "mock_payment_transfer-{dfspid}"
bpmns.tenants[1].id= "rhino"
bpmns.tenants[1].flows.payment-transfer= "MockPayerFundTransfer-{dfspid}"
bpmns.tenants[2].id= "gorilla"
bpmns.tenants[2].flows.payment-transfer= "PayerFundTransfer-{dfspid}"
bpmns.tenants[0].id= lion
bpmns.tenants[0].flows.payment-transfer= minimal_mock_fund_transfer_account_lookup-{dfspid}
bpmns.tenants[1].id= rhino
bpmns.tenants[1].flows.payment-transfer= minimal_mock_fund_transfer-{dfspid}
bpmns.tenants[1].flows.outbound-transfer-request= minimal_mock_transfer_request-{dfspid}
bpmns.tenants[2].id= gorilla
bpmns.tenants[2].flows.payment-transfer= PayerFundTransfer-{dfspid}
bpmns.tenants[2].flows.outbound-transfer-request= {ps}_flow_{ams}-{dfspid}
Loading

0 comments on commit a55a15d

Please sign in to comment.