From cf13cc80387beff4ea64635db640dd3d7bb57114 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Thu, 5 Oct 2023 19:42:10 +0530 Subject: [PATCH 001/144] test-compliance --- .circleci/config.yml | 230 ++++++++++++++++++++++++- examples/bb-payment/test_entrypoint.sh | 4 + 2 files changed, 229 insertions(+), 5 deletions(-) create mode 100644 examples/bb-payment/test_entrypoint.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index 2e6090f..59e18ca 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,18 +1,238 @@ version: 2.1 setup: true - orbs: 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 -workflows: - test_everything: - jobs: +jobs: + deploy-g2psandbox-govstack-chart: + docker: + - image: cimg/python:3.10 + steps: + - 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} - test-harness/create-config: post-steps: # Persist to workspace has to be defined in main workflow - persist_to_workspace: root: workspace paths: - generated.yml + test-execution: + docker: + - image: cimg/python:3.10 + steps: + - 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} - test-harness/execute-tests: requires: - - test-harness/create-config + - test-harness/create-config + + # 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: sh orchestration/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' + - 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: | + mkdir integration_report + kubectl cp paymenthub/`kubectl get pods -n paymenthub | grep g2p-sandbox-test-connection |cut -d " " -f1`:/ph-ee-connector-integration-test/build/reports/tests/test/ ./integration_report + # - run: + # name: Fetch Integration Test Report + # command: | + # kubectl cp -n $KUBE_NAMESPACE : ./integration_report # Replace and with the actual pod name and path to the report file + - run: + name: List Contents of Integration Report Directory + command: | + ls -l ./integration_report + - store_artifacts: + path: ./integration_report + destination: integration_reports + +workflows: + deploy: + jobs: + # - deploy-g2psandbox-govstack-chart: + # context: # CircleCI context containing AWS credentials + # - AWS + # - playground + # - deploy-fineract-helm-chart: + # context: + # - AWS + # - playground + - deploy-g2psandbox-govstack-chart: + context: + - AWS + - playground + - test-execution: + requires: + - deploy-g2psandbox-govstack-chart + context: + - AWS + - playground + - create-secret: + requires: + - test-execution + context: + - AWS + - playground + - deploying-bpmns: + requires: + - test-execution + context: + - AWS + - playground + - helm-test: + requires: + - create-secret + - deploying-bpmns + context: + - AWS + - playground + diff --git a/examples/bb-payment/test_entrypoint.sh b/examples/bb-payment/test_entrypoint.sh new file mode 100644 index 0000000..b53c481 --- /dev/null +++ b/examples/bb-payment/test_entrypoint.sh @@ -0,0 +1,4 @@ +#!/bin/bash +helm upgrade --install -f helm/govstack-chart/values.yaml g2p-sandbox helm/govstack-chart --create-namespace --namespace paymenthub +helm upgrade -f helm/fineract/values.yaml fineract helm/fineract --install --create-namespace --namespace fineract +# helm test g2p-sandbox -n paymenthub \ No newline at end of file From 39b566823dbcf7abe988f6fa312f7ece99a98bed Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Fri, 20 Oct 2023 12:31:43 +0530 Subject: [PATCH 002/144] helm upgrade through test_entrypoint --- examples/bb-payment/test_entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bb-payment/test_entrypoint.sh b/examples/bb-payment/test_entrypoint.sh index b53c481..f10d31d 100644 --- a/examples/bb-payment/test_entrypoint.sh +++ b/examples/bb-payment/test_entrypoint.sh @@ -1,4 +1,4 @@ #!/bin/bash helm upgrade --install -f helm/govstack-chart/values.yaml g2p-sandbox helm/govstack-chart --create-namespace --namespace paymenthub helm upgrade -f helm/fineract/values.yaml fineract helm/fineract --install --create-namespace --namespace fineract -# helm test g2p-sandbox -n paymenthub \ No newline at end of file +# helm test g2p-sandbox -n paymenthub From b983ff8ffcb6641a710a3658254e9b73dbcd07d6 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Fri, 20 Oct 2023 12:38:58 +0530 Subject: [PATCH 003/144] helm upgrade through test_entrypoint 1 --- .circleci/config.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 59e18ca..dece4ef 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -197,15 +197,7 @@ jobs: workflows: deploy: - jobs: - # - deploy-g2psandbox-govstack-chart: - # context: # CircleCI context containing AWS credentials - # - AWS - # - playground - # - deploy-fineract-helm-chart: - # context: - # - AWS - # - playground + jobs: - deploy-g2psandbox-govstack-chart: context: - AWS @@ -236,3 +228,11 @@ workflows: - AWS - playground + # - deploy-g2psandbox-govstack-chart: + # context: # CircleCI context containing AWS credentials + # - AWS + # - playground + # - deploy-fineract-helm-chart: + # context: + # - AWS + # - playground \ No newline at end of file From a0cb12d599efe6bd0140280be25f4d5d27bc011b Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Fri, 20 Oct 2023 12:42:21 +0530 Subject: [PATCH 004/144] helm upgrade through test_entrypoint 2 --- .circleci/config.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index dece4ef..1dd82cd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -42,7 +42,13 @@ jobs: - run: name: Update kubeconfig command: | - aws eks update-kubeconfig --name ${EKS_CLUSTER} + aws eks update-kubeconfig --name ${EKS_CLUSTER} + - test-harness/create-config: + post-steps: # Persist to workspace has to be defined in main workflow + - persist_to_workspace: + root: workspace + paths: + - generated.yml - test-harness/execute-tests: requires: - test-harness/create-config From 154125511c2bc2955c4e6e9c107c18d2158c5ddf Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Fri, 20 Oct 2023 12:44:34 +0530 Subject: [PATCH 005/144] helm upgrade through test_entrypoint 3 --- .circleci/config.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1dd82cd..1c46c0e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -204,6 +204,21 @@ jobs: workflows: 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 + context: # CircleCI context containing AWS credentials + - AWS + - playground - deploy-g2psandbox-govstack-chart: context: - AWS From 5abdff027596be38a7a46bd52628bde432027f67 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Fri, 20 Oct 2023 12:54:30 +0530 Subject: [PATCH 006/144] helm upgrade through test_entrypoint 4 --- .circleci/config.yml | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1c46c0e..2e07cce 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -23,12 +23,12 @@ jobs: name: Update kubeconfig command: | aws eks update-kubeconfig --name ${EKS_CLUSTER} - - test-harness/create-config: - post-steps: # Persist to workspace has to be defined in main workflow - - persist_to_workspace: - root: workspace - paths: - - generated.yml + # - test-harness/create-config: + # post-steps: # Persist to workspace has to be defined in main workflow + # - persist_to_workspace: + # root: workspace + # paths: + # - generated.yml test-execution: docker: - image: cimg/python:3.10 @@ -204,21 +204,6 @@ jobs: workflows: 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 - context: # CircleCI context containing AWS credentials - - AWS - - playground - deploy-g2psandbox-govstack-chart: context: - AWS From 1172a447d52acf7416c7011ea3a13ebb6f5dc95d Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Fri, 20 Oct 2023 12:55:33 +0530 Subject: [PATCH 007/144] helm upgrade through test_entrypoint 5 --- .circleci/config.yml | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2e07cce..ca31ace 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -43,15 +43,15 @@ jobs: name: Update kubeconfig command: | aws eks update-kubeconfig --name ${EKS_CLUSTER} - - test-harness/create-config: - post-steps: # Persist to workspace has to be defined in main workflow - - persist_to_workspace: - root: workspace - paths: - - generated.yml - - test-harness/execute-tests: - requires: - - test-harness/create-config + # - test-harness/create-config: + # post-steps: # Persist to workspace has to be defined in main workflow + # - persist_to_workspace: + # root: workspace + # paths: + # - generated.yml + # - test-harness/execute-tests: + # requires: + # - test-harness/create-config # deploy-g2psandbox-govstack-chart: # docker: @@ -204,6 +204,15 @@ jobs: workflows: 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 + - test-harness/execute-tests: + requires: + - test-harness/create-config - deploy-g2psandbox-govstack-chart: context: - AWS From 4ee52f41c4600ae2ec8ed20334f591c16dfd23de Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Fri, 20 Oct 2023 15:49:47 +0530 Subject: [PATCH 008/144] helm upgrade through test_entrypoint 6 --- .circleci/config.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index ca31ace..0b79856 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -23,6 +23,10 @@ jobs: name: Update kubeconfig command: | aws eks update-kubeconfig --name ${EKS_CLUSTER} + - run: + name: helm upgrade + command: | + sh "examples/bb-payment/test_entrypoint.sh" # - test-harness/create-config: # post-steps: # Persist to workspace has to be defined in main workflow # - persist_to_workspace: From 6fa2778a381aaea0a977ec3f3f13e33b3d1369d9 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Fri, 20 Oct 2023 15:51:07 +0530 Subject: [PATCH 009/144] helm upgrade through test_entrypoint 7 --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0b79856..1b00ed2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,6 +13,7 @@ jobs: docker: - image: cimg/python:3.10 steps: + - checkout - aws-cli/setup: role_arn: "${AWS_CIRCLECI_ROLE_ARN}" region: AWS_REGION From bc09adccfa7aa8da6a09adf3f81e7d2c07800c2f Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Fri, 20 Oct 2023 15:54:53 +0530 Subject: [PATCH 010/144] helm upgrade through test_entrypoint 8 --- .circleci/config.yml | 24 ++++++++++++------------ examples/bb-payment/test_entrypoint.sh | 1 + 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1b00ed2..b94c53a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -218,25 +218,25 @@ workflows: - test-harness/execute-tests: requires: - test-harness/create-config - - deploy-g2psandbox-govstack-chart: - context: - - AWS - - playground - - test-execution: - requires: - - deploy-g2psandbox-govstack-chart - context: - - AWS - - playground + # - deploy-g2psandbox-govstack-chart: + # context: + # - AWS + # - playground + # - test-execution: + # requires: + # - deploy-g2psandbox-govstack-chart + # context: + # - AWS + # - playground - create-secret: requires: - - test-execution + - test-harness/execute-tests context: - AWS - playground - deploying-bpmns: requires: - - test-execution + - test-harness/execute-tests context: - AWS - playground diff --git a/examples/bb-payment/test_entrypoint.sh b/examples/bb-payment/test_entrypoint.sh index f10d31d..9a344df 100644 --- a/examples/bb-payment/test_entrypoint.sh +++ b/examples/bb-payment/test_entrypoint.sh @@ -1,4 +1,5 @@ #!/bin/bash +sudo apt-get install helm helm upgrade --install -f helm/govstack-chart/values.yaml g2p-sandbox helm/govstack-chart --create-namespace --namespace paymenthub helm upgrade -f helm/fineract/values.yaml fineract helm/fineract --install --create-namespace --namespace fineract # helm test g2p-sandbox -n paymenthub From 3f8bb240462f115a06afffe718cd8196ffcc7bc9 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Fri, 20 Oct 2023 15:59:15 +0530 Subject: [PATCH 011/144] test harness --- .circleci/config.yml | 132 +------------------------------------------ 1 file changed, 1 insertion(+), 131 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b94c53a..f27ee33 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,107 +9,6 @@ orbs: 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' - - run: - name: Update kubeconfig - command: | - aws eks update-kubeconfig --name ${EKS_CLUSTER} - - run: - name: helm upgrade - command: | - sh "examples/bb-payment/test_entrypoint.sh" - # - test-harness/create-config: - # post-steps: # Persist to workspace has to be defined in main workflow - # - persist_to_workspace: - # root: workspace - # paths: - # - generated.yml - test-execution: - docker: - - image: cimg/python:3.10 - steps: - - 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} - # - test-harness/create-config: - # post-steps: # Persist to workspace has to be defined in main workflow - # - persist_to_workspace: - # root: workspace - # paths: - # - generated.yml - # - test-harness/execute-tests: - # requires: - # - test-harness/create-config - - # 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 @@ -144,12 +43,6 @@ jobs: --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 @@ -194,10 +87,6 @@ jobs: command: | mkdir integration_report kubectl cp paymenthub/`kubectl get pods -n paymenthub | grep g2p-sandbox-test-connection |cut -d " " -f1`:/ph-ee-connector-integration-test/build/reports/tests/test/ ./integration_report - # - run: - # name: Fetch Integration Test Report - # command: | - # kubectl cp -n $KUBE_NAMESPACE : ./integration_report # Replace and with the actual pod name and path to the report file - run: name: List Contents of Integration Report Directory command: | @@ -218,16 +107,6 @@ workflows: - test-harness/execute-tests: requires: - test-harness/create-config - # - deploy-g2psandbox-govstack-chart: - # context: - # - AWS - # - playground - # - test-execution: - # requires: - # - deploy-g2psandbox-govstack-chart - # context: - # - AWS - # - playground - create-secret: requires: - test-harness/execute-tests @@ -246,13 +125,4 @@ workflows: - deploying-bpmns context: - AWS - - playground - - # - deploy-g2psandbox-govstack-chart: - # context: # CircleCI context containing AWS credentials - # - AWS - # - playground - # - deploy-fineract-helm-chart: - # context: - # - AWS - # - playground \ No newline at end of file + - playground \ No newline at end of file From bbfb431859db727c2ae9f8af9e107d7e409c0fc0 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Fri, 20 Oct 2023 16:01:07 +0530 Subject: [PATCH 012/144] test harness with helm install --- examples/bb-payment/test_entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bb-payment/test_entrypoint.sh b/examples/bb-payment/test_entrypoint.sh index 9a344df..d530c7c 100644 --- a/examples/bb-payment/test_entrypoint.sh +++ b/examples/bb-payment/test_entrypoint.sh @@ -1,5 +1,5 @@ #!/bin/bash -sudo apt-get install helm +curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash helm upgrade --install -f helm/govstack-chart/values.yaml g2p-sandbox helm/govstack-chart --create-namespace --namespace paymenthub helm upgrade -f helm/fineract/values.yaml fineract helm/fineract --install --create-namespace --namespace fineract # helm test g2p-sandbox -n paymenthub From dfff6ca42e04c3e5afbdb36aaa67e68dc23e25dc Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Fri, 20 Oct 2023 19:51:38 +0530 Subject: [PATCH 013/144] test harness with helm install --- .circleci/config.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index f27ee33..825fc03 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -104,7 +104,22 @@ workflows: root: workspace paths: - generated.yml + - aws-cli/setup: + role_arn: "${AWS_CIRCLECI_ROLE_ARN}" + region: AWS_REGION + profile_name: "playground" + role_session_name: deploy-test + session_duration: '1800' + context: + - AWS + - playground - test-harness/execute-tests: + - aws-cli/setup: + role_arn: "${AWS_CIRCLECI_ROLE_ARN}" + region: AWS_REGION + profile_name: "playground" + role_session_name: deploy-test + session_duration: '1800' requires: - test-harness/create-config - create-secret: From be053e188f54e176991c6255da034de1705539b3 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Thu, 26 Oct 2023 09:27:55 +0530 Subject: [PATCH 014/144] test eks context --- examples/bb-payment/test_entrypoint.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/bb-payment/test_entrypoint.sh b/examples/bb-payment/test_entrypoint.sh index d530c7c..db791c4 100644 --- a/examples/bb-payment/test_entrypoint.sh +++ b/examples/bb-payment/test_entrypoint.sh @@ -1,5 +1,11 @@ #!/bin/bash curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash +- aws-cli/setup: + role_arn: "${AWS_CIRCLECI_ROLE_ARN}" + region: AWS_REGION + profile_name: "playground" + role_session_name: deploy-test + session_duration: '1800' helm upgrade --install -f helm/govstack-chart/values.yaml g2p-sandbox helm/govstack-chart --create-namespace --namespace paymenthub helm upgrade -f helm/fineract/values.yaml fineract helm/fineract --install --create-namespace --namespace fineract # helm test g2p-sandbox -n paymenthub From 7a9e8afe4168335628aaf89cd95542b4f7c09544 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Thu, 26 Oct 2023 09:29:30 +0530 Subject: [PATCH 015/144] test eks context --- .circleci/config.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 825fc03..70a29b5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -114,12 +114,6 @@ workflows: - AWS - playground - test-harness/execute-tests: - - aws-cli/setup: - role_arn: "${AWS_CIRCLECI_ROLE_ARN}" - region: AWS_REGION - profile_name: "playground" - role_session_name: deploy-test - session_duration: '1800' requires: - test-harness/create-config - create-secret: From 0fcdfb5bf6815bd71bd7ea76ff97fa5ffb9de8cb Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Thu, 26 Oct 2023 11:07:48 +0530 Subject: [PATCH 016/144] test eks context --- examples/bb-payment/test_entrypoint.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/bb-payment/test_entrypoint.sh b/examples/bb-payment/test_entrypoint.sh index db791c4..24fa47c 100644 --- a/examples/bb-payment/test_entrypoint.sh +++ b/examples/bb-payment/test_entrypoint.sh @@ -1,7 +1,10 @@ #!/bin/bash curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash +curl "https://d1vvhvl2y92vvt.cloudfront.net/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" +unzip awscliv2.zip +sudo ./aws/install - aws-cli/setup: - role_arn: "${AWS_CIRCLECI_ROLE_ARN}" + role_arn: "arn:aws:iam::161826879607:role/EXT-mifosGroupIAMRole" region: AWS_REGION profile_name: "playground" role_session_name: deploy-test From daa1211b0726430a83a86f3df80f812423a3e9ce Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Thu, 26 Oct 2023 11:09:21 +0530 Subject: [PATCH 017/144] test eks context --- examples/bb-payment/test_entrypoint.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/examples/bb-payment/test_entrypoint.sh b/examples/bb-payment/test_entrypoint.sh index 24fa47c..2cf73f3 100644 --- a/examples/bb-payment/test_entrypoint.sh +++ b/examples/bb-payment/test_entrypoint.sh @@ -3,12 +3,11 @@ curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bas curl "https://d1vvhvl2y92vvt.cloudfront.net/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" unzip awscliv2.zip sudo ./aws/install -- aws-cli/setup: - role_arn: "arn:aws:iam::161826879607:role/EXT-mifosGroupIAMRole" - region: AWS_REGION - profile_name: "playground" - role_session_name: deploy-test - session_duration: '1800' +role_arn: "arn:aws:iam::161826879607:role/EXT-mifosGroupIAMRole" +region: AWS_REGION +profile_name: "playground" +role_session_name: deploy-test +session_duration: '1800' helm upgrade --install -f helm/govstack-chart/values.yaml g2p-sandbox helm/govstack-chart --create-namespace --namespace paymenthub helm upgrade -f helm/fineract/values.yaml fineract helm/fineract --install --create-namespace --namespace fineract # helm test g2p-sandbox -n paymenthub From cc2839213fe29a514964839ad0dee2c556c82993 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Thu, 26 Oct 2023 13:25:49 +0530 Subject: [PATCH 018/144] test eks context --- examples/bb-payment/test_entrypoint.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/bb-payment/test_entrypoint.sh b/examples/bb-payment/test_entrypoint.sh index 2cf73f3..4421e8b 100644 --- a/examples/bb-payment/test_entrypoint.sh +++ b/examples/bb-payment/test_entrypoint.sh @@ -3,11 +3,11 @@ curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bas curl "https://d1vvhvl2y92vvt.cloudfront.net/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" unzip awscliv2.zip sudo ./aws/install -role_arn: "arn:aws:iam::161826879607:role/EXT-mifosGroupIAMRole" -region: AWS_REGION -profile_name: "playground" -role_session_name: deploy-test -session_duration: '1800' +# role_arn: "arn:aws:iam::161826879607:role/EXT-mifosGroupIAMRole" +# region: AWS_REGION +# profile_name: "playground" +# role_session_name: deploy-test +# session_duration: '1800' helm upgrade --install -f helm/govstack-chart/values.yaml g2p-sandbox helm/govstack-chart --create-namespace --namespace paymenthub helm upgrade -f helm/fineract/values.yaml fineract helm/fineract --install --create-namespace --namespace fineract # helm test g2p-sandbox -n paymenthub From ed86bd9842866bfb48b3a6329ced259d90e29a3c Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Thu, 26 Oct 2023 17:01:43 +0530 Subject: [PATCH 019/144] test eks context --- examples/bb-payment/test_entrypoint.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/examples/bb-payment/test_entrypoint.sh b/examples/bb-payment/test_entrypoint.sh index 4421e8b..315bd77 100644 --- a/examples/bb-payment/test_entrypoint.sh +++ b/examples/bb-payment/test_entrypoint.sh @@ -3,11 +3,16 @@ curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bas curl "https://d1vvhvl2y92vvt.cloudfront.net/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" unzip awscliv2.zip sudo ./aws/install -# role_arn: "arn:aws:iam::161826879607:role/EXT-mifosGroupIAMRole" -# region: AWS_REGION -# profile_name: "playground" -# role_session_name: deploy-test -# session_duration: '1800' +# Access environment variables from the context +AWS_ROLE_ARN="${AWS_CIRCLECI_ROLE_ARN}" +AWS_REGION="${AWS_REGION}" + +# Set AWS CLI configuration +aws configure set aws_access_key_id "$AWS_ACCESS_KEY_ID" +aws configure set aws_secret_access_key "$AWS_SECRET_ACCESS_KEY" +aws configure set aws_session_token "$AWS_SESSION_TOKEN" +aws configure set default.region "$AWS_REGION" + helm upgrade --install -f helm/govstack-chart/values.yaml g2p-sandbox helm/govstack-chart --create-namespace --namespace paymenthub helm upgrade -f helm/fineract/values.yaml fineract helm/fineract --install --create-namespace --namespace fineract # helm test g2p-sandbox -n paymenthub From 9a22e43b36189127639597ea7ec46ef8d8b9a5cf Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Thu, 26 Oct 2023 17:04:34 +0530 Subject: [PATCH 020/144] test eks context --- examples/bb-payment/test_entrypoint.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/bb-payment/test_entrypoint.sh b/examples/bb-payment/test_entrypoint.sh index 315bd77..3b6715d 100644 --- a/examples/bb-payment/test_entrypoint.sh +++ b/examples/bb-payment/test_entrypoint.sh @@ -1,8 +1,8 @@ #!/bin/bash curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash -curl "https://d1vvhvl2y92vvt.cloudfront.net/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" -unzip awscliv2.zip -sudo ./aws/install +# curl "https://d1vvhvl2y92vvt.cloudfront.net/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" +# unzip awscliv2.zip +# sudo ./aws/install # Access environment variables from the context AWS_ROLE_ARN="${AWS_CIRCLECI_ROLE_ARN}" AWS_REGION="${AWS_REGION}" From 6d0e90ebf9e862bb67817bbde33a4b37ca6e2485 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Thu, 26 Oct 2023 19:32:01 +0530 Subject: [PATCH 021/144] test eks context --- examples/bb-payment/test_entrypoint.sh | 41 ++++++++++++++++++-------- 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/examples/bb-payment/test_entrypoint.sh b/examples/bb-payment/test_entrypoint.sh index 3b6715d..8e602eb 100644 --- a/examples/bb-payment/test_entrypoint.sh +++ b/examples/bb-payment/test_entrypoint.sh @@ -1,17 +1,34 @@ #!/bin/bash curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash -# curl "https://d1vvhvl2y92vvt.cloudfront.net/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" -# unzip awscliv2.zip -# sudo ./aws/install -# Access environment variables from the context -AWS_ROLE_ARN="${AWS_CIRCLECI_ROLE_ARN}" -AWS_REGION="${AWS_REGION}" - -# Set AWS CLI configuration -aws configure set aws_access_key_id "$AWS_ACCESS_KEY_ID" -aws configure set aws_secret_access_key "$AWS_SECRET_ACCESS_KEY" -aws configure set aws_session_token "$AWS_SESSION_TOKEN" -aws configure set default.region "$AWS_REGION" + +# # Access environment variables from the CircleCI context +# AWS_ROLE_ARN="${AWS_CIRCLECI_ROLE_ARN}" +# AWS_REGION="${AWS_REGION}" + +# # Set AWS CLI configuration +# aws configure set aws_access_key_id "$AWS_ACCESS_KEY_ID" +# aws configure set aws_secret_access_key "$AWS_SECRET_ACCESS_KEY" +# aws configure set aws_session_token "$AWS_SESSION_TOKEN" +# aws configure set default.region "$AWS_REGION" + +# Set your AWS credentials and AWS CLI configuration +AWS_CIRCLECI_ROLE_ARN="your-role-arn" +AWS_REGION="your-aws-region" +EKS_CLUSTER="your-eks-cluster" + +# Assume the specified AWS IAM role +aws sts assume-role --role-arn "$AWS_CIRCLECI_ROLE_ARN" --role-session-name deploy-test --duration-seconds 1800 > assumed-roles.json + +# Extract the temporary credentials from the assumed role response +export AWS_ACCESS_KEY_ID=$(jq -r .Credentials.AccessKeyId assumed-roles.json) +export AWS_SECRET_ACCESS_KEY=$(jq -r .Credentials.SecretAccessKey assumed-roles.json) +export AWS_SESSION_TOKEN=$(jq -r .Credentials.SessionToken assumed-roles.json) + +# Update the kubeconfig for the specified EKS cluster +aws eks update-kubeconfig --name "$EKS_CLUSTER" --region "$AWS_REGION" --profile playground + +# Clean up temporary role assumption file +rm assumed-roles.json helm upgrade --install -f helm/govstack-chart/values.yaml g2p-sandbox helm/govstack-chart --create-namespace --namespace paymenthub helm upgrade -f helm/fineract/values.yaml fineract helm/fineract --install --create-namespace --namespace fineract From 5202f1153faef47dfd62d5eba6520848c5a06c6f Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Fri, 27 Oct 2023 16:41:46 +0530 Subject: [PATCH 022/144] test eks context --- examples/bb-payment/test_entrypoint.sh | 35 ------------------ examples/bb-payments/test_entrypoint.sh | 48 +++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 35 deletions(-) delete mode 100644 examples/bb-payment/test_entrypoint.sh create mode 100644 examples/bb-payments/test_entrypoint.sh diff --git a/examples/bb-payment/test_entrypoint.sh b/examples/bb-payment/test_entrypoint.sh deleted file mode 100644 index 8e602eb..0000000 --- a/examples/bb-payment/test_entrypoint.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash - -# # Access environment variables from the CircleCI context -# AWS_ROLE_ARN="${AWS_CIRCLECI_ROLE_ARN}" -# AWS_REGION="${AWS_REGION}" - -# # Set AWS CLI configuration -# aws configure set aws_access_key_id "$AWS_ACCESS_KEY_ID" -# aws configure set aws_secret_access_key "$AWS_SECRET_ACCESS_KEY" -# aws configure set aws_session_token "$AWS_SESSION_TOKEN" -# aws configure set default.region "$AWS_REGION" - -# Set your AWS credentials and AWS CLI configuration -AWS_CIRCLECI_ROLE_ARN="your-role-arn" -AWS_REGION="your-aws-region" -EKS_CLUSTER="your-eks-cluster" - -# Assume the specified AWS IAM role -aws sts assume-role --role-arn "$AWS_CIRCLECI_ROLE_ARN" --role-session-name deploy-test --duration-seconds 1800 > assumed-roles.json - -# Extract the temporary credentials from the assumed role response -export AWS_ACCESS_KEY_ID=$(jq -r .Credentials.AccessKeyId assumed-roles.json) -export AWS_SECRET_ACCESS_KEY=$(jq -r .Credentials.SecretAccessKey assumed-roles.json) -export AWS_SESSION_TOKEN=$(jq -r .Credentials.SessionToken assumed-roles.json) - -# Update the kubeconfig for the specified EKS cluster -aws eks update-kubeconfig --name "$EKS_CLUSTER" --region "$AWS_REGION" --profile playground - -# Clean up temporary role assumption file -rm assumed-roles.json - -helm upgrade --install -f helm/govstack-chart/values.yaml g2p-sandbox helm/govstack-chart --create-namespace --namespace paymenthub -helm upgrade -f helm/fineract/values.yaml fineract helm/fineract --install --create-namespace --namespace fineract -# helm test g2p-sandbox -n paymenthub diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh new file mode 100644 index 0000000..b175df6 --- /dev/null +++ b/examples/bb-payments/test_entrypoint.sh @@ -0,0 +1,48 @@ +#!/bin/bash +curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash + +# Authenticate with your CircleCI organization +circleci setup + +# Retrieve the context values +CONTEXT_NAME="playground" +CONTEXT_JSON=$(circleci context show --json "$CONTEXT_NAME") + +# Extract specific values (e.g., AWS_ACCESS_KEY_ID) +AWS_ACCESS_KEY_ID=$(echo "$CONTEXT_JSON" | jq -r .AWS_ACCESS_KEY_ID) + +# Use the values in your external shell script +echo "AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID" + +# # Access environment variables from the CircleCI context +# AWS_ROLE_ARN="${AWS_CIRCLECI_ROLE_ARN}" +# AWS_REGION="${AWS_REGION}" + +# # Set AWS CLI configuration +# aws configure set aws_access_key_id "$AWS_ACCESS_KEY_ID" +# aws configure set aws_secret_access_key "$AWS_SECRET_ACCESS_KEY" +# aws configure set aws_session_token "$AWS_SESSION_TOKEN" +# aws configure set default.region "$AWS_REGION" + +# # Set your AWS credentials and AWS CLI configuration +# AWS_CIRCLECI_ROLE_ARN="your-role-arn" +# AWS_REGION="your-aws-region" +# EKS_CLUSTER="your-eks-cluster" + +# # Assume the specified AWS IAM role +# aws sts assume-role --role-arn "$AWS_CIRCLECI_ROLE_ARN" --role-session-name deploy-test --duration-seconds 1800 > assumed-roles.json + +# # Extract the temporary credentials from the assumed role response +# export AWS_ACCESS_KEY_ID=$(jq -r .Credentials.AccessKeyId assumed-roles.json) +# export AWS_SECRET_ACCESS_KEY=$(jq -r .Credentials.SecretAccessKey assumed-roles.json) +# export AWS_SESSION_TOKEN=$(jq -r .Credentials.SessionToken assumed-roles.json) + +# # Update the kubeconfig for the specified EKS cluster +# aws eks update-kubeconfig --name "$EKS_CLUSTER" --region "$AWS_REGION" --profile playground + +# # Clean up temporary role assumption file +# rm assumed-roles.json + +helm upgrade --install -f helm/govstack-chart/values.yaml g2p-sandbox helm/govstack-chart --create-namespace --namespace paymenthub +helm upgrade -f helm/fineract/values.yaml fineract helm/fineract --install --create-namespace --namespace fineract +# helm test g2p-sandbox -n paymenthub From 9f7d5388bc4d54c045c867f59d8d22f586b56541 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Fri, 27 Oct 2023 16:45:18 +0530 Subject: [PATCH 023/144] test eks context --- examples/bb-payments/test_entrypoint.sh | 31 +++++++------------------ 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index b175df6..c6753f3 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -1,28 +1,15 @@ #!/bin/bash curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash -# Authenticate with your CircleCI organization -circleci setup - -# Retrieve the context values -CONTEXT_NAME="playground" -CONTEXT_JSON=$(circleci context show --json "$CONTEXT_NAME") - -# Extract specific values (e.g., AWS_ACCESS_KEY_ID) -AWS_ACCESS_KEY_ID=$(echo "$CONTEXT_JSON" | jq -r .AWS_ACCESS_KEY_ID) - -# Use the values in your external shell script -echo "AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID" - -# # Access environment variables from the CircleCI context -# AWS_ROLE_ARN="${AWS_CIRCLECI_ROLE_ARN}" -# AWS_REGION="${AWS_REGION}" - -# # Set AWS CLI configuration -# aws configure set aws_access_key_id "$AWS_ACCESS_KEY_ID" -# aws configure set aws_secret_access_key "$AWS_SECRET_ACCESS_KEY" -# aws configure set aws_session_token "$AWS_SESSION_TOKEN" -# aws configure set default.region "$AWS_REGION" +# Access environment variables from the CircleCI context +AWS_ROLE_ARN="${AWS_CIRCLECI_ROLE_ARN}" +AWS_REGION="${AWS_REGION}" + +# Set AWS CLI configuration +aws configure set aws_access_key_id "$AWS_ACCESS_KEY_ID" +aws configure set aws_secret_access_key "$AWS_SECRET_ACCESS_KEY" +aws configure set aws_session_token "$AWS_SESSION_TOKEN" +aws configure set default.region "$AWS_REGION" # # Set your AWS credentials and AWS CLI configuration # AWS_CIRCLECI_ROLE_ARN="your-role-arn" From bc7f2a3d8a4006d870e5ec8013f594206741232c Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Fri, 27 Oct 2023 16:50:04 +0530 Subject: [PATCH 024/144] test eks context --- examples/bb-payments/test_entrypoint.sh | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index c6753f3..936df26 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -1,15 +1,15 @@ #!/bin/bash curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash -# Access environment variables from the CircleCI context -AWS_ROLE_ARN="${AWS_CIRCLECI_ROLE_ARN}" -AWS_REGION="${AWS_REGION}" +# # Access environment variables from the CircleCI context +# AWS_ROLE_ARN="${AWS_CIRCLECI_ROLE_ARN}" +# AWS_REGION="${AWS_REGION}" -# Set AWS CLI configuration -aws configure set aws_access_key_id "$AWS_ACCESS_KEY_ID" -aws configure set aws_secret_access_key "$AWS_SECRET_ACCESS_KEY" -aws configure set aws_session_token "$AWS_SESSION_TOKEN" -aws configure set default.region "$AWS_REGION" +# # Set AWS CLI configuration +# aws configure set aws_access_key_id "$AWS_ACCESS_KEY_ID" +# aws configure set aws_secret_access_key "$AWS_SECRET_ACCESS_KEY" +# aws configure set aws_session_token "$AWS_SESSION_TOKEN" +# aws configure set default.region "$AWS_REGION" # # Set your AWS credentials and AWS CLI configuration # AWS_CIRCLECI_ROLE_ARN="your-role-arn" @@ -30,6 +30,7 @@ aws configure set default.region "$AWS_REGION" # # Clean up temporary role assumption file # rm assumed-roles.json +aws eks update-kubeconfig --name GStack-sb-eks-plg helm upgrade --install -f helm/govstack-chart/values.yaml g2p-sandbox helm/govstack-chart --create-namespace --namespace paymenthub helm upgrade -f helm/fineract/values.yaml fineract helm/fineract --install --create-namespace --namespace fineract # helm test g2p-sandbox -n paymenthub From 5b5d4b50d1e76c2bf0d2e671782ab90f188481b9 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Fri, 27 Oct 2023 18:17:25 +0530 Subject: [PATCH 025/144] test eks context --- examples/bb-payments/test_entrypoint.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 936df26..8031b09 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -29,7 +29,9 @@ curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bas # # Clean up temporary role assumption file # rm assumed-roles.json - +# Access environment variables from CircleCI context directly +AWS_ROLE_ARN=arn:aws:iam::161826879607:role/EXT-mifosGroupIAMRole +AWS_REGION=eu-central-1 aws eks update-kubeconfig --name GStack-sb-eks-plg helm upgrade --install -f helm/govstack-chart/values.yaml g2p-sandbox helm/govstack-chart --create-namespace --namespace paymenthub helm upgrade -f helm/fineract/values.yaml fineract helm/fineract --install --create-namespace --namespace fineract From f36366aee1862770e29d92bd0d1672d640f938f0 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Fri, 27 Oct 2023 18:21:52 +0530 Subject: [PATCH 026/144] test eks context --- examples/bb-payments/test_entrypoint.sh | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 8031b09..5cce061 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -16,22 +16,9 @@ curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bas # AWS_REGION="your-aws-region" # EKS_CLUSTER="your-eks-cluster" -# # Assume the specified AWS IAM role -# aws sts assume-role --role-arn "$AWS_CIRCLECI_ROLE_ARN" --role-session-name deploy-test --duration-seconds 1800 > assumed-roles.json - -# # Extract the temporary credentials from the assumed role response -# export AWS_ACCESS_KEY_ID=$(jq -r .Credentials.AccessKeyId assumed-roles.json) -# export AWS_SECRET_ACCESS_KEY=$(jq -r .Credentials.SecretAccessKey assumed-roles.json) -# export AWS_SESSION_TOKEN=$(jq -r .Credentials.SessionToken assumed-roles.json) - -# # Update the kubeconfig for the specified EKS cluster -# aws eks update-kubeconfig --name "$EKS_CLUSTER" --region "$AWS_REGION" --profile playground - -# # Clean up temporary role assumption file -# rm assumed-roles.json # Access environment variables from CircleCI context directly -AWS_ROLE_ARN=arn:aws:iam::161826879607:role/EXT-mifosGroupIAMRole -AWS_REGION=eu-central-1 +AWS_ROLE_ARN=$AWS_CIRCLECI_ROLE_ARN +AWS_REGION=$AWS_REGION aws eks update-kubeconfig --name GStack-sb-eks-plg helm upgrade --install -f helm/govstack-chart/values.yaml g2p-sandbox helm/govstack-chart --create-namespace --namespace paymenthub helm upgrade -f helm/fineract/values.yaml fineract helm/fineract --install --create-namespace --namespace fineract From 8c24442fd0c30e73aec03e9358e60e8ad1715fa2 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Fri, 27 Oct 2023 18:38:53 +0530 Subject: [PATCH 027/144] test eks context --- examples/bb-payments/test_entrypoint.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 5cce061..87dae40 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -17,8 +17,15 @@ curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bas # EKS_CLUSTER="your-eks-cluster" # Access environment variables from CircleCI context directly -AWS_ROLE_ARN=$AWS_CIRCLECI_ROLE_ARN -AWS_REGION=$AWS_REGION +AWS_ROLE_ARN=$(circleci context show my-context --environment | grep VAR1= | cut -d'=' -f2) +AWS_REGION=$(circleci context show my-context --environment | grep VAR2= | cut -d'=' -f2) + +# Use the variables in your script +echo "AWS_ROLE_ARN: $AWS_ROLE_ARN" +echo "AWS_REGION: $AWS_REGION" + +# AWS_ROLE_ARN=$AWS_CIRCLECI_ROLE_ARN +# AWS_REGION=$AWS_REGION aws eks update-kubeconfig --name GStack-sb-eks-plg helm upgrade --install -f helm/govstack-chart/values.yaml g2p-sandbox helm/govstack-chart --create-namespace --namespace paymenthub helm upgrade -f helm/fineract/values.yaml fineract helm/fineract --install --create-namespace --namespace fineract From 403e5cd2c044822b5945f05e32824781a5fbddaf Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Fri, 27 Oct 2023 18:50:35 +0530 Subject: [PATCH 028/144] test eks context --- examples/bb-payments/test_entrypoint.sh | 40 ++++++++++++++++++++----- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 87dae40..24c41ec 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -11,21 +11,45 @@ curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bas # aws configure set aws_session_token "$AWS_SESSION_TOKEN" # aws configure set default.region "$AWS_REGION" -# # Set your AWS credentials and AWS CLI configuration +# Set your AWS credentials and AWS CLI configuration # AWS_CIRCLECI_ROLE_ARN="your-role-arn" # AWS_REGION="your-aws-region" # EKS_CLUSTER="your-eks-cluster" # Access environment variables from CircleCI context directly -AWS_ROLE_ARN=$(circleci context show my-context --environment | grep VAR1= | cut -d'=' -f2) -AWS_REGION=$(circleci context show my-context --environment | grep VAR2= | cut -d'=' -f2) +# AWS_ROLE_ARN=$(circleci context show my-context --environment | grep VAR1= | cut -d'=' -f2) +# AWS_REGION=$(circleci context show my-context --environment | grep VAR2= | cut -d'=' -f2) -# Use the variables in your script -echo "AWS_ROLE_ARN: $AWS_ROLE_ARN" -echo "AWS_REGION: $AWS_REGION" +# # Use the variables in your script +# echo "AWS_ROLE_ARN: $AWS_ROLE_ARN" +# echo "AWS_REGION: $AWS_REGION" + +# # AWS_ROLE_ARN=$AWS_CIRCLECI_ROLE_ARN +# # AWS_REGION=$AWS_REGION + +# Define your MFA configuration +MFA_DEVICE="arn:aws:iam::161826879607:user/somanath@fynarfin.io" +AWS_PROFILE="somanath@fynarfin.io" + +# Prompt for MFA token +MFA_TOKEN=$(zenity --entry --text="Enter your MFA token:" --title="MFA Authentication") + +# Use AWS CLI to assume a role with MFA +aws sts assume-role \ + --role-arn "arn:aws:iam::123456789012:role/your-role-name" \ + --role-session-name "your-session-name" \ + --serial-number "$MFA_DEVICE" \ + --token-code "$MFA_TOKEN" \ + --profile "$AWS_PROFILE" + +if [ $? -eq 0 ]; then + zenity --info --text="MFA authentication successful" --title="Authentication Result" + # You can perform your AWS operations here +else + zenity --error --text="MFA authentication failed" --title="Authentication Result" + exit 1 +fi -# AWS_ROLE_ARN=$AWS_CIRCLECI_ROLE_ARN -# AWS_REGION=$AWS_REGION aws eks update-kubeconfig --name GStack-sb-eks-plg helm upgrade --install -f helm/govstack-chart/values.yaml g2p-sandbox helm/govstack-chart --create-namespace --namespace paymenthub helm upgrade -f helm/fineract/values.yaml fineract helm/fineract --install --create-namespace --namespace fineract From 81dac5a50802cbcbab53bacbdc3790adb1de045e Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Fri, 27 Oct 2023 18:52:34 +0530 Subject: [PATCH 029/144] test eks context --- examples/bb-payments/test_entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 24c41ec..51d2241 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -30,7 +30,7 @@ curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bas # Define your MFA configuration MFA_DEVICE="arn:aws:iam::161826879607:user/somanath@fynarfin.io" AWS_PROFILE="somanath@fynarfin.io" - +sudo apt-get install zenity # Prompt for MFA token MFA_TOKEN=$(zenity --entry --text="Enter your MFA token:" --title="MFA Authentication") From 8e4dcd5be21cbc2214da35f5cffbd6dbf26c5963 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Fri, 27 Oct 2023 19:02:17 +0530 Subject: [PATCH 030/144] test eks context --- examples/bb-payments/test_entrypoint.sh | 39 +++---------------------- 1 file changed, 4 insertions(+), 35 deletions(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 51d2241..a0d75b7 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -11,44 +11,13 @@ curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bas # aws configure set aws_session_token "$AWS_SESSION_TOKEN" # aws configure set default.region "$AWS_REGION" -# Set your AWS credentials and AWS CLI configuration -# AWS_CIRCLECI_ROLE_ARN="your-role-arn" -# AWS_REGION="your-aws-region" -# EKS_CLUSTER="your-eks-cluster" - -# Access environment variables from CircleCI context directly -# AWS_ROLE_ARN=$(circleci context show my-context --environment | grep VAR1= | cut -d'=' -f2) -# AWS_REGION=$(circleci context show my-context --environment | grep VAR2= | cut -d'=' -f2) - # # Use the variables in your script # echo "AWS_ROLE_ARN: $AWS_ROLE_ARN" # echo "AWS_REGION: $AWS_REGION" - -# # AWS_ROLE_ARN=$AWS_CIRCLECI_ROLE_ARN -# # AWS_REGION=$AWS_REGION - -# Define your MFA configuration -MFA_DEVICE="arn:aws:iam::161826879607:user/somanath@fynarfin.io" -AWS_PROFILE="somanath@fynarfin.io" -sudo apt-get install zenity -# Prompt for MFA token -MFA_TOKEN=$(zenity --entry --text="Enter your MFA token:" --title="MFA Authentication") - -# Use AWS CLI to assume a role with MFA -aws sts assume-role \ - --role-arn "arn:aws:iam::123456789012:role/your-role-name" \ - --role-session-name "your-session-name" \ - --serial-number "$MFA_DEVICE" \ - --token-code "$MFA_TOKEN" \ - --profile "$AWS_PROFILE" - -if [ $? -eq 0 ]; then - zenity --info --text="MFA authentication successful" --title="Authentication Result" - # You can perform your AWS operations here -else - zenity --error --text="MFA authentication failed" --title="Authentication Result" - exit 1 -fi +export AWS_CIRCLECI_ROLE_ARN=$AWS_CIRCLECI_ROLE_ARN +export AWS_REGION=$AWS_REGION +AWS_ROLE_ARN=$AWS_CIRCLECI_ROLE_ARN +AWS_REGION=$AWS_REGION aws eks update-kubeconfig --name GStack-sb-eks-plg helm upgrade --install -f helm/govstack-chart/values.yaml g2p-sandbox helm/govstack-chart --create-namespace --namespace paymenthub From 2d9df80178ec4e7c8613ace8d4b3a7c9bedcc023 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Fri, 27 Oct 2023 19:03:38 +0530 Subject: [PATCH 031/144] test eks context --- examples/bb-payments/test_entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index a0d75b7..962d552 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -19,7 +19,7 @@ export AWS_REGION=$AWS_REGION AWS_ROLE_ARN=$AWS_CIRCLECI_ROLE_ARN AWS_REGION=$AWS_REGION -aws eks update-kubeconfig --name GStack-sb-eks-plg +# aws eks update-kubeconfig --name GStack-sb-eks-plg helm upgrade --install -f helm/govstack-chart/values.yaml g2p-sandbox helm/govstack-chart --create-namespace --namespace paymenthub helm upgrade -f helm/fineract/values.yaml fineract helm/fineract --install --create-namespace --namespace fineract # helm test g2p-sandbox -n paymenthub From 508ad6d462129933caa51e2632cb11e26ebd3b65 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Mon, 30 Oct 2023 12:29:12 +0530 Subject: [PATCH 032/144] test with exporting the secrets --- examples/bb-payments/test_entrypoint.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 962d552..f412d45 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -14,12 +14,13 @@ curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bas # # Use the variables in your script # echo "AWS_ROLE_ARN: $AWS_ROLE_ARN" # echo "AWS_REGION: $AWS_REGION" -export AWS_CIRCLECI_ROLE_ARN=$AWS_CIRCLECI_ROLE_ARN -export AWS_REGION=$AWS_REGION -AWS_ROLE_ARN=$AWS_CIRCLECI_ROLE_ARN -AWS_REGION=$AWS_REGION -# aws eks update-kubeconfig --name GStack-sb-eks-plg +export AWS_CIRCLECI_ROLE_ARN= $AWS_CIRCLECI_ROLE_ARN +export AWS_ACCESS_KEY_ID= $AWS_ACCESS_KEY_ID +export AWS_SECRET_ACCESS_KEY= $AWS_SECRET_ACCESS_KEY +export AWS_DEFAULT_REGION= $AWS_REGION + +aws eks update-kubeconfig --name GStack-sb-eks-plg helm upgrade --install -f helm/govstack-chart/values.yaml g2p-sandbox helm/govstack-chart --create-namespace --namespace paymenthub helm upgrade -f helm/fineract/values.yaml fineract helm/fineract --install --create-namespace --namespace fineract # helm test g2p-sandbox -n paymenthub From 4007d114c1e1fe7b9d95a9d29aff55353cb8ec34 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Mon, 30 Oct 2023 12:32:38 +0530 Subject: [PATCH 033/144] test with exporting the secrets --- examples/bb-payments/test_entrypoint.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index f412d45..a97c5e0 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -15,10 +15,15 @@ curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bas # echo "AWS_ROLE_ARN: $AWS_ROLE_ARN" # echo "AWS_REGION: $AWS_REGION" -export AWS_CIRCLECI_ROLE_ARN= $AWS_CIRCLECI_ROLE_ARN -export AWS_ACCESS_KEY_ID= $AWS_ACCESS_KEY_ID -export AWS_SECRET_ACCESS_KEY= $AWS_SECRET_ACCESS_KEY -export AWS_DEFAULT_REGION= $AWS_REGION + +# export AWS_CIRCLECI_ROLE_ARN= $AWS_CIRCLECI_ROLE_ARN +# export AWS_ACCESS_KEY_ID= $AWS_ACCESS_KEY_ID +# export AWS_SECRET_ACCESS_KEY= $AWS_SECRET_ACCESS_KEY +# export AWS_DEFAULT_REGION= $AWS_REGION + +aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID +aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY +aws configure set region $AWS_REGION aws eks update-kubeconfig --name GStack-sb-eks-plg helm upgrade --install -f helm/govstack-chart/values.yaml g2p-sandbox helm/govstack-chart --create-namespace --namespace paymenthub From b1cca168762c0d4c232e82892fb73dc2e719c279 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Mon, 30 Oct 2023 12:49:41 +0530 Subject: [PATCH 034/144] test with orb varain=ble --- examples/bb-payments/test_entrypoint.sh | 44 ++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index a97c5e0..1c7b010 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -20,10 +20,46 @@ curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bas # export AWS_ACCESS_KEY_ID= $AWS_ACCESS_KEY_ID # export AWS_SECRET_ACCESS_KEY= $AWS_SECRET_ACCESS_KEY # export AWS_DEFAULT_REGION= $AWS_REGION - -aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID -aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY -aws configure set region $AWS_REGION +ORB_EVAL_ROLE_SESSION_NAME=$(circleci env subst "${ORB_EVAL_ROLE_SESSION_NAME}") +ORB_EVAL_ROLE_ARN=$(circleci env subst "${ORB_EVAL_ROLE_ARN}") +ORB_EVAL_PROFILE_NAME=$(circleci env subst "$ORB_EVAL_PROFILE_NAME") + +if [ -z "${ORB_EVAL_ROLE_SESSION_NAME}" ]; then + echo "Role session name is required" + exit 1 +fi + +if [ -z "${CIRCLE_OIDC_TOKEN_V2}" ]; then + echo "OIDC Token cannot be found. A CircleCI context must be specified." + exit 1 +fi + +if [ ! "$(command -v aws)" ]; then + echo "AWS CLI is not installed. Please run the setup or install command first." + exit 1 +fi + +read -r AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN <>"$BASH_ENV" + echo "Assume role with web identity succeeded" +fi aws eks update-kubeconfig --name GStack-sb-eks-plg helm upgrade --install -f helm/govstack-chart/values.yaml g2p-sandbox helm/govstack-chart --create-namespace --namespace paymenthub From 486786bd26e3666840053abce2546c5af0b973da Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Mon, 30 Oct 2023 13:23:33 +0530 Subject: [PATCH 035/144] test with export context variables --- .circleci/config.yml | 45 ++++++++++++++++++++--- examples/bb-payments/test_entrypoint.sh | 48 ++++--------------------- 2 files changed, 46 insertions(+), 47 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 70a29b5..005d5a0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,11 +17,46 @@ jobs: # - 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' + ORB_EVAL_ROLE_SESSION_NAME=$(circleci env subst "${ORB_EVAL_ROLE_SESSION_NAME}") + ORB_EVAL_ROLE_ARN=$(circleci env subst "${ORB_EVAL_ROLE_ARN}") + ORB_EVAL_PROFILE_NAME=$(circleci env subst "$ORB_EVAL_PROFILE_NAME") + + if [ -z "${ORB_EVAL_ROLE_SESSION_NAME}" ]; then + echo "Role session name is required" + exit 1 + fi + + if [ -z "${CIRCLE_OIDC_TOKEN_V2}" ]; then + echo "OIDC Token cannot be found. A CircleCI context must be specified." + exit 1 + fi + + if [ ! "$(command -v aws)" ]; then + echo "AWS CLI is not installed. Please run the setup or install command first." + exit 1 + fi + + read -r AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN <>"$BASH_ENV" + echo "Assume role with web identity succeeded" + fi - run: name: Update kubeconfig command: | diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 1c7b010..2e67522 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -15,51 +15,15 @@ curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bas # echo "AWS_ROLE_ARN: $AWS_ROLE_ARN" # echo "AWS_REGION: $AWS_REGION" +# Fetch environment variables from the CircleCI context +export AWS_CIRCLECI_ROLE_ARN=$(circleci env get my-context AWS_CIRCLECI_ROLE_ARN) +# Add more variables as needed -# export AWS_CIRCLECI_ROLE_ARN= $AWS_CIRCLECI_ROLE_ARN -# export AWS_ACCESS_KEY_ID= $AWS_ACCESS_KEY_ID -# export AWS_SECRET_ACCESS_KEY= $AWS_SECRET_ACCESS_KEY -# export AWS_DEFAULT_REGION= $AWS_REGION -ORB_EVAL_ROLE_SESSION_NAME=$(circleci env subst "${ORB_EVAL_ROLE_SESSION_NAME}") -ORB_EVAL_ROLE_ARN=$(circleci env subst "${ORB_EVAL_ROLE_ARN}") -ORB_EVAL_PROFILE_NAME=$(circleci env subst "$ORB_EVAL_PROFILE_NAME") +# Verify that the variables were exported +echo "AWS_CIRCLECI_ROLE_ARN: $AWS_CIRCLECI_ROLE_ARN" -if [ -z "${ORB_EVAL_ROLE_SESSION_NAME}" ]; then - echo "Role session name is required" - exit 1 -fi +aws sts assume-role --role-arn $AWS_CIRCLECI_ROLE_ARN --role-session-name deploy-test --profile my-assumed-role -if [ -z "${CIRCLE_OIDC_TOKEN_V2}" ]; then - echo "OIDC Token cannot be found. A CircleCI context must be specified." - exit 1 -fi - -if [ ! "$(command -v aws)" ]; then - echo "AWS CLI is not installed. Please run the setup or install command first." - exit 1 -fi - -read -r AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN <>"$BASH_ENV" - echo "Assume role with web identity succeeded" -fi aws eks update-kubeconfig --name GStack-sb-eks-plg helm upgrade --install -f helm/govstack-chart/values.yaml g2p-sandbox helm/govstack-chart --create-namespace --namespace paymenthub From 9915ee93556aadf6a7cf7e8676a17f8a84f8a042 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Mon, 30 Oct 2023 13:24:26 +0530 Subject: [PATCH 036/144] test with export context variables --- .circleci/config.yml | 45 +++++--------------------------------------- 1 file changed, 5 insertions(+), 40 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 005d5a0..70a29b5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,46 +17,11 @@ jobs: # - setup_remote_docker: # version: 20.10.14 - aws-cli/setup: - ORB_EVAL_ROLE_SESSION_NAME=$(circleci env subst "${ORB_EVAL_ROLE_SESSION_NAME}") - ORB_EVAL_ROLE_ARN=$(circleci env subst "${ORB_EVAL_ROLE_ARN}") - ORB_EVAL_PROFILE_NAME=$(circleci env subst "$ORB_EVAL_PROFILE_NAME") - - if [ -z "${ORB_EVAL_ROLE_SESSION_NAME}" ]; then - echo "Role session name is required" - exit 1 - fi - - if [ -z "${CIRCLE_OIDC_TOKEN_V2}" ]; then - echo "OIDC Token cannot be found. A CircleCI context must be specified." - exit 1 - fi - - if [ ! "$(command -v aws)" ]; then - echo "AWS CLI is not installed. Please run the setup or install command first." - exit 1 - fi - - read -r AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN <>"$BASH_ENV" - echo "Assume role with web identity succeeded" - fi + 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: | From 5db4792f4752c4ff4072fd60c26e7f168afa27b9 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Mon, 30 Oct 2023 13:39:12 +0530 Subject: [PATCH 037/144] test with profile aws configure --- examples/bb-payments/test_entrypoint.sh | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 2e67522..e3a7adb 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -15,16 +15,7 @@ curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bas # echo "AWS_ROLE_ARN: $AWS_ROLE_ARN" # echo "AWS_REGION: $AWS_REGION" -# Fetch environment variables from the CircleCI context -export AWS_CIRCLECI_ROLE_ARN=$(circleci env get my-context AWS_CIRCLECI_ROLE_ARN) -# Add more variables as needed - -# Verify that the variables were exported -echo "AWS_CIRCLECI_ROLE_ARN: $AWS_CIRCLECI_ROLE_ARN" - -aws sts assume-role --role-arn $AWS_CIRCLECI_ROLE_ARN --role-session-name deploy-test --profile my-assumed-role - - +aws configure --profile playground aws eks update-kubeconfig --name GStack-sb-eks-plg helm upgrade --install -f helm/govstack-chart/values.yaml g2p-sandbox helm/govstack-chart --create-namespace --namespace paymenthub helm upgrade -f helm/fineract/values.yaml fineract helm/fineract --install --create-namespace --namespace fineract From 1412a507b718d08e2f08f1598a3fa5741b37d260 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Mon, 30 Oct 2023 13:45:59 +0530 Subject: [PATCH 038/144] test with profile aws configure with set values --- examples/bb-payments/test_entrypoint.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index e3a7adb..f272240 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -16,6 +16,7 @@ curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bas # echo "AWS_REGION: $AWS_REGION" aws configure --profile playground +aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID && aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY && aws configure set default.region eu-central-1 aws eks update-kubeconfig --name GStack-sb-eks-plg helm upgrade --install -f helm/govstack-chart/values.yaml g2p-sandbox helm/govstack-chart --create-namespace --namespace paymenthub helm upgrade -f helm/fineract/values.yaml fineract helm/fineract --install --create-namespace --namespace fineract From 6930921d78f51f6399b8d005b90ea8fc63af6340 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Mon, 30 Oct 2023 13:47:11 +0530 Subject: [PATCH 039/144] test with profile aws configure with set values --- examples/bb-payments/test_entrypoint.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index f272240..c524cf3 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -15,8 +15,9 @@ curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bas # echo "AWS_ROLE_ARN: $AWS_ROLE_ARN" # echo "AWS_REGION: $AWS_REGION" -aws configure --profile playground + aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID && aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY && aws configure set default.region eu-central-1 +aws configure --profile playground aws eks update-kubeconfig --name GStack-sb-eks-plg helm upgrade --install -f helm/govstack-chart/values.yaml g2p-sandbox helm/govstack-chart --create-namespace --namespace paymenthub helm upgrade -f helm/fineract/values.yaml fineract helm/fineract --install --create-namespace --namespace fineract From 4417747d0493a464fa75b9bfe3eb7da6521df522 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Mon, 30 Oct 2023 13:51:25 +0530 Subject: [PATCH 040/144] test with profile aws configure with set values --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 70a29b5..3ed91f0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -58,6 +58,7 @@ jobs: - run: name: Update kubeconfig command: | + echo "$AWS_CIRCLECI_ROLE_ARN" aws eks update-kubeconfig --name ${EKS_CLUSTER} - run: sh orchestration/deployBpmn.sh From 4a6dc5372d01ebc4d7460fe409e72039ff8c7ebc Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Mon, 30 Oct 2023 13:58:13 +0530 Subject: [PATCH 041/144] test with profile aws configure with set values --- examples/bb-payments/test_entrypoint.sh | 48 +++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 3 deletions(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index c524cf3..cbaffe1 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -15,10 +15,52 @@ curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bas # echo "AWS_ROLE_ARN: $AWS_ROLE_ARN" # echo "AWS_REGION: $AWS_REGION" +ROLE_SESSION_NAME= deploy-test +AWS_CIRCLECI_ROLE_ARN=$(circleci env subst "${AWS_CIRCLECI_ROLE_ARN}") +PROFILE_NAME= playground +SESSION_DURATION= 1800 -aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID && aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY && aws configure set default.region eu-central-1 -aws configure --profile playground -aws eks update-kubeconfig --name GStack-sb-eks-plg +if [ -z "${ROLE_SESSION_NAME}" ]; then + echo "Role session name is required" + exit 1 +fi + +if [ -z "${CIRCLE_OIDC_TOKEN_V2}" ]; then + echo "OIDC Token cannot be found. A CircleCI context must be specified." + exit 1 +fi + +if [ ! "$(command -v aws)" ]; then + echo "AWS CLI is not installed. Please run the setup or install command first." + exit 1 +fi + +read -r AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN <>"$BASH_ENV" + echo "Assume role with web identity succeeded" +fi + + +# aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID && aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY && aws configure set default.region eu-central-1 +# aws configure --profile playground +# aws eks update-kubeconfig --name GStack-sb-eks-plg helm upgrade --install -f helm/govstack-chart/values.yaml g2p-sandbox helm/govstack-chart --create-namespace --namespace paymenthub helm upgrade -f helm/fineract/values.yaml fineract helm/fineract --install --create-namespace --namespace fineract # helm test g2p-sandbox -n paymenthub From 7105644348696866aa11eb9724737fc5db3fc8bc Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Mon, 30 Oct 2023 13:59:36 +0530 Subject: [PATCH 042/144] test with profile aws configure with set values --- examples/bb-payments/test_entrypoint.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index cbaffe1..f46caef 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -15,10 +15,10 @@ curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bas # echo "AWS_ROLE_ARN: $AWS_ROLE_ARN" # echo "AWS_REGION: $AWS_REGION" -ROLE_SESSION_NAME= deploy-test +ROLE_SESSION_NAME=deploy-test AWS_CIRCLECI_ROLE_ARN=$(circleci env subst "${AWS_CIRCLECI_ROLE_ARN}") -PROFILE_NAME= playground -SESSION_DURATION= 1800 +PROFILE_NAME=playground +SESSION_DURATION=1800 if [ -z "${ROLE_SESSION_NAME}" ]; then echo "Role session name is required" From faaeddaae862091df8a5fdd3640cd04bd087adaa Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Mon, 30 Oct 2023 14:14:11 +0530 Subject: [PATCH 043/144] test crete secret without orbs --- .circleci/config.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3ed91f0..95a031d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,12 +16,12 @@ jobs: - 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' + # - 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: | From adf108ae091338ac269ead967d2f720d85261117 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Mon, 30 Oct 2023 14:17:38 +0530 Subject: [PATCH 044/144] test crete secret without orbs --- .circleci/config.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 95a031d..0d99bc4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -22,6 +22,11 @@ jobs: # profile_name: "playground" # role_session_name: deploy-test # session_duration: '1800' + - run: + name: Configure AWS CLI + command: | + aws configure set aws_access_key_id AWS_ACCESS_KEY_ID + aws configure set aws_secret_access_key AWS_SECRET_ACCESS_KEY - run: name: Update kubeconfig command: | From c90d9a41a3bf71bf2ba0f326c06d73a62e120ef7 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Mon, 30 Oct 2023 14:19:31 +0530 Subject: [PATCH 045/144] test crete secret without orbs --- .circleci/config.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0d99bc4..13d5e5b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -22,6 +22,10 @@ jobs: # profile_name: "playground" # role_session_name: deploy-test # session_duration: '1800' + - run: + name: Install AWS CLI + command: | + pip install awscli - run: name: Configure AWS CLI command: | From 5db570eccb7d3f19b9b7a5f91317e1571dfa6244 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Mon, 30 Oct 2023 14:22:09 +0530 Subject: [PATCH 046/144] test crete secret without orbs --- .circleci/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 13d5e5b..5672a96 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -25,7 +25,8 @@ jobs: - run: name: Install AWS CLI command: | - pip install awscli + python -m ensurepip --upgrade + python -m pip install awscli - run: name: Configure AWS CLI command: | From c5b2c6842d4c0201f2952336472c89a20e74fa8a Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Mon, 30 Oct 2023 14:23:41 +0530 Subject: [PATCH 047/144] test crete secret without orbs --- .circleci/config.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5672a96..98f7534 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -25,8 +25,11 @@ jobs: - run: name: Install AWS CLI command: | - python -m ensurepip --upgrade - python -m pip install awscli + sudo apt-get update + sudo apt-get install -y python3 + curl -O https://bootstrap.pypa.io/get-pip.py + python3 get-pip.py + python3 -m pip install awscli - run: name: Configure AWS CLI command: | From 00338aad24dbb2bc27ead577152ab9a57cb0d3c4 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Mon, 30 Oct 2023 14:26:14 +0530 Subject: [PATCH 048/144] test crete secret without orbs --- .circleci/config.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 98f7534..fb9174f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -22,14 +22,8 @@ jobs: # profile_name: "playground" # role_session_name: deploy-test # session_duration: '1800' - - run: - name: Install AWS CLI - command: | - sudo apt-get update - sudo apt-get install -y python3 - curl -O https://bootstrap.pypa.io/get-pip.py - python3 get-pip.py - python3 -m pip install awscli + - aws-cli/setup: + profile_name: playground - run: name: Configure AWS CLI command: | From 17720e8b2aa6933aab90c499ba3a551d3b410751 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Mon, 30 Oct 2023 14:28:21 +0530 Subject: [PATCH 049/144] test crete secret without orbs --- .circleci/config.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fb9174f..28a1bd0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -27,8 +27,10 @@ jobs: - run: name: Configure AWS CLI command: | - aws configure set aws_access_key_id AWS_ACCESS_KEY_ID - aws configure set aws_secret_access_key AWS_SECRET_ACCESS_KEY + aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID + aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY + echo $AWS_ACCESS_KEY_ID + echo $AWS_SECRET_ACCESS_KEY - run: name: Update kubeconfig command: | From ec2f536917fc4297cfff671874fb1b732878f405 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Mon, 30 Oct 2023 14:33:46 +0530 Subject: [PATCH 050/144] test export the orb in shell script --- .circleci/config.yml | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 28a1bd0..3915459 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -22,15 +22,25 @@ jobs: # profile_name: "playground" # role_session_name: deploy-test # session_duration: '1800' - - aws-cli/setup: - profile_name: playground - run: - name: Configure AWS CLI + name: Set Environment Variables + command: | + export AWS_CIRCLECI_ROLE_ARN="${AWS_CIRCLECI_ROLE_ARN}" + export AWS_REGION="AWS_REGION" + export AWS_PROFILE_NAME="playground" + export AWS_ROLE_SESSION_NAME="deploy-test" + export AWS_SESSION_DURATION="1800" + - run: + name: Execute Shell Script command: | - aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID - aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY - echo $AWS_ACCESS_KEY_ID - echo $AWS_SECRET_ACCESS_KEY + # Your shell script commands go here + # For example, you can use the environment variables + aws configure set aws_access_key_id "${AWS_CIRCLECI_ROLE_ARN}" + aws configure set aws_secret_access_key "${AWS_REGION}" + aws configure set aws_session_token "${AWS_PROFILE_NAME}" + aws configure set role_session_name "${AWS_ROLE_SESSION_NAME}" + aws configure set session_duration "${AWS_SESSION_DURATION}" + # Then, run your AWS CLI commands as needed - run: name: Update kubeconfig command: | From 1f1150902d26163ac1d60ac488c867b121f26281 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Mon, 30 Oct 2023 14:35:43 +0530 Subject: [PATCH 051/144] test export the orb in shell script --- .circleci/config.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3915459..96fc10e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -22,6 +22,12 @@ jobs: # profile_name: "playground" # role_session_name: deploy-test # session_duration: '1800' + - run: + name: Install AWS CLI + command: | + curl "https://d1vvhvl2y92vvt.cloudfront.net/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" + unzip awscliv2.zip + sudo ./aws/install - run: name: Set Environment Variables command: | From 1ab9674615d1a75fdbca9e5d80c6174ef000593a Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Mon, 30 Oct 2023 16:06:39 +0530 Subject: [PATCH 052/144] test export the orb in shell script with eks kubconfig update --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 96fc10e..bbf2e5e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -46,6 +46,7 @@ jobs: aws configure set aws_session_token "${AWS_PROFILE_NAME}" aws configure set role_session_name "${AWS_ROLE_SESSION_NAME}" aws configure set session_duration "${AWS_SESSION_DURATION}" + aws eks update-kubeconfig --name ${EKS_CLUSTER} # Then, run your AWS CLI commands as needed - run: name: Update kubeconfig From 6ec2b9c39015beaaf8d6a871a0186e2316ac9690 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Mon, 30 Oct 2023 16:08:07 +0530 Subject: [PATCH 053/144] test export the orb in shell script with eks kubconfig update --- .circleci/config.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index bbf2e5e..fec9d3a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -41,12 +41,11 @@ jobs: command: | # Your shell script commands go here # For example, you can use the environment variables - aws configure set aws_access_key_id "${AWS_CIRCLECI_ROLE_ARN}" + aws configure set aws_access_key_id "${AWS_CIRCLECI_ROLE_ARN1}" aws configure set aws_secret_access_key "${AWS_REGION}" aws configure set aws_session_token "${AWS_PROFILE_NAME}" aws configure set role_session_name "${AWS_ROLE_SESSION_NAME}" aws configure set session_duration "${AWS_SESSION_DURATION}" - aws eks update-kubeconfig --name ${EKS_CLUSTER} # Then, run your AWS CLI commands as needed - run: name: Update kubeconfig From 80b6d58e0f9545a0a8b77f9835dd7f7e96641e50 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Mon, 30 Oct 2023 17:47:57 +0530 Subject: [PATCH 054/144] test with eks orbs code --- .circleci/config.yml | 62 ++++++++++++------------- examples/bb-payments/test_entrypoint.sh | 46 ++---------------- 2 files changed, 35 insertions(+), 73 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fec9d3a..74e41b0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,37 +16,37 @@ jobs: - 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: Install AWS CLI - command: | - curl "https://d1vvhvl2y92vvt.cloudfront.net/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" - unzip awscliv2.zip - sudo ./aws/install - - run: - name: Set Environment Variables - command: | - export AWS_CIRCLECI_ROLE_ARN="${AWS_CIRCLECI_ROLE_ARN}" - export AWS_REGION="AWS_REGION" - export AWS_PROFILE_NAME="playground" - export AWS_ROLE_SESSION_NAME="deploy-test" - export AWS_SESSION_DURATION="1800" - - run: - name: Execute Shell Script - command: | - # Your shell script commands go here - # For example, you can use the environment variables - aws configure set aws_access_key_id "${AWS_CIRCLECI_ROLE_ARN1}" - aws configure set aws_secret_access_key "${AWS_REGION}" - aws configure set aws_session_token "${AWS_PROFILE_NAME}" - aws configure set role_session_name "${AWS_ROLE_SESSION_NAME}" - aws configure set session_duration "${AWS_SESSION_DURATION}" - # Then, run your AWS CLI commands as needed + - 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: Install AWS CLI + # command: | + # curl "https://d1vvhvl2y92vvt.cloudfront.net/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" + # unzip awscliv2.zip + # sudo ./aws/install + # - run: + # name: Set Environment Variables + # command: | + # export AWS_CIRCLECI_ROLE_ARN="${AWS_CIRCLECI_ROLE_ARN}" + # export AWS_REGION="AWS_REGION" + # export AWS_PROFILE_NAME="playground" + # export AWS_ROLE_SESSION_NAME="deploy-test" + # export AWS_SESSION_DURATION="1800" + # - run: + # name: Execute Shell Script + # command: | + # # Your shell script commands go here + # # For example, you can use the environment variables + # aws configure set aws_access_key_id "${AWS_CIRCLECI_ROLE_ARN}" + # aws configure set aws_secret_access_key "${AWS_REGION}" + # aws configure set aws_session_token "${AWS_PROFILE_NAME}" + # aws configure set role_session_name "${AWS_ROLE_SESSION_NAME}" + # aws configure set session_duration "${AWS_SESSION_DURATION}" + # # Then, run your AWS CLI commands as needed - run: name: Update kubeconfig command: | diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index f46caef..03cb60e 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -15,48 +15,10 @@ curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bas # echo "AWS_ROLE_ARN: $AWS_ROLE_ARN" # echo "AWS_REGION: $AWS_REGION" -ROLE_SESSION_NAME=deploy-test -AWS_CIRCLECI_ROLE_ARN=$(circleci env subst "${AWS_CIRCLECI_ROLE_ARN}") -PROFILE_NAME=playground -SESSION_DURATION=1800 - -if [ -z "${ROLE_SESSION_NAME}" ]; then - echo "Role session name is required" - exit 1 -fi - -if [ -z "${CIRCLE_OIDC_TOKEN_V2}" ]; then - echo "OIDC Token cannot be found. A CircleCI context must be specified." - exit 1 -fi - -if [ ! "$(command -v aws)" ]; then - echo "AWS CLI is not installed. Please run the setup or install command first." - exit 1 -fi - -read -r AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN <>"$BASH_ENV" - echo "Assume role with web identity succeeded" -fi - +CLUSTER_NAME=$(eval echo "$EKS_CLUSTER") +AWS_REGION=$(eval echo "$AWS_REGION") +AWS_PROFILE= "playground" +ROLE_ARN=$(eval echo "$AWS_CIRCLECI_ROLE_ARN") # aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID && aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY && aws configure set default.region eu-central-1 # aws configure --profile playground From f37a2c0ce8b6d5ccb63ae1f393e9038fb6c2f897 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Mon, 30 Oct 2023 17:49:47 +0530 Subject: [PATCH 055/144] test with eks orbs code --- examples/bb-payments/test_entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 03cb60e..764cda3 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -17,7 +17,7 @@ curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bas CLUSTER_NAME=$(eval echo "$EKS_CLUSTER") AWS_REGION=$(eval echo "$AWS_REGION") -AWS_PROFILE= "playground" +AWS_PROFILE=playground ROLE_ARN=$(eval echo "$AWS_CIRCLECI_ROLE_ARN") # aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID && aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY && aws configure set default.region eu-central-1 From a055298ccd005238ec46d3e60463767ce5938cd0 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Mon, 30 Oct 2023 17:54:25 +0530 Subject: [PATCH 056/144] test with eks orbs code --- .circleci/config.yml | 12 +++++++----- examples/bb-payments/test_entrypoint.sh | 19 +++---------------- 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 74e41b0..99d6333 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -62,11 +62,13 @@ jobs: 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 + name: Bulk-secret + command: | + 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 deploying-bpmns: docker: diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 764cda3..3e13e60 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -1,28 +1,15 @@ #!/bin/bash curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash - -# # Access environment variables from the CircleCI context -# AWS_ROLE_ARN="${AWS_CIRCLECI_ROLE_ARN}" -# AWS_REGION="${AWS_REGION}" - -# # Set AWS CLI configuration -# aws configure set aws_access_key_id "$AWS_ACCESS_KEY_ID" -# aws configure set aws_secret_access_key "$AWS_SECRET_ACCESS_KEY" -# aws configure set aws_session_token "$AWS_SESSION_TOKEN" -# aws configure set default.region "$AWS_REGION" - -# # Use the variables in your script -# echo "AWS_ROLE_ARN: $AWS_ROLE_ARN" -# echo "AWS_REGION: $AWS_REGION" - +echo "setting cluster" CLUSTER_NAME=$(eval echo "$EKS_CLUSTER") AWS_REGION=$(eval echo "$AWS_REGION") AWS_PROFILE=playground ROLE_ARN=$(eval echo "$AWS_CIRCLECI_ROLE_ARN") +echo "set the cluster" # aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID && aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY && aws configure set default.region eu-central-1 # aws configure --profile playground -# aws eks update-kubeconfig --name GStack-sb-eks-plg +aws eks update-kubeconfig --name GStack-sb-eks-plg helm upgrade --install -f helm/govstack-chart/values.yaml g2p-sandbox helm/govstack-chart --create-namespace --namespace paymenthub helm upgrade -f helm/fineract/values.yaml fineract helm/fineract --install --create-namespace --namespace fineract # helm test g2p-sandbox -n paymenthub From cc7810855d6cf523f933b54d21c8753bb0bbefeb Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Mon, 30 Oct 2023 17:57:57 +0530 Subject: [PATCH 057/144] test with eks orbs code --- examples/bb-payments/test_entrypoint.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 3e13e60..4f570a5 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -1,11 +1,9 @@ #!/bin/bash curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash -echo "setting cluster" -CLUSTER_NAME=$(eval echo "$EKS_CLUSTER") -AWS_REGION=$(eval echo "$AWS_REGION") +CLUSTER_NAME="$EKS_CLUSTER" +AWS_REGION="$AWS_REGION" AWS_PROFILE=playground -ROLE_ARN=$(eval echo "$AWS_CIRCLECI_ROLE_ARN") -echo "set the cluster" +ROLE_ARN="$AWS_CIRCLECI_ROLE_ARN" # aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID && aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY && aws configure set default.region eu-central-1 # aws configure --profile playground From 469258506b93ad1ebd787bd179e9319d0df27d05 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Mon, 30 Oct 2023 18:12:37 +0530 Subject: [PATCH 058/144] test with eks orbs code --- .circleci/config.yml | 4 ++++ examples/bb-payments/generate_mfa_token.py | 7 +++++++ examples/bb-payments/test_entrypoint.sh | 12 +++++++----- 3 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 examples/bb-payments/generate_mfa_token.py diff --git a/.circleci/config.yml b/.circleci/config.yml index 99d6333..6f0077b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -47,6 +47,10 @@ jobs: # aws configure set role_session_name "${AWS_ROLE_SESSION_NAME}" # aws configure set session_duration "${AWS_SESSION_DURATION}" # # Then, run your AWS CLI commands as needed + - run: + name: test shell script + command: + ./test_entrypoint.sh - run: name: Update kubeconfig command: | diff --git a/examples/bb-payments/generate_mfa_token.py b/examples/bb-payments/generate_mfa_token.py new file mode 100644 index 0000000..bead975 --- /dev/null +++ b/examples/bb-payments/generate_mfa_token.py @@ -0,0 +1,7 @@ +import pyotp + +secret_key = "YOUR_MFA_SECRET_KEY" # Replace with your MFA secret key +totp = pyotp.TOTP(secret_key) +mfa_token = totp.now() + +print(mfa_token) \ No newline at end of file diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 4f570a5..669d3c0 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -1,13 +1,15 @@ #!/bin/bash curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash -CLUSTER_NAME="$EKS_CLUSTER" -AWS_REGION="$AWS_REGION" -AWS_PROFILE=playground -ROLE_ARN="$AWS_CIRCLECI_ROLE_ARN" + + +# CLUSTER_NAME="$EKS_CLUSTER" +# AWS_REGION="$AWS_REGION" +# AWS_PROFILE=playground +# ROLE_ARN="$role_arn" # aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID && aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY && aws configure set default.region eu-central-1 # aws configure --profile playground -aws eks update-kubeconfig --name GStack-sb-eks-plg +# aws eks update-kubeconfig --name GStack-sb-eks-plg helm upgrade --install -f helm/govstack-chart/values.yaml g2p-sandbox helm/govstack-chart --create-namespace --namespace paymenthub helm upgrade -f helm/fineract/values.yaml fineract helm/fineract --install --create-namespace --namespace fineract # helm test g2p-sandbox -n paymenthub From cf42a833c988b7e202254f816ef3e3bf7b7ebead Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Mon, 30 Oct 2023 18:16:58 +0530 Subject: [PATCH 059/144] test with eks orbs code --- .circleci/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6f0077b..2810965 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -49,7 +49,8 @@ jobs: # # Then, run your AWS CLI commands as needed - run: name: test shell script - command: + command: | + cd examples/bb-payments/ ./test_entrypoint.sh - run: name: Update kubeconfig From b945e8ae85ae1fef555db0ab5107d17f179b3324 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Tue, 12 Dec 2023 19:34:19 +0530 Subject: [PATCH 060/144] test with cluster credentials --- .circleci/config.yml | 162 +-------------------- examples/bb-payments/generate_mfa_token.py | 7 - examples/bb-payments/test_entrypoint.sh | 22 +-- 3 files changed, 18 insertions(+), 173 deletions(-) delete mode 100644 examples/bb-payments/generate_mfa_token.py diff --git a/.circleci/config.yml b/.circleci/config.yml index 2810965..6abd5e8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,170 +1,20 @@ version: 2.1 setup: true + orbs: 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: - 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: Install AWS CLI - # command: | - # curl "https://d1vvhvl2y92vvt.cloudfront.net/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" - # unzip awscliv2.zip - # sudo ./aws/install - # - run: - # name: Set Environment Variables - # command: | - # export AWS_CIRCLECI_ROLE_ARN="${AWS_CIRCLECI_ROLE_ARN}" - # export AWS_REGION="AWS_REGION" - # export AWS_PROFILE_NAME="playground" - # export AWS_ROLE_SESSION_NAME="deploy-test" - # export AWS_SESSION_DURATION="1800" - # - run: - # name: Execute Shell Script - # command: | - # # Your shell script commands go here - # # For example, you can use the environment variables - # aws configure set aws_access_key_id "${AWS_CIRCLECI_ROLE_ARN}" - # aws configure set aws_secret_access_key "${AWS_REGION}" - # aws configure set aws_session_token "${AWS_PROFILE_NAME}" - # aws configure set role_session_name "${AWS_ROLE_SESSION_NAME}" - # aws configure set session_duration "${AWS_SESSION_DURATION}" - # # Then, run your AWS CLI commands as needed - - run: - name: test shell script - command: | - cd examples/bb-payments/ - ./test_entrypoint.sh - - 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: | - name: Bulk-secret - command: | - 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 - - 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: | - echo "$AWS_CIRCLECI_ROLE_ARN" - aws eks update-kubeconfig --name ${EKS_CLUSTER} - - run: sh orchestration/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' - - 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: | - mkdir integration_report - kubectl cp paymenthub/`kubectl get pods -n paymenthub | grep g2p-sandbox-test-connection |cut -d " " -f1`:/ph-ee-connector-integration-test/build/reports/tests/test/ ./integration_report - - run: - name: List Contents of Integration Report Directory - command: | - ls -l ./integration_report - - store_artifacts: - path: ./integration_report - destination: integration_reports workflows: - deploy: - jobs: + test_everything: + jobs: - test-harness/create-config: + pre-steps: + - run: echo "hello" > /home/circleci/parameters.json post-steps: # Persist to workspace has to be defined in main workflow - persist_to_workspace: root: workspace paths: - generated.yml - - aws-cli/setup: - role_arn: "${AWS_CIRCLECI_ROLE_ARN}" - region: AWS_REGION - profile_name: "playground" - role_session_name: deploy-test - session_duration: '1800' - context: - - AWS - - playground - test-harness/execute-tests: requires: - - test-harness/create-config - - create-secret: - requires: - - test-harness/execute-tests - context: - - AWS - - playground - - deploying-bpmns: - requires: - - test-harness/execute-tests - context: - - AWS - - playground - - helm-test: - requires: - - create-secret - - deploying-bpmns - context: - - AWS - - playground \ No newline at end of file + - test-harness/create-config \ No newline at end of file diff --git a/examples/bb-payments/generate_mfa_token.py b/examples/bb-payments/generate_mfa_token.py deleted file mode 100644 index bead975..0000000 --- a/examples/bb-payments/generate_mfa_token.py +++ /dev/null @@ -1,7 +0,0 @@ -import pyotp - -secret_key = "YOUR_MFA_SECRET_KEY" # Replace with your MFA secret key -totp = pyotp.TOTP(secret_key) -mfa_token = totp.now() - -print(mfa_token) \ No newline at end of file diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 669d3c0..f957a78 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -1,15 +1,17 @@ #!/bin/bash -curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash - - -# CLUSTER_NAME="$EKS_CLUSTER" -# AWS_REGION="$AWS_REGION" -# AWS_PROFILE=playground -# ROLE_ARN="$role_arn" +echo $AWS_SECRET_ACCESS_KEY +echo $AWS_REGION +echo $AWS_CIRCLECI_ROLE_ARN +echo $EKS_CLUSTER +echo $SANDBOX_DOMAIN +cat /home/circleci/parameters.json +chmod u+x entrypoint.sh # aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID && aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY && aws configure set default.region eu-central-1 # aws configure --profile playground -# aws eks update-kubeconfig --name GStack-sb-eks-plg -helm upgrade --install -f helm/govstack-chart/values.yaml g2p-sandbox helm/govstack-chart --create-namespace --namespace paymenthub -helm upgrade -f helm/fineract/values.yaml fineract helm/fineract --install --create-namespace --namespace fineract + +aws eks update-kubeconfig --name sandbox +helm test g2p-sandbox -n paymenthub +# helm upgrade --install -f helm/govstack-chart/values.yaml g2p-sandbox helm/govstack-chart --create-namespace --namespace paymenthub +# helm upgrade -f helm/fineract/values.yaml fineract helm/fineract --install --create-namespace --namespace fineract # helm test g2p-sandbox -n paymenthub From c22b1aa5fd6964860e56f1698c498bb340d01e48 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Tue, 12 Dec 2023 19:36:36 +0530 Subject: [PATCH 061/144] test with cluster credentials --- examples/bb-payments/test_entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index f957a78..31fdad3 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -5,7 +5,7 @@ echo $AWS_CIRCLECI_ROLE_ARN echo $EKS_CLUSTER echo $SANDBOX_DOMAIN cat /home/circleci/parameters.json -chmod u+x entrypoint.sh +# chmod u+x entrypoint.sh # aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID && aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY && aws configure set default.region eu-central-1 # aws configure --profile playground From 28ee91068a0f2ca31b84095025d73994186b1418 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Tue, 12 Dec 2023 19:58:15 +0530 Subject: [PATCH 062/144] test with cluster credentials --- examples/bb-payments/test_entrypoint.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 31fdad3..a472bfa 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -6,11 +6,15 @@ echo $EKS_CLUSTER echo $SANDBOX_DOMAIN cat /home/circleci/parameters.json # chmod u+x entrypoint.sh - +# - aws-cli/setup: +# role_arn: "${AWS_CIRCLECI_ROLE_ARN}" +# region: ${AWS_REGION} +# role_session_name: CircleCISession +# session_duration: '1800' # aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID && aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY && aws configure set default.region eu-central-1 # aws configure --profile playground -aws eks update-kubeconfig --name sandbox +# aws eks update-kubeconfig --name sandbox helm test g2p-sandbox -n paymenthub # helm upgrade --install -f helm/govstack-chart/values.yaml g2p-sandbox helm/govstack-chart --create-namespace --namespace paymenthub # helm upgrade -f helm/fineract/values.yaml fineract helm/fineract --install --create-namespace --namespace fineract From f23abcbe8183206c376e4bde0bb999157858c2e6 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Tue, 12 Dec 2023 20:05:08 +0530 Subject: [PATCH 063/144] install helm --- examples/bb-payments/test_entrypoint.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index a472bfa..b0889a8 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -13,7 +13,8 @@ cat /home/circleci/parameters.json # session_duration: '1800' # aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID && aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY && aws configure set default.region eu-central-1 # aws configure --profile playground - +sudo apt-get update +sudo apt-get install helm # aws eks update-kubeconfig --name sandbox helm test g2p-sandbox -n paymenthub # helm upgrade --install -f helm/govstack-chart/values.yaml g2p-sandbox helm/govstack-chart --create-namespace --namespace paymenthub From f44ffc34f47aa087165817c5f264ee30207c57aa Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Tue, 12 Dec 2023 20:07:12 +0530 Subject: [PATCH 064/144] install helm --- examples/bb-payments/test_entrypoint.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index b0889a8..c71d89c 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -13,6 +13,9 @@ cat /home/circleci/parameters.json # session_duration: '1800' # aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID && aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY && aws configure set default.region eu-central-1 # aws configure --profile playground +curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null +sudo apt-get install apt-transport-https --yes +echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list sudo apt-get update sudo apt-get install helm # aws eks update-kubeconfig --name sandbox From af6024def672e6c8c8cee903e91b98efba2965b3 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Tue, 12 Dec 2023 20:40:11 +0530 Subject: [PATCH 065/144] install helm --- examples/bb-payments/test_entrypoint.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index c71d89c..ba7430a 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -6,11 +6,11 @@ echo $EKS_CLUSTER echo $SANDBOX_DOMAIN cat /home/circleci/parameters.json # chmod u+x entrypoint.sh -# - aws-cli/setup: -# role_arn: "${AWS_CIRCLECI_ROLE_ARN}" -# region: ${AWS_REGION} -# role_session_name: CircleCISession -# session_duration: '1800' +- aws-cli/setup: + role_arn: "${AWS_CIRCLECI_ROLE_ARN}" + region: ${AWS_REGION} + role_session_name: CircleCISession + session_duration: '1800' # aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID && aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY && aws configure set default.region eu-central-1 # aws configure --profile playground curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null From 4ab780c11f59d52cb93febefc0b05bfb4ed86b4a Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Tue, 12 Dec 2023 21:28:02 +0530 Subject: [PATCH 066/144] install helm --- examples/bb-payments/test_entrypoint.sh | 43 ++++++++++++++++++------- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index ba7430a..6263297 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -1,16 +1,37 @@ #!/bin/bash -echo $AWS_SECRET_ACCESS_KEY -echo $AWS_REGION -echo $AWS_CIRCLECI_ROLE_ARN -echo $EKS_CLUSTER -echo $SANDBOX_DOMAIN -cat /home/circleci/parameters.json +# echo $AWS_SECRET_ACCESS_KEY +# echo $AWS_REGION +# echo $AWS_CIRCLECI_ROLE_ARN +# echo $EKS_CLUSTER +# echo $SANDBOX_DOMAIN +# cat /home/circleci/parameters.json # chmod u+x entrypoint.sh -- aws-cli/setup: - role_arn: "${AWS_CIRCLECI_ROLE_ARN}" - region: ${AWS_REGION} - role_session_name: CircleCISession - session_duration: '1800' + +AWS_CIRCLECI_ROLE_ARN="${AWS_CIRCLECI_ROLE_ARN}" +AWS_REGION="${AWS_REGION}" + +aws configure set default.region $AWS_REGION + +# Assume the specified role +role_credentials=$(aws sts assume-role \ + --role-arn $AWS_CIRCLECI_ROLE_ARN \ + --role-session-name CircleCISession \ + --duration-seconds 1800 \ + --output json) + +# Extract and set the assumed role credentials as environment variables +export AWS_ACCESS_KEY_ID=$(echo $role_credentials | jq -r .Credentials.AccessKeyId) +export AWS_SECRET_ACCESS_KEY=$(echo $role_credentials | jq -r .Credentials.SecretAccessKey) +export AWS_SESSION_TOKEN=$(echo $role_credentials | jq -r .Credentials.SessionToken) + +# Your subsequent AWS CLI commands here +# ... + +# Optionally, unset the environment variables to avoid potential issues +unset AWS_ACCESS_KEY_ID +unset AWS_SECRET_ACCESS_KEY +unset AWS_SESSION_TOKEN + # aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID && aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY && aws configure set default.region eu-central-1 # aws configure --profile playground curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null From d1026ab0739bda4aa200d992724ed076c2d4baed Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Wed, 13 Dec 2023 12:26:51 +0530 Subject: [PATCH 067/144] assume role --- examples/bb-payments/test_entrypoint.sh | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 6263297..a4c2262 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -1,12 +1,6 @@ #!/bin/bash -# echo $AWS_SECRET_ACCESS_KEY -# echo $AWS_REGION -# echo $AWS_CIRCLECI_ROLE_ARN -# echo $EKS_CLUSTER -# echo $SANDBOX_DOMAIN -# cat /home/circleci/parameters.json -# chmod u+x entrypoint.sh +kubectl cluster-info AWS_CIRCLECI_ROLE_ARN="${AWS_CIRCLECI_ROLE_ARN}" AWS_REGION="${AWS_REGION}" @@ -14,10 +8,10 @@ aws configure set default.region $AWS_REGION # Assume the specified role role_credentials=$(aws sts assume-role \ - --role-arn $AWS_CIRCLECI_ROLE_ARN \ - --role-session-name CircleCISession \ - --duration-seconds 1800 \ - --output json) +--role-arn $AWS_CIRCLECI_ROLE_ARN \ +--role-session-name CircleCISession \ +--duration-seconds 1800 \ +--output json) # Extract and set the assumed role credentials as environment variables export AWS_ACCESS_KEY_ID=$(echo $role_credentials | jq -r .Credentials.AccessKeyId) @@ -31,7 +25,7 @@ export AWS_SESSION_TOKEN=$(echo $role_credentials | jq -r .Credentials.SessionTo unset AWS_ACCESS_KEY_ID unset AWS_SECRET_ACCESS_KEY unset AWS_SESSION_TOKEN - +kubectl cluster-info # aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID && aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY && aws configure set default.region eu-central-1 # aws configure --profile playground curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null From 387ea9ad85282926e857f628a44f7cc3f97c1e05 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Wed, 13 Dec 2023 12:30:19 +0530 Subject: [PATCH 068/144] insatll kubectl --- examples/bb-payments/test_entrypoint.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index a4c2262..a0e131e 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -1,6 +1,11 @@ #!/bin/bash +curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl" +chmod +x ./kubectl +sudo mv ./kubectl /usr/local/bin/kubectl +kubectl version kubectl cluster-info + AWS_CIRCLECI_ROLE_ARN="${AWS_CIRCLECI_ROLE_ARN}" AWS_REGION="${AWS_REGION}" From 84eac6267a226a038725293b04a43fea69e1b667 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Wed, 13 Dec 2023 12:43:13 +0530 Subject: [PATCH 069/144] kubectl cluster-info dump --- examples/bb-payments/test_entrypoint.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index a0e131e..b7cc8fc 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -1,10 +1,10 @@ #!/bin/bash curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl" chmod +x ./kubectl -sudo mv ./kubectl /usr/local/bin/kubectl +mv ./kubectl /usr/local/bin/kubectl kubectl version - -kubectl cluster-info +kubectl cluster-info dump +# kubectl cluster-info AWS_CIRCLECI_ROLE_ARN="${AWS_CIRCLECI_ROLE_ARN}" AWS_REGION="${AWS_REGION}" From 4c9a0c52710344d2eaab22196a71668321b84043 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Mon, 18 Dec 2023 15:26:22 +0530 Subject: [PATCH 070/144] setup Minikube in govstack env --- examples/bb-payments/test_entrypoint.sh | 37 ++++++------------------- 1 file changed, 8 insertions(+), 29 deletions(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index b7cc8fc..b9c6e7b 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -1,36 +1,15 @@ #!/bin/bash +#insatll kubectl curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl" chmod +x ./kubectl mv ./kubectl /usr/local/bin/kubectl kubectl version -kubectl cluster-info dump -# kubectl cluster-info +#Setup Minikube +curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_latest_amd64.deb +sudo dpkg -i minikube_latest_amd64.deb +minikube start -AWS_CIRCLECI_ROLE_ARN="${AWS_CIRCLECI_ROLE_ARN}" -AWS_REGION="${AWS_REGION}" - -aws configure set default.region $AWS_REGION - -# Assume the specified role -role_credentials=$(aws sts assume-role \ ---role-arn $AWS_CIRCLECI_ROLE_ARN \ ---role-session-name CircleCISession \ ---duration-seconds 1800 \ ---output json) - -# Extract and set the assumed role credentials as environment variables -export AWS_ACCESS_KEY_ID=$(echo $role_credentials | jq -r .Credentials.AccessKeyId) -export AWS_SECRET_ACCESS_KEY=$(echo $role_credentials | jq -r .Credentials.SecretAccessKey) -export AWS_SESSION_TOKEN=$(echo $role_credentials | jq -r .Credentials.SessionToken) - -# Your subsequent AWS CLI commands here -# ... - -# Optionally, unset the environment variables to avoid potential issues -unset AWS_ACCESS_KEY_ID -unset AWS_SECRET_ACCESS_KEY -unset AWS_SESSION_TOKEN -kubectl cluster-info +minikube kubectl -- get po -A #Interact with Minikube cluster # aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID && aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY && aws configure set default.region eu-central-1 # aws configure --profile playground curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null @@ -38,8 +17,8 @@ sudo apt-get install apt-transport-https --yes echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list sudo apt-get update sudo apt-get install helm -# aws eks update-kubeconfig --name sandbox -helm test g2p-sandbox -n paymenthub + + # helm upgrade --install -f helm/govstack-chart/values.yaml g2p-sandbox helm/govstack-chart --create-namespace --namespace paymenthub # helm upgrade -f helm/fineract/values.yaml fineract helm/fineract --install --create-namespace --namespace fineract # helm test g2p-sandbox -n paymenthub From 12a567c2149c0398eb6efb724561760e5a137768 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Mon, 18 Dec 2023 15:59:21 +0530 Subject: [PATCH 071/144] install helm and deploy paymenthub --- examples/bb-payments/test_entrypoint.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index b9c6e7b..508221e 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -15,8 +15,14 @@ minikube kubectl -- get po -A #Interact with Minikube cluster curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null sudo apt-get install apt-transport-https --yes echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list +#helm install sudo apt-get update sudo apt-get install helm +#payment install +kubectl create namespace paymenthub +kubectl get -A namespace +helm repo add g2p-sandbox-1-3-1 https://fynarfin.io/images/ph-ee-g2psandbox-1.3.1/ +helm install my-ph-ee-g2psandbox g2p-sandbox-1-3-1/ph-ee-g2psandbox --version 1.3.1 -n paymenthub # helm upgrade --install -f helm/govstack-chart/values.yaml g2p-sandbox helm/govstack-chart --create-namespace --namespace paymenthub From eee7d5469522cf2d95302a0585046dd2d76f1629 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Mon, 18 Dec 2023 16:08:41 +0530 Subject: [PATCH 072/144] install helm and deploy paymenthub --- examples/bb-payments/test_entrypoint.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 508221e..9ce8e01 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -1,8 +1,17 @@ #!/bin/bash #insatll kubectl -curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl" -chmod +x ./kubectl -mv ./kubectl /usr/local/bin/kubectl +apt-get update +# apt-transport-https may be a dummy package; if so, you can skip that package +apt-get install -y apt-transport-https ca-certificates curl gpg + +curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.28/deb/Release.key | gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg + +# This overwrites any existing configuration in /etc/apt/sources.list.d/kubernetes.list +echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.28/deb/ /' | tee /etc/apt/sources.list.d/kubernetes.list + +apt-get update +apt-get install -y kubelet kubeadm kubectl +apt-mark hold kubelet kubeadm kubectl kubectl version #Setup Minikube curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_latest_amd64.deb @@ -21,6 +30,7 @@ sudo apt-get install helm #payment install kubectl create namespace paymenthub kubectl get -A namespace +kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/main/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml #Install ServiceMonitor helm repo add g2p-sandbox-1-3-1 https://fynarfin.io/images/ph-ee-g2psandbox-1.3.1/ helm install my-ph-ee-g2psandbox g2p-sandbox-1-3-1/ph-ee-g2psandbox --version 1.3.1 -n paymenthub From 70d36dd3b951878114cf8139d5bc9ad4dbf5d0b3 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Tue, 19 Dec 2023 12:49:52 +0530 Subject: [PATCH 073/144] test deploy --- examples/bb-payments/test_entrypoint.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 9ce8e01..464135b 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -28,9 +28,9 @@ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm. sudo apt-get update sudo apt-get install helm #payment install +kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/main/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml #Install ServiceMonitor kubectl create namespace paymenthub -kubectl get -A namespace -kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/main/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml #Install ServiceMonitor +kubectl get -A namespace helm repo add g2p-sandbox-1-3-1 https://fynarfin.io/images/ph-ee-g2psandbox-1.3.1/ helm install my-ph-ee-g2psandbox g2p-sandbox-1-3-1/ph-ee-g2psandbox --version 1.3.1 -n paymenthub From 7d3bb70b79512d649c6a06e1923e93084f08331e Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Tue, 19 Dec 2023 13:14:39 +0530 Subject: [PATCH 074/144] test deploy --- examples/bb-payments/test_entrypoint.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 464135b..5019aea 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -19,6 +19,8 @@ sudo dpkg -i minikube_latest_amd64.deb minikube start minikube kubectl -- get po -A #Interact with Minikube cluster +kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/main/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml +echo "service-moi=nitor installed" # aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID && aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY && aws configure set default.region eu-central-1 # aws configure --profile playground curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null @@ -28,7 +30,7 @@ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm. sudo apt-get update sudo apt-get install helm #payment install -kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/main/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml #Install ServiceMonitor +# kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/main/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml #Install ServiceMonitor kubectl create namespace paymenthub kubectl get -A namespace helm repo add g2p-sandbox-1-3-1 https://fynarfin.io/images/ph-ee-g2psandbox-1.3.1/ From cb9f048145375c977913a7391a561741e60b16f3 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Tue, 19 Dec 2023 13:33:55 +0530 Subject: [PATCH 075/144] install kubectl --- examples/bb-payments/test_entrypoint.sh | 32 ++++++++++++++++--------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 5019aea..fb2c33b 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -1,18 +1,28 @@ #!/bin/bash #insatll kubectl -apt-get update -# apt-transport-https may be a dummy package; if so, you can skip that package -apt-get install -y apt-transport-https ca-certificates curl gpg +# apt-get update +# # apt-transport-https may be a dummy package; if so, you can skip that package +# apt-get install -y apt-transport-https ca-certificates curl gpg -curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.28/deb/Release.key | gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg +# curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.28/deb/Release.key | gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg -# This overwrites any existing configuration in /etc/apt/sources.list.d/kubernetes.list -echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.28/deb/ /' | tee /etc/apt/sources.list.d/kubernetes.list +# # This overwrites any existing configuration in /etc/apt/sources.list.d/kubernetes.list +# echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.28/deb/ /' | tee /etc/apt/sources.list.d/kubernetes.list -apt-get update -apt-get install -y kubelet kubeadm kubectl -apt-mark hold kubelet kubeadm kubectl -kubectl version +# apt-get update +# apt-get install -y kubelet kubeadm kubectl +# apt-mark hold kubelet kubeadm kubectl +# kubectl version +sudo apt-get update +sudo apt-get install -y apt-transport-https ca-certificates curl gpg +sudo mkdir -p /etc/apt/keyrings +sudo touch /etc/apt/keyrings/kubernetes-apt-keyring.gpg +curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.28/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg +echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.28/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list +sudo apt-get update +sudo apt-get install -y kubelet kubeadm kubectl +sudo apt-mark hold kubelet kubeadm kubectl +kubectl version --short #Setup Minikube curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_latest_amd64.deb sudo dpkg -i minikube_latest_amd64.deb @@ -20,7 +30,7 @@ minikube start minikube kubectl -- get po -A #Interact with Minikube cluster kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/main/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml -echo "service-moi=nitor installed" +echo "service-monitor installed" # aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID && aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY && aws configure set default.region eu-central-1 # aws configure --profile playground curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null From a5560d869fc72336eebdd0f1301d993c4fbc1082 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Tue, 19 Dec 2023 13:46:08 +0530 Subject: [PATCH 076/144] install kubectl --- examples/bb-payments/test_entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index fb2c33b..16d55ea 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -16,7 +16,7 @@ sudo apt-get update sudo apt-get install -y apt-transport-https ca-certificates curl gpg sudo mkdir -p /etc/apt/keyrings -sudo touch /etc/apt/keyrings/kubernetes-apt-keyring.gpg +sudo touch -y /etc/apt/keyrings/kubernetes-apt-keyring.gpg curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.28/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.28/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list sudo apt-get update From 4a8fbc4cc284bfe4b14daa85f5e1607313347b37 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Tue, 19 Dec 2023 13:47:38 +0530 Subject: [PATCH 077/144] install kubectl --- examples/bb-payments/test_entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 16d55ea..8d6627d 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -22,7 +22,7 @@ echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs. sudo apt-get update sudo apt-get install -y kubelet kubeadm kubectl sudo apt-mark hold kubelet kubeadm kubectl -kubectl version --short +kubectl version #Setup Minikube curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_latest_amd64.deb sudo dpkg -i minikube_latest_amd64.deb From c9e9a284da0bf09bd44f272ba538528f69be1bc6 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Tue, 19 Dec 2023 13:51:56 +0530 Subject: [PATCH 078/144] helm deploy and helm test --- examples/bb-payments/test_entrypoint.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 8d6627d..c27112b 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -46,7 +46,8 @@ kubectl get -A namespace helm repo add g2p-sandbox-1-3-1 https://fynarfin.io/images/ph-ee-g2psandbox-1.3.1/ helm install my-ph-ee-g2psandbox g2p-sandbox-1-3-1/ph-ee-g2psandbox --version 1.3.1 -n paymenthub - +kubectl get pods -n paymenthub +helm test my-ph-ee-g2psandbox # helm upgrade --install -f helm/govstack-chart/values.yaml g2p-sandbox helm/govstack-chart --create-namespace --namespace paymenthub # helm upgrade -f helm/fineract/values.yaml fineract helm/fineract --install --create-namespace --namespace fineract # helm test g2p-sandbox -n paymenthub From 8352b396b40a8cf797f71118882aaabd926eca3e Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Tue, 19 Dec 2023 13:57:05 +0530 Subject: [PATCH 079/144] helm deploy and helm test with wait time --- examples/bb-payments/test_entrypoint.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index c27112b..3e0bf38 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -47,7 +47,8 @@ helm repo add g2p-sandbox-1-3-1 https://fynarfin.io/images/ph-ee-g2psandbox-1.3. helm install my-ph-ee-g2psandbox g2p-sandbox-1-3-1/ph-ee-g2psandbox --version 1.3.1 -n paymenthub kubectl get pods -n paymenthub -helm test my-ph-ee-g2psandbox +helm list -n paymenthub +helm test my-ph-ee-g2psandbox --wait --timeout 300 # helm upgrade --install -f helm/govstack-chart/values.yaml g2p-sandbox helm/govstack-chart --create-namespace --namespace paymenthub # helm upgrade -f helm/fineract/values.yaml fineract helm/fineract --install --create-namespace --namespace fineract # helm test g2p-sandbox -n paymenthub From 4e747f81484d9b2c9f0c76c98a93f8d48478e266 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Tue, 19 Dec 2023 15:23:28 +0530 Subject: [PATCH 080/144] helm deploy and helm test with wait time --- examples/bb-payments/test_entrypoint.sh | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 3e0bf38..cec6fa9 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -1,18 +1,5 @@ #!/bin/bash #insatll kubectl -# apt-get update -# # apt-transport-https may be a dummy package; if so, you can skip that package -# apt-get install -y apt-transport-https ca-certificates curl gpg - -# curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.28/deb/Release.key | gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg - -# # This overwrites any existing configuration in /etc/apt/sources.list.d/kubernetes.list -# echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.28/deb/ /' | tee /etc/apt/sources.list.d/kubernetes.list - -# apt-get update -# apt-get install -y kubelet kubeadm kubectl -# apt-mark hold kubelet kubeadm kubectl -# kubectl version sudo apt-get update sudo apt-get install -y apt-transport-https ca-certificates curl gpg sudo mkdir -p /etc/apt/keyrings @@ -29,8 +16,6 @@ sudo dpkg -i minikube_latest_amd64.deb minikube start minikube kubectl -- get po -A #Interact with Minikube cluster -kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/main/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml -echo "service-monitor installed" # aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID && aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY && aws configure set default.region eu-central-1 # aws configure --profile playground curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null @@ -40,7 +25,7 @@ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm. sudo apt-get update sudo apt-get install helm #payment install -# kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/main/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml #Install ServiceMonitor +kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/main/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml #Install ServiceMonitor kubectl create namespace paymenthub kubectl get -A namespace helm repo add g2p-sandbox-1-3-1 https://fynarfin.io/images/ph-ee-g2psandbox-1.3.1/ @@ -48,7 +33,7 @@ helm install my-ph-ee-g2psandbox g2p-sandbox-1-3-1/ph-ee-g2psandbox --version 1. kubectl get pods -n paymenthub helm list -n paymenthub -helm test my-ph-ee-g2psandbox --wait --timeout 300 +helm test my-ph-ee-g2psandbox --timeout 300 # helm upgrade --install -f helm/govstack-chart/values.yaml g2p-sandbox helm/govstack-chart --create-namespace --namespace paymenthub # helm upgrade -f helm/fineract/values.yaml fineract helm/fineract --install --create-namespace --namespace fineract # helm test g2p-sandbox -n paymenthub From 2aa17a3de523618590ecd6c32c77d3fa439d840f Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Tue, 19 Dec 2023 15:26:35 +0530 Subject: [PATCH 081/144] helm deploy and helm test with wait time --- examples/bb-payments/test_entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index cec6fa9..e1ab69e 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -33,7 +33,7 @@ helm install my-ph-ee-g2psandbox g2p-sandbox-1-3-1/ph-ee-g2psandbox --version 1. kubectl get pods -n paymenthub helm list -n paymenthub -helm test my-ph-ee-g2psandbox --timeout 300 +helm test my-ph-ee-g2psandbox --timeout 10m # helm upgrade --install -f helm/govstack-chart/values.yaml g2p-sandbox helm/govstack-chart --create-namespace --namespace paymenthub # helm upgrade -f helm/fineract/values.yaml fineract helm/fineract --install --create-namespace --namespace fineract # helm test g2p-sandbox -n paymenthub From 34e9aa4da04e3f5bee7ce301c460da3adebeab9a Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Tue, 19 Dec 2023 15:29:06 +0530 Subject: [PATCH 082/144] helm deploy and helm test with wait time --- examples/bb-payments/test_entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index e1ab69e..67a6321 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -33,7 +33,7 @@ helm install my-ph-ee-g2psandbox g2p-sandbox-1-3-1/ph-ee-g2psandbox --version 1. kubectl get pods -n paymenthub helm list -n paymenthub -helm test my-ph-ee-g2psandbox --timeout 10m +helm test my-ph-ee-g2psandbox -n paymenthub --timeout 10m # helm upgrade --install -f helm/govstack-chart/values.yaml g2p-sandbox helm/govstack-chart --create-namespace --namespace paymenthub # helm upgrade -f helm/fineract/values.yaml fineract helm/fineract --install --create-namespace --namespace fineract # helm test g2p-sandbox -n paymenthub From 7882175e104956b8f017c329d157ac36240d36bd Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Tue, 19 Dec 2023 15:59:24 +0530 Subject: [PATCH 083/144] helm deploy and helm test with wait time --- examples/bb-payments/test_entrypoint.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 67a6321..f254df2 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -14,7 +14,7 @@ kubectl version curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_latest_amd64.deb sudo dpkg -i minikube_latest_amd64.deb minikube start - +minikube dashboard minikube kubectl -- get po -A #Interact with Minikube cluster # aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID && aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY && aws configure set default.region eu-central-1 # aws configure --profile playground @@ -33,7 +33,10 @@ helm install my-ph-ee-g2psandbox g2p-sandbox-1-3-1/ph-ee-g2psandbox --version 1. kubectl get pods -n paymenthub helm list -n paymenthub -helm test my-ph-ee-g2psandbox -n paymenthub --timeout 10m +helm test my-ph-ee-g2psandbox -n paymenthub --timeout 20m || echo test + +#Fetch Integration Test Report + # helm upgrade --install -f helm/govstack-chart/values.yaml g2p-sandbox helm/govstack-chart --create-namespace --namespace paymenthub # helm upgrade -f helm/fineract/values.yaml fineract helm/fineract --install --create-namespace --namespace fineract # helm test g2p-sandbox -n paymenthub From d0eccaae0121a472207713e00062d09db640bb58 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Tue, 19 Dec 2023 16:11:40 +0530 Subject: [PATCH 084/144] helm deploy and helm test with wait time --- examples/bb-payments/test_entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index f254df2..0e4e724 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -14,7 +14,7 @@ kubectl version curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_latest_amd64.deb sudo dpkg -i minikube_latest_amd64.deb minikube start -minikube dashboard +minikube dashboard & minikube kubectl -- get po -A #Interact with Minikube cluster # aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID && aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY && aws configure set default.region eu-central-1 # aws configure --profile playground From 550ac0803def455246c0f952084f9b6ee31f8a6b Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Tue, 19 Dec 2023 16:14:58 +0530 Subject: [PATCH 085/144] helm deploy and helm test with wait time --- examples/bb-payments/test_entrypoint.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 0e4e724..ebd8355 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -14,7 +14,6 @@ kubectl version curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_latest_amd64.deb sudo dpkg -i minikube_latest_amd64.deb minikube start -minikube dashboard & minikube kubectl -- get po -A #Interact with Minikube cluster # aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID && aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY && aws configure set default.region eu-central-1 # aws configure --profile playground From d05a6af63f8b37559adb4d4025da234dfa48979f Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Tue, 19 Dec 2023 16:27:16 +0530 Subject: [PATCH 086/144] helm deploy and helm test with wait time --- examples/bb-payments/test_entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index ebd8355..8bf9c5e 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -32,7 +32,7 @@ helm install my-ph-ee-g2psandbox g2p-sandbox-1-3-1/ph-ee-g2psandbox --version 1. kubectl get pods -n paymenthub helm list -n paymenthub -helm test my-ph-ee-g2psandbox -n paymenthub --timeout 20m || echo test +helm test my-ph-ee-g2psandbox -n paymenthub --timeout 10m || echo test #Fetch Integration Test Report From 9eaae959b81d56810c9c3fe26cc1c827f1a46a3c Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Tue, 19 Dec 2023 16:39:50 +0530 Subject: [PATCH 087/144] helm deploy and helm test with wait time --- examples/bb-payments/test_entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 8bf9c5e..f91981f 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -32,7 +32,7 @@ helm install my-ph-ee-g2psandbox g2p-sandbox-1-3-1/ph-ee-g2psandbox --version 1. kubectl get pods -n paymenthub helm list -n paymenthub -helm test my-ph-ee-g2psandbox -n paymenthub --timeout 10m || echo test +helm test my-ph-ee-g2psandbox -n paymenthub --timeout 10m #Fetch Integration Test Report From d594236bc8c78e42dc3218349282cbe4c2c2ce50 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Tue, 19 Dec 2023 16:57:21 +0530 Subject: [PATCH 088/144] helm deploy and helm test with wait time --- examples/bb-payments/test_entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index f91981f..2b00614 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -32,7 +32,7 @@ helm install my-ph-ee-g2psandbox g2p-sandbox-1-3-1/ph-ee-g2psandbox --version 1. kubectl get pods -n paymenthub helm list -n paymenthub -helm test my-ph-ee-g2psandbox -n paymenthub --timeout 10m +helm test my-ph-ee-g2psandbox -n paymenthub --timeout 8m #Fetch Integration Test Report From 70e979da913fcc6b1d76465d5fb6dc1bc0d8f4e8 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Wed, 20 Dec 2023 12:00:01 +0530 Subject: [PATCH 089/144] helm deploy and helm test with wait time --- examples/bb-payments/test_entrypoint.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 2b00614..0dd7dc0 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -28,11 +28,11 @@ kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheu kubectl create namespace paymenthub kubectl get -A namespace helm repo add g2p-sandbox-1-3-1 https://fynarfin.io/images/ph-ee-g2psandbox-1.3.1/ -helm install my-ph-ee-g2psandbox g2p-sandbox-1-3-1/ph-ee-g2psandbox --version 1.3.1 -n paymenthub +helm install ph-ee-g2psandbox g2p-sandbox-1-3-1/ph-ee-g2psandbox --version 1.3.1 -n paymenthub kubectl get pods -n paymenthub helm list -n paymenthub -helm test my-ph-ee-g2psandbox -n paymenthub --timeout 8m +helm test my-ph-ee-g2psandbox -n paymenthub --timeout 10m #Fetch Integration Test Report From 88989d1823d60531c1e5af5499bb23ab63ed19f4 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Wed, 20 Dec 2023 12:02:43 +0530 Subject: [PATCH 090/144] helm deploy and helm test with wait time --- examples/bb-payments/test_entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 0dd7dc0..5ba42a2 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -32,7 +32,7 @@ helm install ph-ee-g2psandbox g2p-sandbox-1-3-1/ph-ee-g2psandbox --version 1.3.1 kubectl get pods -n paymenthub helm list -n paymenthub -helm test my-ph-ee-g2psandbox -n paymenthub --timeout 10m +helm test ph-ee-g2psandbox -n paymenthub --timeout 10m #Fetch Integration Test Report From abcdcc927feeb44e21f5402f0737b148fbb81f33 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Wed, 20 Dec 2023 12:33:39 +0530 Subject: [PATCH 091/144] helm deploy and helm test with wait time --- examples/bb-payments/test_entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 5ba42a2..405a138 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -32,7 +32,7 @@ helm install ph-ee-g2psandbox g2p-sandbox-1-3-1/ph-ee-g2psandbox --version 1.3.1 kubectl get pods -n paymenthub helm list -n paymenthub -helm test ph-ee-g2psandbox -n paymenthub --timeout 10m +helm test ph-ee-g2psandbox -n paymenthub --timeout 8m #Fetch Integration Test Report From a46e7b83a14eb5f5717882bf61a4cfdf010d77cd Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Wed, 20 Dec 2023 12:59:37 +0530 Subject: [PATCH 092/144] helm deploy and helm test with wait time --- examples/bb-payments/test_entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 405a138..552a580 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -32,7 +32,7 @@ helm install ph-ee-g2psandbox g2p-sandbox-1-3-1/ph-ee-g2psandbox --version 1.3.1 kubectl get pods -n paymenthub helm list -n paymenthub -helm test ph-ee-g2psandbox -n paymenthub --timeout 8m +helm test ph-ee-g2psandbox -n paymenthub --timeout 5m #Fetch Integration Test Report From f396ebfce6730d13968e7672b3a53736940406e3 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Wed, 20 Dec 2023 13:10:03 +0530 Subject: [PATCH 093/144] helm deploy and helm test with wait time --- examples/bb-payments/test_entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 552a580..5ba42a2 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -32,7 +32,7 @@ helm install ph-ee-g2psandbox g2p-sandbox-1-3-1/ph-ee-g2psandbox --version 1.3.1 kubectl get pods -n paymenthub helm list -n paymenthub -helm test ph-ee-g2psandbox -n paymenthub --timeout 5m +helm test ph-ee-g2psandbox -n paymenthub --timeout 10m #Fetch Integration Test Report From aeedde1a0d82b08108205a545c95c1da43e4b7f5 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Wed, 20 Dec 2023 13:17:02 +0530 Subject: [PATCH 094/144] Create secret and deploy BPMN --- examples/bb-payments/test_entrypoint.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 5ba42a2..678e01f 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -30,6 +30,26 @@ kubectl get -A namespace helm repo add g2p-sandbox-1-3-1 https://fynarfin.io/images/ph-ee-g2psandbox-1.3.1/ helm install ph-ee-g2psandbox g2p-sandbox-1-3-1/ph-ee-g2psandbox --version 1.3.1 -n paymenthub +git clone -b 7.17 https://github.com/elastic/helm-charts.git elastic/helm-charts +cd elastic/helm-charts/elasticsearch/examples/security/ +make secrets || echo "elastic-secrets" already exists + +cd elastic/helm-charts/kibana/examples/security/ +make secrets || echo "kibana-secrets" already exists +#insatll netcat +apt install -y netcat +until nc -vz ph-ee-zeebe-ops 80; do echo "Waiting for zeebe-ops service"; sleep 2; done; + +#Deploy BPMN +kubectl port-forward service/ph-ee-zeebe-ops 5000:80 -n paymenthub & #portforward zeebe-ops &' +git clone https://github.com/openMF/ph-ee-env-labs.git openMF/ph-ee-env-labs +cd openMF/ph-ee-env-labs/orchestration +ls +sed -i "/HOST=/c\HOST=http://localhost:5000/zeebe/upload" deployBpmn.sh +cat deployBpmn.sh +cd .. +sh orchestration/deployBpmn.sh + kubectl get pods -n paymenthub helm list -n paymenthub helm test ph-ee-g2psandbox -n paymenthub --timeout 10m From a19bb24d8545498c81f2efe176124380152f0bb5 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Wed, 20 Dec 2023 15:37:47 +0530 Subject: [PATCH 095/144] Create secret and deploy BPMN --- examples/bb-payments/test_entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 678e01f..42338a0 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -38,7 +38,7 @@ cd elastic/helm-charts/kibana/examples/security/ make secrets || echo "kibana-secrets" already exists #insatll netcat apt install -y netcat -until nc -vz ph-ee-zeebe-ops 80; do echo "Waiting for zeebe-ops service"; sleep 2; done; +# until nc -vz ph-ee-zeebe-ops 80; do echo "Waiting for zeebe-ops service"; sleep 2; done; #Deploy BPMN kubectl port-forward service/ph-ee-zeebe-ops 5000:80 -n paymenthub & #portforward zeebe-ops &' From 5df793ad2b37488d3280f0640568bbcc1ec5ef4f Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Wed, 20 Dec 2023 16:26:09 +0530 Subject: [PATCH 096/144] Create secret and deploy BPMN --- examples/bb-payments/test_entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 42338a0..541f353 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -52,7 +52,7 @@ sh orchestration/deployBpmn.sh kubectl get pods -n paymenthub helm list -n paymenthub -helm test ph-ee-g2psandbox -n paymenthub --timeout 10m +helm test ph-ee-g2psandbox -n paymenthub --timeout 5m #Fetch Integration Test Report From 3d8fadac52a7e39e9cee370dbc5cf9d02b1ee28d Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Thu, 21 Dec 2023 12:46:09 +0530 Subject: [PATCH 097/144] test with wait time --- examples/bb-payments/test_entrypoint.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 541f353..1bfbc5e 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -28,7 +28,7 @@ kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheu kubectl create namespace paymenthub kubectl get -A namespace helm repo add g2p-sandbox-1-3-1 https://fynarfin.io/images/ph-ee-g2psandbox-1.3.1/ -helm install ph-ee-g2psandbox g2p-sandbox-1-3-1/ph-ee-g2psandbox --version 1.3.1 -n paymenthub +helm install ph-ee-g2psandbox g2p-sandbox-1-3-1/ph-ee-g2psandbox --version 1.3.1 -n paymenthub git clone -b 7.17 https://github.com/elastic/helm-charts.git elastic/helm-charts cd elastic/helm-charts/elasticsearch/examples/security/ @@ -52,7 +52,9 @@ sh orchestration/deployBpmn.sh kubectl get pods -n paymenthub helm list -n paymenthub -helm test ph-ee-g2psandbox -n paymenthub --timeout 5m +sleep 20m +kubectl get -A namespace paymenthub +helm test ph-ee-g2psandbox -n paymenthub --timeout 10m #Fetch Integration Test Report From 7294847c630067b20dd507eaabd1497829737d26 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Thu, 21 Dec 2023 13:33:07 +0530 Subject: [PATCH 098/144] test with wait time --- examples/bb-payments/test_entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 1bfbc5e..b7f81f3 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -54,7 +54,7 @@ kubectl get pods -n paymenthub helm list -n paymenthub sleep 20m kubectl get -A namespace paymenthub -helm test ph-ee-g2psandbox -n paymenthub --timeout 10m +helm test ph-ee-g2psandbox -n paymenthub --timeout 5m #Fetch Integration Test Report From 4f02049b1fd57086e8b721ef2c9804af8ba84c9b Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Thu, 21 Dec 2023 14:03:35 +0530 Subject: [PATCH 099/144] test with wait time --- examples/bb-payments/test_entrypoint.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index b7f81f3..8f8260e 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -52,9 +52,9 @@ sh orchestration/deployBpmn.sh kubectl get pods -n paymenthub helm list -n paymenthub -sleep 20m +sleep 30m kubectl get -A namespace paymenthub -helm test ph-ee-g2psandbox -n paymenthub --timeout 5m +helm test ph-ee-g2psandbox -n paymenthub --timeout 10m #Fetch Integration Test Report From fdc5107beec4d2d0f253ebebe8ce409502e2a771 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Thu, 21 Dec 2023 14:23:36 +0530 Subject: [PATCH 100/144] test with wait time after helm install --- examples/bb-payments/test_entrypoint.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 8f8260e..5be6ef6 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -28,7 +28,7 @@ kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheu kubectl create namespace paymenthub kubectl get -A namespace helm repo add g2p-sandbox-1-3-1 https://fynarfin.io/images/ph-ee-g2psandbox-1.3.1/ -helm install ph-ee-g2psandbox g2p-sandbox-1-3-1/ph-ee-g2psandbox --version 1.3.1 -n paymenthub +helm install ph-ee-g2psandbox g2p-sandbox-1-3-1/ph-ee-g2psandbox --version 1.3.1 -n paymenthub --wait 10m git clone -b 7.17 https://github.com/elastic/helm-charts.git elastic/helm-charts cd elastic/helm-charts/elasticsearch/examples/security/ @@ -52,7 +52,7 @@ sh orchestration/deployBpmn.sh kubectl get pods -n paymenthub helm list -n paymenthub -sleep 30m +# sleep 30m kubectl get -A namespace paymenthub helm test ph-ee-g2psandbox -n paymenthub --timeout 10m From 00f878610ba4a6276cda6525963bf6a55ca56ca4 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Thu, 21 Dec 2023 14:25:57 +0530 Subject: [PATCH 101/144] test with wait time after helm install --- examples/bb-payments/test_entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 5be6ef6..996f6ec 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -28,7 +28,7 @@ kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheu kubectl create namespace paymenthub kubectl get -A namespace helm repo add g2p-sandbox-1-3-1 https://fynarfin.io/images/ph-ee-g2psandbox-1.3.1/ -helm install ph-ee-g2psandbox g2p-sandbox-1-3-1/ph-ee-g2psandbox --version 1.3.1 -n paymenthub --wait 10m +helm install ph-ee-g2psandbox g2p-sandbox-1-3-1/ph-ee-g2psandbox --version 1.3.1 -n paymenthub --wait git clone -b 7.17 https://github.com/elastic/helm-charts.git elastic/helm-charts cd elastic/helm-charts/elasticsearch/examples/security/ From ef866e04771680fee3c93dabc14e780789ac5845 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Wed, 3 Jan 2024 11:15:42 +0530 Subject: [PATCH 102/144] increase delay time --- examples/bb-payments/test_entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 996f6ec..a870d82 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -52,7 +52,7 @@ sh orchestration/deployBpmn.sh kubectl get pods -n paymenthub helm list -n paymenthub -# sleep 30m +sleep 20m kubectl get -A namespace paymenthub helm test ph-ee-g2psandbox -n paymenthub --timeout 10m From b996d6ceaa688ee797bc9e82e573a7bd989ab47c Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Wed, 3 Jan 2024 11:32:51 +0530 Subject: [PATCH 103/144] increase delay time --- examples/bb-payments/test_entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index a870d82..200a3b6 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -28,7 +28,7 @@ kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheu kubectl create namespace paymenthub kubectl get -A namespace helm repo add g2p-sandbox-1-3-1 https://fynarfin.io/images/ph-ee-g2psandbox-1.3.1/ -helm install ph-ee-g2psandbox g2p-sandbox-1-3-1/ph-ee-g2psandbox --version 1.3.1 -n paymenthub --wait +helm install ph-ee-g2psandbox g2p-sandbox-1-3-1/ph-ee-g2psandbox --version 1.3.1 -n paymenthub git clone -b 7.17 https://github.com/elastic/helm-charts.git elastic/helm-charts cd elastic/helm-charts/elasticsearch/examples/security/ From 65f4e303d72f62d88790daec9fa7029c69923971 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Thu, 4 Jan 2024 12:56:44 +0530 Subject: [PATCH 104/144] helm deploy with wait time --- examples/bb-payments/test_entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 200a3b6..a870d82 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -28,7 +28,7 @@ kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheu kubectl create namespace paymenthub kubectl get -A namespace helm repo add g2p-sandbox-1-3-1 https://fynarfin.io/images/ph-ee-g2psandbox-1.3.1/ -helm install ph-ee-g2psandbox g2p-sandbox-1-3-1/ph-ee-g2psandbox --version 1.3.1 -n paymenthub +helm install ph-ee-g2psandbox g2p-sandbox-1-3-1/ph-ee-g2psandbox --version 1.3.1 -n paymenthub --wait git clone -b 7.17 https://github.com/elastic/helm-charts.git elastic/helm-charts cd elastic/helm-charts/elasticsearch/examples/security/ From 2197a405c1646b2e9934feb2a8d3dffc4f93f37b Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Thu, 4 Jan 2024 13:07:23 +0530 Subject: [PATCH 105/144] git clone ES timeout --- examples/bb-payments/test_entrypoint.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index a870d82..f3980e1 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -31,6 +31,7 @@ helm repo add g2p-sandbox-1-3-1 https://fynarfin.io/images/ph-ee-g2psandbox-1.3. helm install ph-ee-g2psandbox g2p-sandbox-1-3-1/ph-ee-g2psandbox --version 1.3.1 -n paymenthub --wait git clone -b 7.17 https://github.com/elastic/helm-charts.git elastic/helm-charts +timeout: 600 cd elastic/helm-charts/elasticsearch/examples/security/ make secrets || echo "elastic-secrets" already exists From 6c3a0719e7145337ff054241616fe55a5538c4ef Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Thu, 4 Jan 2024 13:21:16 +0530 Subject: [PATCH 106/144] describe pod to check the health --- examples/bb-payments/test_entrypoint.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index f3980e1..cd00876 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -52,6 +52,7 @@ cd .. sh orchestration/deployBpmn.sh kubectl get pods -n paymenthub +kubectl describe pod -n paymenthub `kubectl get pods | grep ph-ee-zeebe-ops |cut -d ' ' -f1` || echo ' ' helm list -n paymenthub sleep 20m kubectl get -A namespace paymenthub From 3da63fd3b02281974d030f751ad1c240d360229b Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Thu, 4 Jan 2024 13:41:50 +0530 Subject: [PATCH 107/144] describe pod to check the health --- examples/bb-payments/test_entrypoint.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index cd00876..0784d92 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -31,7 +31,7 @@ helm repo add g2p-sandbox-1-3-1 https://fynarfin.io/images/ph-ee-g2psandbox-1.3. helm install ph-ee-g2psandbox g2p-sandbox-1-3-1/ph-ee-g2psandbox --version 1.3.1 -n paymenthub --wait git clone -b 7.17 https://github.com/elastic/helm-charts.git elastic/helm-charts -timeout: 600 +sleep 300 cd elastic/helm-charts/elasticsearch/examples/security/ make secrets || echo "elastic-secrets" already exists @@ -52,11 +52,12 @@ cd .. sh orchestration/deployBpmn.sh kubectl get pods -n paymenthub -kubectl describe pod -n paymenthub `kubectl get pods | grep ph-ee-zeebe-ops |cut -d ' ' -f1` || echo ' ' +kubectl describe po -n paymenthub `kubectl get pods -n paymenthub | grep ph-ee-zeebe-ops |cut -d ' ' -f1` || echo ' ' helm list -n paymenthub sleep 20m -kubectl get -A namespace paymenthub -helm test ph-ee-g2psandbox -n paymenthub --timeout 10m +# kubectl get -A namespace paymenthub +kubectl get pods -n paymenthub +helm test ph-ee-g2psandbox -n paymenthub --timeout 30m #Fetch Integration Test Report From db6b74143bc0e83260534149adcb0847f7732758 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Thu, 4 Jan 2024 13:55:03 +0530 Subject: [PATCH 108/144] describe pod to check the health --- examples/bb-payments/test_entrypoint.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 0784d92..b8a408e 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -28,10 +28,11 @@ kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheu kubectl create namespace paymenthub kubectl get -A namespace helm repo add g2p-sandbox-1-3-1 https://fynarfin.io/images/ph-ee-g2psandbox-1.3.1/ -helm install ph-ee-g2psandbox g2p-sandbox-1-3-1/ph-ee-g2psandbox --version 1.3.1 -n paymenthub --wait +helm install ph-ee-g2psandbox g2p-sandbox-1-3-1/ph-ee-g2psandbox --version 1.3.1 -n paymenthub +sleep 300 git clone -b 7.17 https://github.com/elastic/helm-charts.git elastic/helm-charts -sleep 300 +# sleep 300 cd elastic/helm-charts/elasticsearch/examples/security/ make secrets || echo "elastic-secrets" already exists From dcdcf57dc651131118e780b6d3691f1b6946bcc2 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Thu, 4 Jan 2024 14:06:10 +0530 Subject: [PATCH 109/144] wait for the pods and git clone for kibana --- examples/bb-payments/test_entrypoint.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index b8a408e..d45d01c 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -30,12 +30,13 @@ kubectl get -A namespace helm repo add g2p-sandbox-1-3-1 https://fynarfin.io/images/ph-ee-g2psandbox-1.3.1/ helm install ph-ee-g2psandbox g2p-sandbox-1-3-1/ph-ee-g2psandbox --version 1.3.1 -n paymenthub sleep 300 +kubectl get pods -n paymenthub git clone -b 7.17 https://github.com/elastic/helm-charts.git elastic/helm-charts # sleep 300 cd elastic/helm-charts/elasticsearch/examples/security/ make secrets || echo "elastic-secrets" already exists - +git clone -b 7.17 https://github.com/elastic/helm-charts.git elastic/helm-charts cd elastic/helm-charts/kibana/examples/security/ make secrets || echo "kibana-secrets" already exists #insatll netcat From fa3fb4574aa8ede9fb04c260c3a06d9abdbe24da Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Thu, 4 Jan 2024 14:55:37 +0530 Subject: [PATCH 110/144] wait for the pods and git clone for kibana --- examples/bb-payments/test_entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index d45d01c..bc6290b 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -55,7 +55,7 @@ sh orchestration/deployBpmn.sh kubectl get pods -n paymenthub kubectl describe po -n paymenthub `kubectl get pods -n paymenthub | grep ph-ee-zeebe-ops |cut -d ' ' -f1` || echo ' ' -helm list -n paymenthub +# helm list -n paymenthub sleep 20m # kubectl get -A namespace paymenthub kubectl get pods -n paymenthub From 2ec072192b1e8970633ac691a8142a74ae79b87f Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Thu, 4 Jan 2024 15:40:08 +0530 Subject: [PATCH 111/144] wait for the pods and git clone for kibana --- examples/bb-payments/test_entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index bc6290b..5886af9 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -56,7 +56,7 @@ sh orchestration/deployBpmn.sh kubectl get pods -n paymenthub kubectl describe po -n paymenthub `kubectl get pods -n paymenthub | grep ph-ee-zeebe-ops |cut -d ' ' -f1` || echo ' ' # helm list -n paymenthub -sleep 20m +# sleep 20m # kubectl get -A namespace paymenthub kubectl get pods -n paymenthub helm test ph-ee-g2psandbox -n paymenthub --timeout 30m From cbf8e59d41b193048f3d73e26a8246ffe7aeafa5 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Thu, 4 Jan 2024 16:24:01 +0530 Subject: [PATCH 112/144] wait for the pods and git clone for kibana --- examples/bb-payments/test_entrypoint.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 5886af9..b436679 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -60,6 +60,7 @@ kubectl describe po -n paymenthub `kubectl get pods -n paymenthub | grep ph-ee-z # kubectl get -A namespace paymenthub kubectl get pods -n paymenthub helm test ph-ee-g2psandbox -n paymenthub --timeout 30m +no_output_timeout=900 #Fetch Integration Test Report From e599be7f15b8df1d96dc38485d26bb6a6d9c2ffe Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Thu, 4 Jan 2024 18:32:10 +0530 Subject: [PATCH 113/144] wait for the pods and git clone for kibana --- examples/bb-payments/test_entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index b436679..66fc522 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -59,7 +59,7 @@ kubectl describe po -n paymenthub `kubectl get pods -n paymenthub | grep ph-ee-z # sleep 20m # kubectl get -A namespace paymenthub kubectl get pods -n paymenthub -helm test ph-ee-g2psandbox -n paymenthub --timeout 30m +helm test ph-ee-g2psandbox -n paymenthub --timeout 5m no_output_timeout=900 #Fetch Integration Test Report From c041e503bcf563823efd7e5ac2b39645d05afed0 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Fri, 5 Jan 2024 11:58:31 +0530 Subject: [PATCH 114/144] wait for test to complete --- examples/bb-payments/test_entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 66fc522..fdd2a61 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -59,7 +59,7 @@ kubectl describe po -n paymenthub `kubectl get pods -n paymenthub | grep ph-ee-z # sleep 20m # kubectl get -A namespace paymenthub kubectl get pods -n paymenthub -helm test ph-ee-g2psandbox -n paymenthub --timeout 5m +helm test ph-ee-g2psandbox -n paymenthub --timeout 30m no_output_timeout=900 #Fetch Integration Test Report From 0416957357f5118d463ea95700b61e151fb2d0f6 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Fri, 5 Jan 2024 12:12:45 +0530 Subject: [PATCH 115/144] store the result --- examples/bb-payments/test_entrypoint.sh | 37 +++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index fdd2a61..68dcc50 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -62,6 +62,43 @@ kubectl get pods -n paymenthub helm test ph-ee-g2psandbox -n paymenthub --timeout 30m no_output_timeout=900 +#fetch report +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..." + +# Function to store test results +store_test_results() { + echo "Storing test results from cucumber.xml..." + cp integration_report/test-report/cucumber.xml /path/to/destination/cucumber.xml +} + +# Function to store artifacts +store_artifacts() { + echo "Storing artifacts from tests..." + cp -r integration_report/test-report/reports/tests/test /path/to/destination/test_artifacts +} + +# Main script +main() { + store_test_results + store_artifacts +} + +# Run the script +main + +# 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 + #Fetch Integration Test Report # helm upgrade --install -f helm/govstack-chart/values.yaml g2p-sandbox helm/govstack-chart --create-namespace --namespace paymenthub From eedbc36828658bafbf71fe84c43087bcb5202862 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Fri, 5 Jan 2024 12:32:17 +0530 Subject: [PATCH 116/144] check for secrets and configmap --- examples/bb-payments/test_entrypoint.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 68dcc50..1732bbe 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -39,10 +39,11 @@ make secrets || echo "elastic-secrets" already exists git clone -b 7.17 https://github.com/elastic/helm-charts.git elastic/helm-charts cd elastic/helm-charts/kibana/examples/security/ make secrets || echo "kibana-secrets" already exists +kubectl get secrets -n paymenthub +kubectl get configmap -n paymenthub #insatll netcat apt install -y netcat # until nc -vz ph-ee-zeebe-ops 80; do echo "Waiting for zeebe-ops service"; sleep 2; done; - #Deploy BPMN kubectl port-forward service/ph-ee-zeebe-ops 5000:80 -n paymenthub & #portforward zeebe-ops &' git clone https://github.com/openMF/ph-ee-env-labs.git openMF/ph-ee-env-labs @@ -56,10 +57,10 @@ sh orchestration/deployBpmn.sh kubectl get pods -n paymenthub kubectl describe po -n paymenthub `kubectl get pods -n paymenthub | grep ph-ee-zeebe-ops |cut -d ' ' -f1` || echo ' ' # helm list -n paymenthub -# sleep 20m +# sleep 10m # kubectl get -A namespace paymenthub kubectl get pods -n paymenthub -helm test ph-ee-g2psandbox -n paymenthub --timeout 30m +helm test ph-ee-g2psandbox -n paymenthub --timeout 10m no_output_timeout=900 #fetch report From 004c791ddbfdff08843231239e782c216d808f28 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Fri, 5 Jan 2024 12:41:27 +0530 Subject: [PATCH 117/144] check for secrets and configmap --- examples/bb-payments/test_entrypoint.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 1732bbe..938949b 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -39,8 +39,9 @@ make secrets || echo "elastic-secrets" already exists git clone -b 7.17 https://github.com/elastic/helm-charts.git elastic/helm-charts cd elastic/helm-charts/kibana/examples/security/ make secrets || echo "kibana-secrets" already exists -kubectl get secrets -n paymenthub -kubectl get configmap -n paymenthub +kubectl get -A secrets +kubectl get -A configmap + #insatll netcat apt install -y netcat # until nc -vz ph-ee-zeebe-ops 80; do echo "Waiting for zeebe-ops service"; sleep 2; done; From 5d42c7553ea8a33aee7e3a076946cf3f890b4005 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Fri, 5 Jan 2024 12:50:13 +0530 Subject: [PATCH 118/144] check for secrets and configmap in ph NS --- examples/bb-payments/test_entrypoint.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 938949b..acaff02 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -29,19 +29,19 @@ kubectl create namespace paymenthub kubectl get -A namespace helm repo add g2p-sandbox-1-3-1 https://fynarfin.io/images/ph-ee-g2psandbox-1.3.1/ helm install ph-ee-g2psandbox g2p-sandbox-1-3-1/ph-ee-g2psandbox --version 1.3.1 -n paymenthub -sleep 300 -kubectl get pods -n paymenthub git clone -b 7.17 https://github.com/elastic/helm-charts.git elastic/helm-charts # sleep 300 cd elastic/helm-charts/elasticsearch/examples/security/ -make secrets || echo "elastic-secrets" already exists +make secrets -n paymenthub || echo "elastic-secrets" already exists git clone -b 7.17 https://github.com/elastic/helm-charts.git elastic/helm-charts cd elastic/helm-charts/kibana/examples/security/ -make secrets || echo "kibana-secrets" already exists +make secrets -n paymenthub || echo "kibana-secrets" already exists kubectl get -A secrets kubectl get -A configmap +sleep 300 +kubectl get pods -n paymenthub #insatll netcat apt install -y netcat # until nc -vz ph-ee-zeebe-ops 80; do echo "Waiting for zeebe-ops service"; sleep 2; done; From 0b87707d2faacfae435a9bb7a9340c99eef6a7a5 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Fri, 5 Jan 2024 13:32:38 +0530 Subject: [PATCH 119/144] check for secrets and configmap in ph NS --- examples/bb-payments/test_entrypoint.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index acaff02..70550d4 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -33,10 +33,15 @@ helm install ph-ee-g2psandbox g2p-sandbox-1-3-1/ph-ee-g2psandbox --version 1.3.1 git clone -b 7.17 https://github.com/elastic/helm-charts.git elastic/helm-charts # sleep 300 cd elastic/helm-charts/elasticsearch/examples/security/ -make secrets -n paymenthub || echo "elastic-secrets" already exists +make secrets || echo "elastic-secrets" already exists git clone -b 7.17 https://github.com/elastic/helm-charts.git elastic/helm-charts cd elastic/helm-charts/kibana/examples/security/ -make secrets -n paymenthub || echo "kibana-secrets" already exists +make secrets || echo "kibana-secrets" already exists +kubectl get secret elastic-certificate-crt -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - +kubectl get secret elastic-certificate-pem -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - +kubectl get secret elastic-certificates -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - +kubectl get secret elastic-credentials -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - +kubectl get secret kibana -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - kubectl get -A secrets kubectl get -A configmap From 0f90b7b4b562cdfbe8ee450439020013fa9db314 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Fri, 5 Jan 2024 14:25:41 +0530 Subject: [PATCH 120/144] check for secrets and configmap in ph NS --- examples/bb-payments/test_entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 70550d4..8d9141f 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -66,7 +66,7 @@ kubectl describe po -n paymenthub `kubectl get pods -n paymenthub | grep ph-ee-z # sleep 10m # kubectl get -A namespace paymenthub kubectl get pods -n paymenthub -helm test ph-ee-g2psandbox -n paymenthub --timeout 10m +helm test ph-ee-g2psandbox -n paymenthub --timeout 5m no_output_timeout=900 #fetch report From a2f4c2927006a1ecacbb5123df08477c9c69b731 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Fri, 5 Jan 2024 14:58:32 +0530 Subject: [PATCH 121/144] check for secrets and configmap in ph NS --- examples/bb-payments/test_entrypoint.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 8d9141f..455ba5b 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -45,7 +45,7 @@ kubectl get secret kibana -n default -o yaml | sed 's/namespace: default/namespa kubectl get -A secrets kubectl get -A configmap -sleep 300 +sleep 10m kubectl get pods -n paymenthub #insatll netcat apt install -y netcat @@ -66,7 +66,7 @@ kubectl describe po -n paymenthub `kubectl get pods -n paymenthub | grep ph-ee-z # sleep 10m # kubectl get -A namespace paymenthub kubectl get pods -n paymenthub -helm test ph-ee-g2psandbox -n paymenthub --timeout 5m +helm test ph-ee-g2psandbox -n paymenthub # --timeout 5m no_output_timeout=900 #fetch report From f74f0651071bcac1dc92dc6231b34ef0ee804391 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Fri, 5 Jan 2024 15:46:56 +0530 Subject: [PATCH 122/144] check for secrets and configmap in ph NS --- examples/bb-payments/test_entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 455ba5b..2924817 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -66,7 +66,7 @@ kubectl describe po -n paymenthub `kubectl get pods -n paymenthub | grep ph-ee-z # sleep 10m # kubectl get -A namespace paymenthub kubectl get pods -n paymenthub -helm test ph-ee-g2psandbox -n paymenthub # --timeout 5m +helm test ph-ee-g2psandbox -n paymenthub --timeout 5m no_output_timeout=900 #fetch report From 3c1e2ab0a0bfbd780a1cf560c686e0f56b67605c Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Fri, 5 Jan 2024 16:00:35 +0530 Subject: [PATCH 123/144] check for secrets and configmap in ph NS --- examples/bb-payments/test_entrypoint.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 2924817..d2c0054 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -42,10 +42,10 @@ kubectl get secret elastic-certificate-pem -n default -o yaml | sed 's/namespace kubectl get secret elastic-certificates -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - kubectl get secret elastic-credentials -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - kubectl get secret kibana -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - -kubectl get -A secrets -kubectl get -A configmap +kubectl get secrets -n paymenthub +kubectl get configmap -n paymenthub -sleep 10m +sleep 5m kubectl get pods -n paymenthub #insatll netcat apt install -y netcat From b1cdd75940141c2ccffed087ff177c10872a5627 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Fri, 5 Jan 2024 19:55:11 +0530 Subject: [PATCH 124/144] check for secrets and configmap in ph NS --- examples/bb-payments/test_entrypoint.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index d2c0054..2fa8bd7 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -1,5 +1,6 @@ #!/bin/bash #insatll kubectl +echo hello sudo apt-get update sudo apt-get install -y apt-transport-https ca-certificates curl gpg sudo mkdir -p /etc/apt/keyrings From 72212f3f2f1081b2bc09cd3dda9f62b98b361884 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Sat, 6 Jan 2024 09:04:11 +0530 Subject: [PATCH 125/144] store test result --- examples/bb-payments/test_entrypoint.sh | 27 ++++++++++++------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 2fa8bd7..0fcaa10 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -16,8 +16,7 @@ curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_latest sudo dpkg -i minikube_latest_amd64.deb minikube start minikube kubectl -- get po -A #Interact with Minikube cluster -# aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID && aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY && aws configure set default.region eu-central-1 -# aws configure --profile playground + curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null sudo apt-get install apt-transport-https --yes echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list @@ -71,18 +70,18 @@ helm test ph-ee-g2psandbox -n paymenthub --timeout 5m no_output_timeout=900 #fetch report -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..." +# 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..." # Function to store test results store_test_results() { From 2b9c39bc93e27e853d71d67920c864a6ba148ad2 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Sat, 6 Jan 2024 09:24:31 +0530 Subject: [PATCH 126/144] store test result --- examples/bb-payments/test_entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 0fcaa10..f3047a3 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -45,7 +45,7 @@ kubectl get secret kibana -n default -o yaml | sed 's/namespace: default/namespa kubectl get secrets -n paymenthub kubectl get configmap -n paymenthub -sleep 5m +# sleep 5m kubectl get pods -n paymenthub #insatll netcat apt install -y netcat From 166d338f61166ef147f05c8acd7ea67fc5045bdf Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Wed, 10 Jan 2024 18:50:15 +0530 Subject: [PATCH 127/144] add steps to entrypoint.sh --- examples/bb-payments/entrypoint.sh | 65 ++++++++++++++ examples/bb-payments/test_entrypoint.sh | 110 +----------------------- 2 files changed, 66 insertions(+), 109 deletions(-) create mode 100644 examples/bb-payments/entrypoint.sh diff --git a/examples/bb-payments/entrypoint.sh b/examples/bb-payments/entrypoint.sh new file mode 100644 index 0000000..38452a3 --- /dev/null +++ b/examples/bb-payments/entrypoint.sh @@ -0,0 +1,65 @@ +#!/bin/bash +#insatll kubectl +echo hello +sudo apt-get update +sudo apt-get install -y apt-transport-https ca-certificates curl gpg +sudo mkdir -p /etc/apt/keyrings +sudo touch -y /etc/apt/keyrings/kubernetes-apt-keyring.gpg +curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.28/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg +echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.28/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list +sudo apt-get update +sudo apt-get install -y kubelet kubeadm kubectl +sudo apt-mark hold kubelet kubeadm kubectl +kubectl version +#Setup Minikube +curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_latest_amd64.deb +sudo dpkg -i minikube_latest_amd64.deb +minikube start +minikube kubectl -- get po -A #Interact with Minikube cluster + +curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null +sudo apt-get install apt-transport-https --yes +echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list +#helm install +sudo apt-get update +sudo apt-get install helm +#payment install +kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/main/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml #Install ServiceMonitor +kubectl create namespace paymenthub +kubectl get -A namespace +helm repo add g2p-sandbox-1-3-1 https://fynarfin.io/images/ph-ee-g2psandbox-1.3.1/ +helm install ph-ee-g2psandbox g2p-sandbox-1-3-1/ph-ee-g2psandbox --version 1.3.1 -n paymenthub + +git clone -b 7.17 https://github.com/elastic/helm-charts.git elastic/helm-charts +# sleep 300 +cd elastic/helm-charts/elasticsearch/examples/security/ +make secrets || echo "elastic-secrets" already exists +git clone -b 7.17 https://github.com/elastic/helm-charts.git elastic/helm-charts +cd elastic/helm-charts/kibana/examples/security/ +make secrets || echo "kibana-secrets" already exists +kubectl get secret elastic-certificate-crt -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - +kubectl get secret elastic-certificate-pem -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - +kubectl get secret elastic-certificates -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - +kubectl get secret elastic-credentials -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - +kubectl get secret kibana -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - +kubectl get secrets -n paymenthub +kubectl get configmap -n paymenthub + +# sleep 5m +kubectl get pods -n paymenthub +#insatll netcat +apt install -y netcat +# until nc -vz ph-ee-zeebe-ops 80; do echo "Waiting for zeebe-ops service"; sleep 2; done; +#Deploy BPMN +kubectl port-forward service/ph-ee-zeebe-ops 5000:80 -n paymenthub & #portforward zeebe-ops &' +git clone https://github.com/openMF/ph-ee-env-labs.git openMF/ph-ee-env-labs +cd openMF/ph-ee-env-labs/orchestration +ls +sed -i "/HOST=/c\HOST=http://localhost:5000/zeebe/upload" deployBpmn.sh +cat deployBpmn.sh +cd .. +sh orchestration/deployBpmn.sh + +kubectl get pods -n paymenthub +# kubectl describe po -n paymenthub `kubectl get pods -n paymenthub | grep ph-ee-zeebe-ops |cut -d ' ' -f1` || echo ' ' +# helm list -n paymenthub \ No newline at end of file diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index f3047a3..147bfdb 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -1,113 +1,5 @@ #!/bin/bash -#insatll kubectl -echo hello -sudo apt-get update -sudo apt-get install -y apt-transport-https ca-certificates curl gpg -sudo mkdir -p /etc/apt/keyrings -sudo touch -y /etc/apt/keyrings/kubernetes-apt-keyring.gpg -curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.28/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg -echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.28/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list -sudo apt-get update -sudo apt-get install -y kubelet kubeadm kubectl -sudo apt-mark hold kubelet kubeadm kubectl -kubectl version -#Setup Minikube -curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_latest_amd64.deb -sudo dpkg -i minikube_latest_amd64.deb -minikube start -minikube kubectl -- get po -A #Interact with Minikube cluster - -curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null -sudo apt-get install apt-transport-https --yes -echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list -#helm install -sudo apt-get update -sudo apt-get install helm -#payment install -kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/main/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml #Install ServiceMonitor -kubectl create namespace paymenthub -kubectl get -A namespace -helm repo add g2p-sandbox-1-3-1 https://fynarfin.io/images/ph-ee-g2psandbox-1.3.1/ -helm install ph-ee-g2psandbox g2p-sandbox-1-3-1/ph-ee-g2psandbox --version 1.3.1 -n paymenthub - -git clone -b 7.17 https://github.com/elastic/helm-charts.git elastic/helm-charts -# sleep 300 -cd elastic/helm-charts/elasticsearch/examples/security/ -make secrets || echo "elastic-secrets" already exists -git clone -b 7.17 https://github.com/elastic/helm-charts.git elastic/helm-charts -cd elastic/helm-charts/kibana/examples/security/ -make secrets || echo "kibana-secrets" already exists -kubectl get secret elastic-certificate-crt -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - -kubectl get secret elastic-certificate-pem -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - -kubectl get secret elastic-certificates -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - -kubectl get secret elastic-credentials -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - -kubectl get secret kibana -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - -kubectl get secrets -n paymenthub -kubectl get configmap -n paymenthub - -# sleep 5m -kubectl get pods -n paymenthub -#insatll netcat -apt install -y netcat -# until nc -vz ph-ee-zeebe-ops 80; do echo "Waiting for zeebe-ops service"; sleep 2; done; -#Deploy BPMN -kubectl port-forward service/ph-ee-zeebe-ops 5000:80 -n paymenthub & #portforward zeebe-ops &' -git clone https://github.com/openMF/ph-ee-env-labs.git openMF/ph-ee-env-labs -cd openMF/ph-ee-env-labs/orchestration -ls -sed -i "/HOST=/c\HOST=http://localhost:5000/zeebe/upload" deployBpmn.sh -cat deployBpmn.sh -cd .. -sh orchestration/deployBpmn.sh - -kubectl get pods -n paymenthub -kubectl describe po -n paymenthub `kubectl get pods -n paymenthub | grep ph-ee-zeebe-ops |cut -d ' ' -f1` || echo ' ' -# helm list -n paymenthub -# sleep 10m -# kubectl get -A namespace paymenthub kubectl get pods -n paymenthub helm test ph-ee-g2psandbox -n paymenthub --timeout 5m -no_output_timeout=900 - -#fetch report -# 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..." - -# Function to store test results -store_test_results() { - echo "Storing test results from cucumber.xml..." - cp integration_report/test-report/cucumber.xml /path/to/destination/cucumber.xml -} - -# Function to store artifacts -store_artifacts() { - echo "Storing artifacts from tests..." - cp -r integration_report/test-report/reports/tests/test /path/to/destination/test_artifacts -} - -# Main script -main() { - store_test_results - store_artifacts -} - -# Run the script -main - -# 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 - -#Fetch Integration Test Report +# no_output_timeout=900 -# helm upgrade --install -f helm/govstack-chart/values.yaml g2p-sandbox helm/govstack-chart --create-namespace --namespace paymenthub -# helm upgrade -f helm/fineract/values.yaml fineract helm/fineract --install --create-namespace --namespace fineract -# helm test g2p-sandbox -n paymenthub From 43c4d644241353c80c1ee142d37407f43af13179 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Thu, 11 Jan 2024 16:06:14 +0530 Subject: [PATCH 128/144] install kubectl and helm --- examples/bb-payments/test_entrypoint.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 147bfdb..742e266 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -1,4 +1,17 @@ #!/bin/bash +sudo apt-get update +sudo apt-get install -y apt-transport-https ca-certificates curl gpg +sudo mkdir -p /etc/apt/keyrings +sudo touch -y /etc/apt/keyrings/kubernetes-apt-keyring.gpg +curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.28/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg +echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.28/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list +sudo apt-get update +sudo apt-get install -y kubelet kubeadm kubectl +sudo apt-mark hold kubelet kubeadm kubectl +#helm install +sudo apt-get update +sudo apt-get install helm + kubectl get pods -n paymenthub helm test ph-ee-g2psandbox -n paymenthub --timeout 5m # no_output_timeout=900 From c7798b754dff97696eb3ef21a53bf24587f42a44 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Thu, 11 Jan 2024 16:08:07 +0530 Subject: [PATCH 129/144] install kubectl and helm --- examples/bb-payments/test_entrypoint.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 742e266..7c8af54 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -9,6 +9,10 @@ sudo apt-get update sudo apt-get install -y kubelet kubeadm kubectl sudo apt-mark hold kubelet kubeadm kubectl #helm install +curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null +sudo apt-get install apt-transport-https --yes +echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list + sudo apt-get update sudo apt-get install helm From b9cd74dd23f5dc5472e298d36f0d68011c409f51 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Thu, 11 Jan 2024 16:10:29 +0530 Subject: [PATCH 130/144] install kubectl and helm --- examples/bb-payments/test_entrypoint.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 7c8af54..2202d07 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -1,4 +1,5 @@ #!/bin/bash +chmod u+x entrypoint.sh sudo apt-get update sudo apt-get install -y apt-transport-https ca-certificates curl gpg sudo mkdir -p /etc/apt/keyrings From a8fa018172f90c3e869b9e610980061b783ff881 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Thu, 11 Jan 2024 16:19:40 +0530 Subject: [PATCH 131/144] install kubectl and helm --- examples/bb-payments/test_entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 2202d07..01fe214 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -3,7 +3,7 @@ chmod u+x entrypoint.sh sudo apt-get update sudo apt-get install -y apt-transport-https ca-certificates curl gpg sudo mkdir -p /etc/apt/keyrings -sudo touch -y /etc/apt/keyrings/kubernetes-apt-keyring.gpg +sudo touch /etc/apt/keyrings/kubernetes-apt-keyring.gpg curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.28/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.28/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list sudo apt-get update From 07f8a3a240d2371018ce9cbfb53ccad4beb67e58 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Thu, 11 Jan 2024 16:24:07 +0530 Subject: [PATCH 132/144] install kubectl and helm --- examples/bb-payments/test_entrypoint.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 01fe214..4fa7446 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -3,6 +3,7 @@ chmod u+x entrypoint.sh sudo apt-get update sudo apt-get install -y apt-transport-https ca-certificates curl gpg sudo mkdir -p /etc/apt/keyrings +echo hello sudo touch /etc/apt/keyrings/kubernetes-apt-keyring.gpg curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.28/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.28/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list From 1c6e2c001460c970686ee9fc5ee513c5b821057d Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Thu, 11 Jan 2024 16:25:08 +0530 Subject: [PATCH 133/144] install kubectl and helm --- examples/bb-payments/test_entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 4fa7446..a624b53 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -4,7 +4,7 @@ sudo apt-get update sudo apt-get install -y apt-transport-https ca-certificates curl gpg sudo mkdir -p /etc/apt/keyrings echo hello -sudo touch /etc/apt/keyrings/kubernetes-apt-keyring.gpg +sudo touch -y /etc/apt/keyrings/kubernetes-apt-keyring.gpg curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.28/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.28/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list sudo apt-get update From d0e1d04d697e9f6b2311b8254ed19cf05a981609 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Thu, 11 Jan 2024 17:30:43 +0530 Subject: [PATCH 134/144] install kubectl and helm --- examples/bb-payments/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bb-payments/entrypoint.sh b/examples/bb-payments/entrypoint.sh index 38452a3..5999551 100644 --- a/examples/bb-payments/entrypoint.sh +++ b/examples/bb-payments/entrypoint.sh @@ -16,7 +16,7 @@ curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_latest sudo dpkg -i minikube_latest_amd64.deb minikube start minikube kubectl -- get po -A #Interact with Minikube cluster - +echo minikube started curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null sudo apt-get install apt-transport-https --yes echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list From 61c120d553413b5bf65f540f9ce49b9d3d43c39c Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Thu, 11 Jan 2024 17:32:33 +0530 Subject: [PATCH 135/144] install kubectl and helm --- examples/bb-payments/entrypoint.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/bb-payments/entrypoint.sh b/examples/bb-payments/entrypoint.sh index 5999551..883822c 100644 --- a/examples/bb-payments/entrypoint.sh +++ b/examples/bb-payments/entrypoint.sh @@ -15,6 +15,7 @@ kubectl version curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_latest_amd64.deb sudo dpkg -i minikube_latest_amd64.deb minikube start +sleep 60 minikube kubectl -- get po -A #Interact with Minikube cluster echo minikube started curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null From a10112d75fe0240348810c1a12887acd85ab871a Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Thu, 11 Jan 2024 17:38:12 +0530 Subject: [PATCH 136/144] install kubectl and helm --- examples/bb-payments/entrypoint.sh | 66 ------------------------- examples/bb-payments/test_entrypoint.sh | 54 ++++++++++++++++++-- 2 files changed, 50 insertions(+), 70 deletions(-) delete mode 100644 examples/bb-payments/entrypoint.sh diff --git a/examples/bb-payments/entrypoint.sh b/examples/bb-payments/entrypoint.sh deleted file mode 100644 index 883822c..0000000 --- a/examples/bb-payments/entrypoint.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/bash -#insatll kubectl -echo hello -sudo apt-get update -sudo apt-get install -y apt-transport-https ca-certificates curl gpg -sudo mkdir -p /etc/apt/keyrings -sudo touch -y /etc/apt/keyrings/kubernetes-apt-keyring.gpg -curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.28/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg -echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.28/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list -sudo apt-get update -sudo apt-get install -y kubelet kubeadm kubectl -sudo apt-mark hold kubelet kubeadm kubectl -kubectl version -#Setup Minikube -curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_latest_amd64.deb -sudo dpkg -i minikube_latest_amd64.deb -minikube start -sleep 60 -minikube kubectl -- get po -A #Interact with Minikube cluster -echo minikube started -curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null -sudo apt-get install apt-transport-https --yes -echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list -#helm install -sudo apt-get update -sudo apt-get install helm -#payment install -kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/main/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml #Install ServiceMonitor -kubectl create namespace paymenthub -kubectl get -A namespace -helm repo add g2p-sandbox-1-3-1 https://fynarfin.io/images/ph-ee-g2psandbox-1.3.1/ -helm install ph-ee-g2psandbox g2p-sandbox-1-3-1/ph-ee-g2psandbox --version 1.3.1 -n paymenthub - -git clone -b 7.17 https://github.com/elastic/helm-charts.git elastic/helm-charts -# sleep 300 -cd elastic/helm-charts/elasticsearch/examples/security/ -make secrets || echo "elastic-secrets" already exists -git clone -b 7.17 https://github.com/elastic/helm-charts.git elastic/helm-charts -cd elastic/helm-charts/kibana/examples/security/ -make secrets || echo "kibana-secrets" already exists -kubectl get secret elastic-certificate-crt -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - -kubectl get secret elastic-certificate-pem -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - -kubectl get secret elastic-certificates -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - -kubectl get secret elastic-credentials -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - -kubectl get secret kibana -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - -kubectl get secrets -n paymenthub -kubectl get configmap -n paymenthub - -# sleep 5m -kubectl get pods -n paymenthub -#insatll netcat -apt install -y netcat -# until nc -vz ph-ee-zeebe-ops 80; do echo "Waiting for zeebe-ops service"; sleep 2; done; -#Deploy BPMN -kubectl port-forward service/ph-ee-zeebe-ops 5000:80 -n paymenthub & #portforward zeebe-ops &' -git clone https://github.com/openMF/ph-ee-env-labs.git openMF/ph-ee-env-labs -cd openMF/ph-ee-env-labs/orchestration -ls -sed -i "/HOST=/c\HOST=http://localhost:5000/zeebe/upload" deployBpmn.sh -cat deployBpmn.sh -cd .. -sh orchestration/deployBpmn.sh - -kubectl get pods -n paymenthub -# kubectl describe po -n paymenthub `kubectl get pods -n paymenthub | grep ph-ee-zeebe-ops |cut -d ' ' -f1` || echo ' ' -# helm list -n paymenthub \ No newline at end of file diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index a624b53..3df45fa 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -1,22 +1,68 @@ #!/bin/bash -chmod u+x entrypoint.sh +echo hello sudo apt-get update sudo apt-get install -y apt-transport-https ca-certificates curl gpg sudo mkdir -p /etc/apt/keyrings -echo hello sudo touch -y /etc/apt/keyrings/kubernetes-apt-keyring.gpg curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.28/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.28/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list sudo apt-get update sudo apt-get install -y kubelet kubeadm kubectl sudo apt-mark hold kubelet kubeadm kubectl -#helm install +kubectl version +#Setup Minikube +curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_latest_amd64.deb +sudo dpkg -i minikube_latest_amd64.deb +minikube start +sleep 60 +minikube kubectl -- get po -A #Interact with Minikube cluster +echo minikube started curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null sudo apt-get install apt-transport-https --yes echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list - +#helm install sudo apt-get update sudo apt-get install helm +#payment install +kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/main/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml #Install ServiceMonitor +kubectl create namespace paymenthub +kubectl get -A namespace +helm repo add g2p-sandbox-1-3-1 https://fynarfin.io/images/ph-ee-g2psandbox-1.3.1/ +helm install ph-ee-g2psandbox g2p-sandbox-1-3-1/ph-ee-g2psandbox --version 1.3.1 -n paymenthub + +git clone -b 7.17 https://github.com/elastic/helm-charts.git elastic/helm-charts +# sleep 300 +cd elastic/helm-charts/elasticsearch/examples/security/ +make secrets || echo "elastic-secrets" already exists +git clone -b 7.17 https://github.com/elastic/helm-charts.git elastic/helm-charts +cd elastic/helm-charts/kibana/examples/security/ +make secrets || echo "kibana-secrets" already exists +kubectl get secret elastic-certificate-crt -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - +kubectl get secret elastic-certificate-pem -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - +kubectl get secret elastic-certificates -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - +kubectl get secret elastic-credentials -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - +kubectl get secret kibana -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - +kubectl get secrets -n paymenthub +kubectl get configmap -n paymenthub + +# sleep 5m +kubectl get pods -n paymenthub +#insatll netcat +apt install -y netcat +# until nc -vz ph-ee-zeebe-ops 80; do echo "Waiting for zeebe-ops service"; sleep 2; done; +#Deploy BPMN +kubectl port-forward service/ph-ee-zeebe-ops 5000:80 -n paymenthub & #portforward zeebe-ops &' +git clone https://github.com/openMF/ph-ee-env-labs.git openMF/ph-ee-env-labs +cd openMF/ph-ee-env-labs/orchestration +ls +sed -i "/HOST=/c\HOST=http://localhost:5000/zeebe/upload" deployBpmn.sh +cat deployBpmn.sh +cd .. +sh orchestration/deployBpmn.sh + +kubectl get pods -n paymenthub +# kubectl describe po -n paymenthub `kubectl get pods -n paymenthub | grep ph-ee-zeebe-ops |cut -d ' ' -f1` || echo ' ' +# helm list -n paymenthub kubectl get pods -n paymenthub helm test ph-ee-g2psandbox -n paymenthub --timeout 5m From 4ca719ae42d7c52b7d6134b8933df74faf752531 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Thu, 11 Jan 2024 17:45:28 +0530 Subject: [PATCH 137/144] deploy hello-world and test --- examples/bb-payments/test_entrypoint.sh | 87 +++++++++++++------------ 1 file changed, 47 insertions(+), 40 deletions(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 3df45fa..4817b3b 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -23,48 +23,55 @@ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm. #helm install sudo apt-get update sudo apt-get install helm -#payment install -kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/main/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml #Install ServiceMonitor -kubectl create namespace paymenthub -kubectl get -A namespace -helm repo add g2p-sandbox-1-3-1 https://fynarfin.io/images/ph-ee-g2psandbox-1.3.1/ -helm install ph-ee-g2psandbox g2p-sandbox-1-3-1/ph-ee-g2psandbox --version 1.3.1 -n paymenthub -git clone -b 7.17 https://github.com/elastic/helm-charts.git elastic/helm-charts -# sleep 300 -cd elastic/helm-charts/elasticsearch/examples/security/ -make secrets || echo "elastic-secrets" already exists -git clone -b 7.17 https://github.com/elastic/helm-charts.git elastic/helm-charts -cd elastic/helm-charts/kibana/examples/security/ -make secrets || echo "kibana-secrets" already exists -kubectl get secret elastic-certificate-crt -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - -kubectl get secret elastic-certificate-pem -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - -kubectl get secret elastic-certificates -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - -kubectl get secret elastic-credentials -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - -kubectl get secret kibana -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - -kubectl get secrets -n paymenthub -kubectl get configmap -n paymenthub +#hello world install +kubectl create namespace hello-world +kubectl get -A namespace +helm repo add hello-world https://ayazuddin007.github.io/Helm3/ +helm install my-hello-world hello-world/hello-world --version 0.2.0 -# sleep 5m -kubectl get pods -n paymenthub -#insatll netcat -apt install -y netcat -# until nc -vz ph-ee-zeebe-ops 80; do echo "Waiting for zeebe-ops service"; sleep 2; done; -#Deploy BPMN -kubectl port-forward service/ph-ee-zeebe-ops 5000:80 -n paymenthub & #portforward zeebe-ops &' -git clone https://github.com/openMF/ph-ee-env-labs.git openMF/ph-ee-env-labs -cd openMF/ph-ee-env-labs/orchestration -ls -sed -i "/HOST=/c\HOST=http://localhost:5000/zeebe/upload" deployBpmn.sh -cat deployBpmn.sh -cd .. -sh orchestration/deployBpmn.sh +# #payment install +# kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/main/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml #Install ServiceMonitor +# kubectl create namespace paymenthub +# kubectl get -A namespace +# helm repo add g2p-sandbox-1-3-1 https://fynarfin.io/images/ph-ee-g2psandbox-1.3.1/ +# helm install ph-ee-g2psandbox g2p-sandbox-1-3-1/ph-ee-g2psandbox --version 1.3.1 -n paymenthub -kubectl get pods -n paymenthub -# kubectl describe po -n paymenthub `kubectl get pods -n paymenthub | grep ph-ee-zeebe-ops |cut -d ' ' -f1` || echo ' ' -# helm list -n paymenthub +# git clone -b 7.17 https://github.com/elastic/helm-charts.git elastic/helm-charts +# # sleep 300 +# cd elastic/helm-charts/elasticsearch/examples/security/ +# make secrets || echo "elastic-secrets" already exists +# git clone -b 7.17 https://github.com/elastic/helm-charts.git elastic/helm-charts +# cd elastic/helm-charts/kibana/examples/security/ +# make secrets || echo "kibana-secrets" already exists +# kubectl get secret elastic-certificate-crt -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - +# kubectl get secret elastic-certificate-pem -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - +# kubectl get secret elastic-certificates -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - +# kubectl get secret elastic-credentials -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - +# kubectl get secret kibana -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - +# kubectl get secrets -n paymenthub +# kubectl get configmap -n paymenthub -kubectl get pods -n paymenthub -helm test ph-ee-g2psandbox -n paymenthub --timeout 5m -# no_output_timeout=900 +# # sleep 5m +# kubectl get pods -n paymenthub +# #insatll netcat +# apt install -y netcat +# # until nc -vz ph-ee-zeebe-ops 80; do echo "Waiting for zeebe-ops service"; sleep 2; done; +# #Deploy BPMN +# kubectl port-forward service/ph-ee-zeebe-ops 5000:80 -n paymenthub & #portforward zeebe-ops &' +# git clone https://github.com/openMF/ph-ee-env-labs.git openMF/ph-ee-env-labs +# cd openMF/ph-ee-env-labs/orchestration +# ls +# sed -i "/HOST=/c\HOST=http://localhost:5000/zeebe/upload" deployBpmn.sh +# cat deployBpmn.sh +# cd .. +# sh orchestration/deployBpmn.sh + +# kubectl get pods -n paymenthub +# # kubectl describe po -n paymenthub `kubectl get pods -n paymenthub | grep ph-ee-zeebe-ops |cut -d ' ' -f1` || echo ' ' +# # helm list -n paymenthub + +# # kubectl get pods -n paymenthub +# helm test ph-ee-g2psandbox -n paymenthub --timeout 5m +# # no_output_timeout=900 From 63c820b9ec6ccaf8d4afb4d90b13c16da1274b16 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Thu, 11 Jan 2024 17:52:21 +0530 Subject: [PATCH 138/144] deploy hello-world and test --- examples/bb-payments/test_entrypoint.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 4817b3b..2b6ccfd 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -14,7 +14,7 @@ kubectl version curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_latest_amd64.deb sudo dpkg -i minikube_latest_amd64.deb minikube start -sleep 60 +sleep 30 minikube kubectl -- get po -A #Interact with Minikube cluster echo minikube started curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null @@ -28,7 +28,8 @@ sudo apt-get install helm kubectl create namespace hello-world kubectl get -A namespace helm repo add hello-world https://ayazuddin007.github.io/Helm3/ -helm install my-hello-world hello-world/hello-world --version 0.2.0 +helm install my-hello-world hello-world/hello-world --version 0.2.0 -n hello-world +helm test my-hello-world -n hello-world # #payment install # kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/main/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml #Install ServiceMonitor From be04238002baf80afd213c01f536ad2fc8e0b922 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Thu, 11 Jan 2024 18:39:04 +0530 Subject: [PATCH 139/144] deploy g2psandbox and helm test --- examples/bb-payments/test_entrypoint.sh | 91 +++++++++++-------------- 1 file changed, 38 insertions(+), 53 deletions(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 2b6ccfd..0d88198 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -1,5 +1,5 @@ #!/bin/bash -echo hello +#insatll kubectl sudo apt-get update sudo apt-get install -y apt-transport-https ca-certificates curl gpg sudo mkdir -p /etc/apt/keyrings @@ -14,65 +14,50 @@ kubectl version curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_latest_amd64.deb sudo dpkg -i minikube_latest_amd64.deb minikube start -sleep 30 minikube kubectl -- get po -A #Interact with Minikube cluster -echo minikube started +# aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID && aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY && aws configure set default.region eu-central-1 +# aws configure --profile playground curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null sudo apt-get install apt-transport-https --yes echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list #helm install sudo apt-get update sudo apt-get install helm +#payment install +kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/main/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml #Install ServiceMonitor +kubectl create namespace paymenthub +kubectl get -A namespace +helm repo add g2p-sandbox-1-3-1 https://fynarfin.io/images/ph-ee-g2psandbox-1.3.1/ +helm install ph-ee-g2psandbox g2p-sandbox-1-3-1/ph-ee-g2psandbox --version 1.3.1 -n paymenthub +sleep 300 +kubectl get pods -n paymenthub -#hello world install -kubectl create namespace hello-world -kubectl get -A namespace -helm repo add hello-world https://ayazuddin007.github.io/Helm3/ -helm install my-hello-world hello-world/hello-world --version 0.2.0 -n hello-world -helm test my-hello-world -n hello-world +git clone -b 7.17 https://github.com/elastic/helm-charts.git elastic/helm-charts +# sleep 300 +cd elastic/helm-charts/elasticsearch/examples/security/ +make secrets || echo "elastic-secrets" already exists +git clone -b 7.17 https://github.com/elastic/helm-charts.git elastic/helm-charts +cd elastic/helm-charts/kibana/examples/security/ +make secrets || echo "kibana-secrets" already exists +#insatll netcat +apt install -y netcat +# until nc -vz ph-ee-zeebe-ops 80; do echo "Waiting for zeebe-ops service"; sleep 2; done; -# #payment install -# kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/main/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml #Install ServiceMonitor -# kubectl create namespace paymenthub -# kubectl get -A namespace -# helm repo add g2p-sandbox-1-3-1 https://fynarfin.io/images/ph-ee-g2psandbox-1.3.1/ -# helm install ph-ee-g2psandbox g2p-sandbox-1-3-1/ph-ee-g2psandbox --version 1.3.1 -n paymenthub - -# git clone -b 7.17 https://github.com/elastic/helm-charts.git elastic/helm-charts -# # sleep 300 -# cd elastic/helm-charts/elasticsearch/examples/security/ -# make secrets || echo "elastic-secrets" already exists -# git clone -b 7.17 https://github.com/elastic/helm-charts.git elastic/helm-charts -# cd elastic/helm-charts/kibana/examples/security/ -# make secrets || echo "kibana-secrets" already exists -# kubectl get secret elastic-certificate-crt -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - -# kubectl get secret elastic-certificate-pem -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - -# kubectl get secret elastic-certificates -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - -# kubectl get secret elastic-credentials -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - -# kubectl get secret kibana -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - -# kubectl get secrets -n paymenthub -# kubectl get configmap -n paymenthub - -# # sleep 5m -# kubectl get pods -n paymenthub -# #insatll netcat -# apt install -y netcat -# # until nc -vz ph-ee-zeebe-ops 80; do echo "Waiting for zeebe-ops service"; sleep 2; done; -# #Deploy BPMN -# kubectl port-forward service/ph-ee-zeebe-ops 5000:80 -n paymenthub & #portforward zeebe-ops &' -# git clone https://github.com/openMF/ph-ee-env-labs.git openMF/ph-ee-env-labs -# cd openMF/ph-ee-env-labs/orchestration -# ls -# sed -i "/HOST=/c\HOST=http://localhost:5000/zeebe/upload" deployBpmn.sh -# cat deployBpmn.sh -# cd .. -# sh orchestration/deployBpmn.sh - -# kubectl get pods -n paymenthub -# # kubectl describe po -n paymenthub `kubectl get pods -n paymenthub | grep ph-ee-zeebe-ops |cut -d ' ' -f1` || echo ' ' -# # helm list -n paymenthub - -# # kubectl get pods -n paymenthub -# helm test ph-ee-g2psandbox -n paymenthub --timeout 5m -# # no_output_timeout=900 +#Deploy BPMN +kubectl port-forward service/ph-ee-zeebe-ops 5000:80 -n paymenthub & #portforward zeebe-ops &' +git clone https://github.com/openMF/ph-ee-env-labs.git openMF/ph-ee-env-labs +cd openMF/ph-ee-env-labs/orchestration +ls +sed -i "/HOST=/c\HOST=http://localhost:5000/zeebe/upload" deployBpmn.sh +cat deployBpmn.sh +cd .. +sh orchestration/deployBpmn.sh +kubectl get pods -n paymenthub +kubectl describe po -n paymenthub `kubectl get pods -n paymenthub | grep ph-ee-zeebe-ops |cut -d ' ' -f1` || echo ' ' +# helm list -n paymenthub +# sleep 20m +# kubectl get -A namespace paymenthub +kubectl get pods -n paymenthub +helm test ph-ee-g2psandbox -n paymenthub --timeout 5m +no_output_timeout=900 \ No newline at end of file From dcd504b7379bd9d3d914c28edde15cb8ec65138f Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Thu, 11 Jan 2024 18:47:32 +0530 Subject: [PATCH 140/144] deploy g2psandbox and helm test --- examples/bb-payments/test_entrypoint.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 0d88198..f736f2a 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -39,6 +39,12 @@ make secrets || echo "elastic-secrets" already exists git clone -b 7.17 https://github.com/elastic/helm-charts.git elastic/helm-charts cd elastic/helm-charts/kibana/examples/security/ make secrets || echo "kibana-secrets" already exists +kubectl get secret elastic-certificate-crt -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - +kubectl get secret elastic-certificate-pem -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - +kubectl get secret elastic-certificates -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - +kubectl get secret elastic-credentials -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - +kubectl get secret kibana -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - +kubectl get secrets -n paymenthub #insatll netcat apt install -y netcat # until nc -vz ph-ee-zeebe-ops 80; do echo "Waiting for zeebe-ops service"; sleep 2; done; From 299c20d012f7bd3dba53fd3cd43eb0ae1ad31d77 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Thu, 11 Jan 2024 19:46:27 +0530 Subject: [PATCH 141/144] helm test with g2psandbox --- examples/bb-payments/test_entrypoint.sh | 26 ++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index f736f2a..8164a96 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -1,5 +1,5 @@ #!/bin/bash -#insatll kubectl +#install kubectl sudo apt-get update sudo apt-get install -y apt-transport-https ca-certificates curl gpg sudo mkdir -p /etc/apt/keyrings @@ -10,19 +10,21 @@ sudo apt-get update sudo apt-get install -y kubelet kubeadm kubectl sudo apt-mark hold kubelet kubeadm kubectl kubectl version + #Setup Minikube curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_latest_amd64.deb sudo dpkg -i minikube_latest_amd64.deb minikube start minikube kubectl -- get po -A #Interact with Minikube cluster -# aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID && aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY && aws configure set default.region eu-central-1 -# aws configure --profile playground +echo minikube started + +#helm install curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null sudo apt-get install apt-transport-https --yes echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list -#helm install sudo apt-get update sudo apt-get install helm + #payment install kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/main/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml #Install ServiceMonitor kubectl create namespace paymenthub @@ -32,6 +34,7 @@ helm install ph-ee-g2psandbox g2p-sandbox-1-3-1/ph-ee-g2psandbox --version 1.3.1 sleep 300 kubectl get pods -n paymenthub +#create secrets git clone -b 7.17 https://github.com/elastic/helm-charts.git elastic/helm-charts # sleep 300 cd elastic/helm-charts/elasticsearch/examples/security/ @@ -45,10 +48,10 @@ kubectl get secret elastic-certificates -n default -o yaml | sed 's/namespace: d kubectl get secret elastic-credentials -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - kubectl get secret kibana -n default -o yaml | sed 's/namespace: default/namespace: paymenthub/' | kubectl create -f - kubectl get secrets -n paymenthub + #insatll netcat apt install -y netcat # until nc -vz ph-ee-zeebe-ops 80; do echo "Waiting for zeebe-ops service"; sleep 2; done; - #Deploy BPMN kubectl port-forward service/ph-ee-zeebe-ops 5000:80 -n paymenthub & #portforward zeebe-ops &' git clone https://github.com/openMF/ph-ee-env-labs.git openMF/ph-ee-env-labs @@ -58,12 +61,13 @@ sed -i "/HOST=/c\HOST=http://localhost:5000/zeebe/upload" deployBpmn.sh cat deployBpmn.sh cd .. sh orchestration/deployBpmn.sh - +ls /home/circleci/project/test/openAPI/result/ +#helm test +pwd kubectl get pods -n paymenthub -kubectl describe po -n paymenthub `kubectl get pods -n paymenthub | grep ph-ee-zeebe-ops |cut -d ' ' -f1` || echo ' ' -# helm list -n paymenthub +# kubectl describe po -n paymenthub `kubectl get pods -n paymenthub | grep ph-ee-zeebe-ops |cut -d ' ' -f1` || echo ' ' # sleep 20m -# kubectl get -A namespace paymenthub -kubectl get pods -n paymenthub helm test ph-ee-g2psandbox -n paymenthub --timeout 5m -no_output_timeout=900 \ No newline at end of file +kubectl get pods -n paymenthub +kubectl log g2p-sandbox-test-connection -n paymenthub +# no_output_timeout=900 \ No newline at end of file From 35c3b9439c0b9d589a5632b38f5102f205e60c79 Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Thu, 11 Jan 2024 20:00:52 +0530 Subject: [PATCH 142/144] helm test with g2psandbox --- examples/bb-payments/test_entrypoint.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 8164a96..f83415c 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -62,6 +62,7 @@ cat deployBpmn.sh cd .. sh orchestration/deployBpmn.sh ls /home/circleci/project/test/openAPI/result/ +checkout #helm test pwd kubectl get pods -n paymenthub @@ -69,5 +70,6 @@ kubectl get pods -n paymenthub # sleep 20m helm test ph-ee-g2psandbox -n paymenthub --timeout 5m kubectl get pods -n paymenthub -kubectl log g2p-sandbox-test-connection -n paymenthub +kubectl describe pod g2p-sandbox-test-connection -n paymenthub +kubectl logs g2p-sandbox-test-connection -n paymenthub # no_output_timeout=900 \ No newline at end of file From 0da77e02a75e93d1c3df95393f20c5cb6924e9cf Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Thu, 11 Jan 2024 20:27:42 +0530 Subject: [PATCH 143/144] helm test with g2psandbox --- examples/bb-payments/test_entrypoint.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index f83415c..085d170 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -62,7 +62,7 @@ cat deployBpmn.sh cd .. sh orchestration/deployBpmn.sh ls /home/circleci/project/test/openAPI/result/ -checkout +# checkout #helm test pwd kubectl get pods -n paymenthub @@ -70,6 +70,8 @@ kubectl get pods -n paymenthub # sleep 20m helm test ph-ee-g2psandbox -n paymenthub --timeout 5m kubectl get pods -n paymenthub +echo test completed kubectl describe pod g2p-sandbox-test-connection -n paymenthub +echo check for the logs kubectl logs g2p-sandbox-test-connection -n paymenthub # no_output_timeout=900 \ No newline at end of file From d937c3e23b1192590c84c5293f776aefed64319e Mon Sep 17 00:00:00 2001 From: Somanath Hugar Date: Thu, 11 Jan 2024 20:45:40 +0530 Subject: [PATCH 144/144] helm test with g2psandbox --- examples/bb-payments/test_entrypoint.sh | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/examples/bb-payments/test_entrypoint.sh b/examples/bb-payments/test_entrypoint.sh index 085d170..e18dbda 100644 --- a/examples/bb-payments/test_entrypoint.sh +++ b/examples/bb-payments/test_entrypoint.sh @@ -73,5 +73,21 @@ kubectl get pods -n paymenthub echo test completed kubectl describe pod g2p-sandbox-test-connection -n paymenthub echo check for the logs -kubectl logs g2p-sandbox-test-connection -n paymenthub -# no_output_timeout=900 \ No newline at end of file +kubectl logs -f g2p-sandbox-test-connection -n paymenthub +# no_output_timeout=900 + +#export test results +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 /home/circleci/project/test/openAPI/result/ + +# Specify the path to the downloaded file +downloaded_file="/home/circleci/project/test/openAPI/result/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/ /home/circleci/project/test/openAPI/result/ + downloaded_file="/home/circleci/project/test/openAPI/result/cucumber.xml " +done +echo "File is no longer empty, processing..." \ No newline at end of file