diff --git a/.circleci/config.yml b/.circleci/config.yml index 740040672..3f86fdade 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,163 +13,66 @@ jobs: working_directory: ~/repo environment: TERM: dumb + PH_RELEASE: 1.13.1 steps: - checkout - run: rm -f helm/ph-ee-engine/Chart.lock helm/ph-ee-engine/requirements.lock helm/ph-ee-engine/charts/* - helm/install-helm-client: version: "v3.8.2" - - run: - name: build-and-host-engine - environment: - JIRA_STORY: '' - JIRA_STORY_DIR: '' - command: | - if [ "$CIRCLE_BRANCH" != "master" ]; then - PR_NUMBER=$(basename $CIRCLE_PULL_REQUEST) - PR_TITLE=$(curl -sSL "https://api.github.com/repos/openmf/$CIRCLE_PROJECT_REPONAME/pulls/$PR_NUMBER" | jq -r '.title') - JIRA_STORY=-$(echo $PR_TITLE | cut -d "[" -f2 | cut -d "]" -f1 | tr '[A-Z]' '[a-z]') - if [ -z "$JIRA_STORY" ]; then echo "Invalid PR title" && exit 1; else echo "Ticket NO: $JIRA_STORY" && JIRA_STORY_DIR=$(echo /jira-story-version); fi - echo Charts will save in https://fynarfin.io/images$JIRA_STORY_DIR - fi - sed -i "5s/.*/version: 0.0.0-SNAPSHOT$JIRA_STORY/" helm/ph-ee-engine/Chart.yaml - helm dep up helm/ph-ee-engine - helm package helm/ph-ee-engine - helm repo index . - echo "$CERT_FILE" | base64 --decode > b64encoded.pem - chmod 400 b64encoded.pem - ssh -i b64encoded.pem -o StrictHostKeyChecking=No ec2-user@13.233.68.128 sudo mkdir -p /apps/apache-tomcat-7.0.82/webapps/ROOT/images$JIRA_STORY_DIR/ph-ee-engine-0.0.0-SNAPSHOT$JIRA_STORY - scp -o StrictHostKeyChecking=No -i b64encoded.pem index.yaml ph-ee-engine-0.0.0-SNAPSHOT$JIRA_STORY.tgz ec2-user@13.233.68.128:~/ - ssh -i b64encoded.pem -o StrictHostKeyChecking=No ec2-user@13.233.68.128 sudo cp -t /apps/apache-tomcat-7.0.82/webapps/ROOT/images$JIRA_STORY_DIR/ph-ee-engine-0.0.0-SNAPSHOT$JIRA_STORY index.yaml ph-ee-engine-0.0.0-SNAPSHOT$JIRA_STORY.tgz + - run: helm dep up helm/ph-ee-engine + - run: helm package helm/ph-ee-engine + - run: helm repo index . + - run: echo "$CERT_FILE" | base64 --decode > b64encoded.pem + - run: chmod 400 b64encoded.pem + - run: scp -o StrictHostKeyChecking=No -i b64encoded.pem index.yaml ph-ee-engine-$PH_RELEASE-SNAPSHOT.tgz ec2-user@13.233.68.128:~/ + - run: ssh -i b64encoded.pem -o StrictHostKeyChecking=No ec2-user@13.233.68.128 sudo mkdir -p /apps/apache-tomcat-7.0.82/webapps/ROOT/images/ph-ee-engine-$PH_RELEASE-SNAPSHOT + - run: ssh -i b64encoded.pem -o StrictHostKeyChecking=No ec2-user@13.233.68.128 sudo cp -t /apps/apache-tomcat-7.0.82/webapps/ROOT/images/ph-ee-engine-$PH_RELEASE-SNAPSHOT index.yaml ph-ee-engine-$PH_RELEASE-SNAPSHOT.tgz build-and-host-g2p-sandbox: docker: - image: cimg/python:3.10 working_directory: ~/repo environment: TERM: dumb + G2P_RELEASE: 1.5.1 steps: - checkout - run: rm -f helm/g2p-sandbox/Chart.lock helm/g2p-sandbox/requirements.lock helm/g2p-sandbox/charts/* - helm/install-helm-client: version: "v3.8.2" - - run: - name: build-and-host-g2p-sandbox - environment: - JIRA_STORY: '' - JIRA_STORY_DIR: '' - command: | - if [ "$CIRCLE_BRANCH" != "master" ]; then - PR_NUMBER=$(basename $CIRCLE_PULL_REQUEST) - PR_TITLE=$(curl -sSL "https://api.github.com/repos/openmf/$CIRCLE_PR_REPONAME/pulls/$PR_NUMBER" | jq -r '.title') - JIRA_STORY=-$(echo $PR_TITLE | cut -d "[" -f2 | cut -d "]" -f1 | tr '[A-Z]' '[a-z]') - if [ -z "$JIRA_STORY" ]; then echo "Invalid PR title" && exit 1; else echo "Ticket NO: $JIRA_STORY" && JIRA_STORY_DIR=$(echo /jira-story-version); fi - fi - CHART_URL="https://fynarfin.io/images$JIRA_STORY_DIR/ph-ee-engine-0.0.0-SNAPSHOT$JIRA_STORY" - if curl --output /dev/null --silent --head --fail "$CHART_URL"; then - sed -i "10s@^ *repository:.*\$@ repository: $CHART_URL@" helm/g2p-sandbox/Chart.yaml - sed -i "11s@^ *version:.*\$@ version: 0.0.0-SNAPSHOT$JIRA_STORY@" helm/g2p-sandbox/Chart.yaml - echo "chart used: < $CHART_URL >" - else - CHART_URL="https://fynarfin.io/images/ph-ee-engine-0.0.0-SNAPSHOT" - echo "chart used: < $CHART_URL >" - fi - sed -i "5s/.*/version: 0.0.0$JIRA_STORY/" helm/g2p-sandbox/Chart.yaml - # rm -rf helm/g2p-sandbox/templates/config.yml - cat helm/g2p-sandbox/Chart.yaml - helm dep up helm/g2p-sandbox - helm package helm/g2p-sandbox - helm repo index . - echo "$CERT_FILE" | base64 --decode > b64encoded.pem - chmod 400 b64encoded.pem - ssh -i b64encoded.pem -o StrictHostKeyChecking=No ec2-user@13.233.68.128 sudo mkdir -p /apps/apache-tomcat-7.0.82/webapps/ROOT/images$JIRA_STORY_DIR/ph-ee-g2psandbox-0.0.0$JIRA_STORY - scp -o StrictHostKeyChecking=No -i b64encoded.pem index.yaml ph-ee-g2psandbox-0.0.0$JIRA_STORY.tgz ec2-user@13.233.68.128:~/ - ssh -i b64encoded.pem -o StrictHostKeyChecking=No ec2-user@13.233.68.128 sudo mv -t /apps/apache-tomcat-7.0.82/webapps/ROOT/images$JIRA_STORY_DIR/ph-ee-g2psandbox-0.0.0$JIRA_STORY index.yaml ph-ee-g2psandbox-0.0.0$JIRA_STORY.tgz - build-host-g2p-fyn-chart: - docker: - - image: cimg/python:3.10 - working_directory: ~/repo - environment: - TERM: dumb - steps: - - run: git clone https://github.com/openmf/ph-ee-env-labs - - run: rm -f ph-ee-env-labs/helm/g2p-sandbox-fynarfin-SIT/Chart.lock ph-ee-env-labs/helm/g2p-sandbox-fynarfin-SIT/requirements.lock ph-ee-env-labs/helm/g2p-sandbox-fynarfin-SIT/charts/* - - helm/install-helm-client: - version: "v3.8.2" - # - run: "sed -i '12s/.*/version: 0.0.0/' helm/g2p-sandbox-fynarfin-SIT/Chart.yaml" - - run: - name: build-host-g2p-fyn-chart - environment: - JIRA_STORY: '' - JIRA_STORY_DIR: '' - command: | - if [ "$CIRCLE_BRANCH" != "master" ]; then - PR_NUMBER=$(basename $CIRCLE_PULL_REQUEST) - PR_TITLE=$(curl -sSL "https://api.github.com/repos/openmf/$CIRCLE_PR_REPONAME/pulls/$PR_NUMBER" | jq -r '.title') - JIRA_STORY=-$(echo $PR_TITLE | cut -d "[" -f2 | cut -d "]" -f1 | tr '[A-Z]' '[a-z]') - if [ -z "$JIRA_STORY" ]; then echo "Invalid PR title" && exit 1; else echo "Ticket NO: $JIRA_STORY" && JIRA_STORY_DIR=$(echo /jira-story-version); fi - fi - CHART_URL="https://fynarfin.io/images$JIRA_STORY_DIR/ph-ee-g2psandbox-0.0.0$JIRA_STORY" - if curl --output /dev/null --silent --head --fail "$CHART_URL"; then - sed -i "11s@^ *repository:.*\$@ repository: $CHART_URL@" ph-ee-env-labs/helm/g2p-sandbox-fynarfin-SIT/Chart.yaml - sed -i "12s@^ *version:.*\$@ version: 0.0.0$JIRA_STORY@" ph-ee-env-labs/helm/g2p-sandbox-fynarfin-SIT/Chart.yaml - echo "chart used: < $CHART_URL >" - else - CHART_URL="https://fynarfin.io/images/ph-ee-g2psandbox-0.0.0" - echo "chart used: < $CHART_URL >" - fi - sed -i "6s/.*/version: 0.2.0$JIRA_STORY/" ph-ee-env-labs/helm/g2p-sandbox-fynarfin-SIT/Chart.yaml - cat ph-ee-env-labs/helm/g2p-sandbox-fynarfin-SIT/Chart.yaml - helm dep up ph-ee-env-labs/helm/g2p-sandbox-fynarfin-SIT - helm package ph-ee-env-labs/helm/g2p-sandbox-fynarfin-SIT - helm repo index . - echo "$CERT_FILE" | base64 --decode > b64encoded.pem - chmod 400 b64encoded.pem - ssh -i b64encoded.pem -o StrictHostKeyChecking=No ec2-user@13.233.68.128 sudo mkdir -p /apps/apache-tomcat-7.0.82/webapps/ROOT/images$JIRA_STORY_DIR/ph-ee-g2psandbox-fynarfin$JIRA_STORY - scp -o StrictHostKeyChecking=No -i b64encoded.pem index.yaml ph-ee-g2psandbox-fynarfin-0.2.0$JIRA_STORY.tgz ec2-user@13.233.68.128:~/ - ssh -i b64encoded.pem -o StrictHostKeyChecking=No ec2-user@13.233.68.128 sudo mv -t /apps/apache-tomcat-7.0.82/webapps/ROOT/images$JIRA_STORY_DIR/ph-ee-g2psandbox-fynarfin$JIRA_STORY index.yaml ph-ee-g2psandbox-fynarfin-0.2.0$JIRA_STORY.tgz + # - run: "sed -i '4s/.*/version: 0.0.0-SNAPSHOT/' helm/g2p-sandbox/requirements.yaml" + # SED & replace dependency with 0.0.0 + - run: helm dep up helm/g2p-sandbox + - run: helm package helm/g2p-sandbox + - run: helm repo index . + - run: echo "$CERT_FILE" | base64 --decode > b64encoded.pem + - run: chmod 400 b64encoded.pem + - run: scp -o StrictHostKeyChecking=No -i b64encoded.pem index.yaml ph-ee-g2psandbox-$G2P_RELEASE.tgz ec2-user@13.233.68.128:~/ + - run: ssh -i b64encoded.pem -o StrictHostKeyChecking=No ec2-user@13.233.68.128 sudo mkdir -p /apps/apache-tomcat-7.0.82/webapps/ROOT/images/ph-ee-g2psandbox-$G2P_RELEASE + - run: ssh -i b64encoded.pem -o StrictHostKeyChecking=No ec2-user@13.233.68.128 sudo mv -t /apps/apache-tomcat-7.0.82/webapps/ROOT/images/ph-ee-g2psandbox-$G2P_RELEASE index.yaml ph-ee-g2psandbox-$G2P_RELEASE.tgz + build-and-host-g2p-sandbox-security: docker: - image: cimg/python:3.10 working_directory: ~/repo environment: TERM: dumb + SEC_RELEASE: 1.4.1 steps: - checkout - run: rm -f helm/g2p-sandbox-security/Chart.lock helm/g2p-sandbox-security/requirements.lock helm/g2p-sandbox-security/charts/* - helm/install-helm-client: version: "v3.8.2" - - run: - name: build-and-host-g2p-sandbox-security - environment: - JIRA_STORY: '' - JIRA_STORY_DIR: '' - command: | - if [ "$CIRCLE_BRANCH" != "master" ]; then - PR_NUMBER=$(basename $CIRCLE_PULL_REQUEST) - PR_TITLE=$(curl -sSL "https://api.github.com/repos/openmf/$CIRCLE_PR_REPONAME/pulls/$PR_NUMBER" | jq -r '.title') - JIRA_STORY=-$(echo $PR_TITLE | cut -d "[" -f2 | cut -d "]" -f1 | tr '[A-Z]' '[a-z]') - if [ -z "$JIRA_STORY" ]; then echo "Invalid PR title" && exit 1; else echo "Ticket NO: $JIRA_STORY" && JIRA_STORY_DIR=$(echo /jira-story-version); fi - fi - CHART_URL="https://fynarfin.io/images$JIRA_STORY_DIR/ph-ee-engine-0.0.0-SNAPSHOT$JIRA_STORY" - if curl --output /dev/null --silent --head --fail "$CHART_URL"; then - sed -i "10s@^ *repository:.*\$@ repository: $CHART_URL@" helm/g2p-sandbox-security/Chart.yaml - sed -i "11s@^ *version:.*\$@ version: 0.0.0-SNAPSHOT$JIRA_STORY@" helm/g2p-sandbox-security/Chart.yaml - echo "chart used: < $CHART_URL >" - else - CHART_URL="https://fynarfin.io/images/ph-ee-engine-0.0.0-SNAPSHOT" - echo "chart used: < $CHART_URL >" - fi - sed -i "5s/.*/version: 0.0.0$JIRA_STORY/" helm/g2p-sandbox-security/Chart.yaml - cat helm/g2p-sandbox-security/Chart.yaml - # - run: "sed -i '4s/.*/version: 0.0.0-SNAPSHOT/' helm/g2p-sandbox-security/requirements.yaml" - # SED & replace dependency with 0.0.0 - helm dep up helm/g2p-sandbox-security - helm package helm/g2p-sandbox-security - helm repo index . - echo "$CERT_FILE" | base64 --decode > b64encoded.pem - chmod 400 b64encoded.pem - ssh -i b64encoded.pem -o StrictHostKeyChecking=No ec2-user@13.233.68.128 sudo mkdir -p /apps/apache-tomcat-7.0.82/webapps/ROOT/images$JIRA_STORY_DIR/ph-ee-g2psandbox-security$JIRA_STORY - scp -o StrictHostKeyChecking=No -i b64encoded.pem index.yaml ph-ee-g2psandbox-security-0.0.0$JIRA_STORY.tgz ec2-user@13.233.68.128:~/ - ssh -i b64encoded.pem -o StrictHostKeyChecking=No ec2-user@13.233.68.128 sudo mv -t /apps/apache-tomcat-7.0.82/webapps/ROOT/images$JIRA_STORY_DIR/ph-ee-g2psandbox-security$JIRA_STORY index.yaml ph-ee-g2psandbox-security-0.0.0$JIRA_STORY.tgz + # - run: "sed -i '4s/.*/version: 0.0.0-SNAPSHOT/' helm/g2p-sandbox-security/requirements.yaml" + # SED & replace dependency with 0.0.0 + - run: helm dep up helm/g2p-sandbox-security + - run: helm package helm/g2p-sandbox-security + - run: helm repo index . + - run: echo "$CERT_FILE" | base64 --decode > b64encoded.pem + - run: chmod 400 b64encoded.pem + - run: ssh -i b64encoded.pem -o StrictHostKeyChecking=No ec2-user@13.233.68.128 sudo mkdir -p /apps/apache-tomcat-7.0.82/webapps/ROOT/images/ph-ee-g2psandbox-security + - run: scp -o StrictHostKeyChecking=No -i b64encoded.pem index.yaml ph-ee-g2psandbox-security-$SEC_RELEASE.tgz ec2-user@13.233.68.128:~/ + - run: ssh -i b64encoded.pem -o StrictHostKeyChecking=No ec2-user@13.233.68.128 sudo mv -t /apps/apache-tomcat-7.0.82/webapps/ROOT/images/ph-ee-g2psandbox-security index.yaml ph-ee-g2psandbox-security-$SEC_RELEASE.tgz + minikube-run-helm-upgrade-and-helm-test: machine: image: ubuntu-2004:current @@ -177,6 +80,7 @@ jobs: resource_class: xlarge environment: TERM: dumb + PH_RELEASE: 1.13.1 parameters: namespace: default: "paymenthub" @@ -201,11 +105,11 @@ jobs: default: ph-ee-g2psandbox type: string chart-version: - default: 0.0.0 + default: 1.5.1 type: string steps: - - run: - name: run minikube + - run: + name: run minikube no_output_timeout: 40m command : | free -m @@ -228,9 +132,9 @@ jobs: echo minikube waiting minikube config set cpus 6 minikube config set memory 25600 - minikube start #--extra-config=kubelet.max-pods=60 + minikube start #p --extra-config=kubelet.max-pods=60 echo "Minikube started-----------------------------------------------------" - + # To check the allocated values minikube config get cpus minikube config get memory @@ -238,70 +142,71 @@ jobs: MINIKUBE_IP=`minikube ip` echo $MINIKUBE_IP # cat ~/.kube/config - + minikube kubectl -- get po -A #Interact with Minikube cluster kubectl create namespace paymenthub kubectl get -A namespace - # # For remote access to minikube uncomment the following lines. - # #---------------------minikube remote aceess start--------------------- - # sudo apt install nginx - # sudo touch /etc/nginx/conf.d/minikube.conf - # echo "create nginx conf" - # sudo chmod 777 -R /etc/nginx/conf.d/ - # echo "changed access" + # For remote access to minikube uncomment the following lines. + #---------------------minikube remote aceess start--------------------- + sudo apt install nginx + sudo touch /etc/nginx/conf.d/minikube.conf + echo "create nginx conf" + sudo chmod 777 -R /etc/nginx/conf.d/ + echo "changed access" - # sudo apt-get install apache2-utils -y - # echo "apache2-utils installed" - # htpasswd -bc /home/circleci/project/.htpasswd minikube minikube + sudo apt-get install apache2-utils -y + echo "apache2-utils installed" + htpasswd -bc /home/circleci/project/.htpasswd minikube minikube - # sudo cat \< /etc/nginx/conf.d/minikube.conf - # server { - # listen 8080; - # listen [::]:8080; - # server_name localhost; - # access_log /home/circleci/project/nginx_access.log; - # auth_basic "Administrators Area"; - # auth_basic_user_file /home/circleci/project/.htpasswd; + sudo cat \< /etc/nginx/conf.d/minikube.conf + server { + listen 8080; + listen [::]:8080; + server_name localhost; + access_log /home/circleci/project/nginx_access.log; + auth_basic "Administrators Area"; + auth_basic_user_file /home/circleci/project/.htpasswd; - # location / { - # proxy_pass https://$MINIKUBE_IP:8443; - # proxy_ssl_certificate /home/circleci/.minikube/profiles/minikube/client.crt; - # proxy_ssl_certificate_key /home/circleci/.minikube/profiles/minikube/client.key; - # } - # } - # EOF - # sudo service nginx restart || echo 'start nginx' - # SYSTEMD_LESS=FRXMK systemctl status nginx.service + location / { + proxy_pass https://$MINIKUBE_IP:8443; + proxy_ssl_certificate /home/circleci/.minikube/profiles/minikube/client.crt; + proxy_ssl_certificate_key /home/circleci/.minikube/profiles/minikube/client.key; + } + } + EOF + sudo service nginx restart || echo 'start nginx' + #SYSTEMD_LESS=FRXMK systemctl status nginx.service - # sleep 10 + sleep 10 - # echo "test-nginx-proxy" - # curl -u minikube:minikube http://localhost:8080 + echo "test-nginx-proxy" + curl -u minikube:minikube http://localhost:8080 - # curl -s https://ngrok-agent.s3.amazonaws.com/ngrok.asc | sudo tee /etc/apt/trusted.gpg.d/ngrok.asc >/dev/null && echo "deb https://ngrok-agent.s3.amazonaws.com buster main" | sudo tee /etc/apt/sources.list.d/ngrok.list && sudo apt update && sudo apt install ngrok + curl -s https://ngrok-agent.s3.amazonaws.com/ngrok.asc | sudo tee /etc/apt/trusted.gpg.d/ngrok.asc >/dev/null && echo "deb https://ngrok-agent.s3.amazonaws.com buster main" | sudo tee /etc/apt/sources.list.d/ngrok.list && sudo apt update && sudo apt install ngrok # ngrok config add-authtoken $AUTH_TOKEN - # echo "web_addr: $LOCAL_PORT" >> /home/circleci/.config/ngrok/ngrok.yml - # ngrok http 8080 > /dev/null & + ngrok config add-authtoken 2bd1gKwm6rye7Pz3CtgrF7kzB1G_4xn4KChGhrwdBjhrNpm9x + echo "web_addr: $LOCAL_PORT" >> /home/circleci/.config/ngrok/ngrok.yml + ngrok http 8080 > /dev/null & - # echo -n "Extracting ngrok public url ." - # NGROK_PUBLIC_URL="" - # while [ -z "$NGROK_PUBLIC_URL" ]; do - # # Run 'curl' against ngrok API and extract public (using 'sed' command) - # export NGROK_PUBLIC_URL=$(curl --silent --max-time 10 --connect-timeout 5 \ - # --show-error http://127.0.0.1:$LOCAL_PORT/api/tunnels | \ - # sed -nE 's/.*public_url":"https:..([^"]*).*/\1/p') - # sleep 1 - # echo -n "." - # done - # echo ---------copy the below public_URL for NGrok---------- - # echo "https://$NGROK_PUBLIC_URL" - # echo "https://$NGROK_PUBLIC_URL" + echo -n "Extracting ngrok public url ." + NGROK_PUBLIC_URL="" + while [ -z "$NGROK_PUBLIC_URL" ]; do + # Run 'curl' against ngrok API and extract public (using 'sed' command) + export NGROK_PUBLIC_URL=$(curl --silent --max-time 10 --connect-timeout 5 \ + --show-error http://127.0.0.1:$LOCAL_PORT/api/tunnels | \ + sed -nE 's/.*public_url":"https:..([^"]*).*/\1/p') + sleep 1 + echo -n "." + done + echo ---------copy the below public_URL for NGrok---------- + echo "https://$NGROK_PUBLIC_URL" + echo "https://$NGROK_PUBLIC_URL" - # echo "test ngrok " - # curl -u minikube:minikube https://$NGROK_PUBLIC_URL - # echo "https://$NGROK_PUBLIC_URL" - # # ---------------------minikube remote access end--------------------- + #echo "test ngrok " + #curl -u minikube:minikube https://$NGROK_PUBLIC_URL + echo "https://$NGROK_PUBLIC_URL" + # ---------------------minikube remote access end--------------------- 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 @@ -310,7 +215,7 @@ jobs: sudo apt-get update sudo apt-get install helm kubectl create namespace paymenthub || echo namespace already exists - + - run: name: fetch docker images and helm upgrade environment: @@ -345,11 +250,14 @@ jobs: curl --silent -f --head -lL https://hub.docker.com/v2/repositories/$1/tags/$2/ > /dev/null } if [ "$CIRCLE_BRANCH" != "master" ]; then - + PR_NUMBER=$(basename $CIRCLE_PULL_REQUEST) PR_TITLE=$(curl -sSL "https://api.github.com/repos/openmf/$CIRCLE_PR_REPONAME/pulls/$PR_NUMBER" | jq -r '.title') JIRA_STORY=$(echo $PR_TITLE | cut -d "[" -f2 | cut -d "]" -f1 | tr '[A-Z]' '[a-z]') if [ -z "$JIRA_STORY" ]; then echo "Invalid PR title" && exit 1; else echo "Ticket NO: $JIRA_STORY" && JIRA_STORY_DIR=$(echo /jira-story-version); fi + #Keep JIRA STORY as empty for release build + JIRA_STORY="" + JIRA_STORY_DIR="" fi echo $SERVICE_FILE_PATH @@ -358,7 +266,8 @@ jobs: #Using sed replace ph-ee-g2psandbox. with empty string sed -i 's/ph-ee-g2psandbox\.p/p/g' $filename echo $filename - get_services_from_file $filename + VALUES_TO_OVERRIDE="" + #get_services_from_file $filename if [ -n "${VALUES_TO_OVERRIDE}" ]; then VALUES_TO_OVERRIDE=$(echo --set ${VALUES_TO_OVERRIDE::-1}) @@ -386,7 +295,7 @@ jobs: ORB_PARAM_REPO=$(echo "$ORB_CHART_BASE_URL/$ORB_CHART_NAME-$ORB_CHART_VERSION") echo "chart used: < $CHART_URL >" fi - + echo helm repo add "${ORB_PARAM_RELEASE_NAME}" "${ORB_PARAM_REPO}" helm repo add "${ORB_PARAM_RELEASE_NAME}" "${ORB_PARAM_REPO}" @@ -394,7 +303,9 @@ jobs: helm repo update echo "helm upgrade --install ${VALUES_TO_OVERRIDE} ${ORB_PARAM_RELEASE_NAME} ${ORB_PARAM_CHART} ${ORB_PARAM_NAMESPACE}" echo helm chart install starts - helm upgrade --install --timeout=1h --set ph-ee-engine.kafka.global.storageClass=standard --set ph-ee-engine.kafka.provisioning.enabled=false --set ph-ee-engine.elasticsearch.volumeClaimTemplate.storageClassName=standard ${VALUES_TO_OVERRIDE} ${ORB_PARAM_RELEASE_NAME} ${ORB_PARAM_CHART} ${ORB_PARAM_NAMESPACE} --set ph-ee-engine.ph_ee_connector_ams_mifos.ams_local_interop_host="https://fynams.sandbox.fynarfin.io/",ph-ee-engine.ph_ee_connector_ams_mifos.ams_local_account_host="https://fynams.sandbox.fynarfin.io/",ph-ee-engine.ph_ee_connector_ams_mifos.ams_local_customer_host="https://fynams.sandbox.fynarfin.io/",ph-ee-engine.ph_ee_connector_ams_mifos.ams_local_auth_host="https://fynams.sandbox.fynarfin.io/" #--set ph-ee-engine.kafka.provisioning.enabled=false + #kubectl cordon minikube-m02 + #kubectl cordon minikube-m03 + helm upgrade --install --timeout=1h --set ph-ee-engine.kafka.global.storageClass=standard --set ph-ee-engine.elasticsearch.volumeClaimTemplate.storageClassName=standard ${VALUES_TO_OVERRIDE} ${ORB_PARAM_RELEASE_NAME} ${ORB_PARAM_CHART} ${ORB_PARAM_NAMESPACE} echo --------------------helm upgrade is done--------------------- @@ -424,54 +335,48 @@ jobs: # done; # echo ------zeebe-ops service available----------- # # 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 || echo 'deploy Bpmn done' + #kubectl uncordon minikube-m02 + #kubectl uncordon minikube-m03 + + #kubectl delete pod $(kubectl get pods -n paymenthub | grep ph-ee-zeebe-ops | cut -d ' ' -f1) -n paymenthub|| echo test + #sleep 60 + #Deploy BPMN + #kubectl port-forward service/ph-ee-zeebe-ops 5000:80 -n paymenthub & #portforward zeebe-ops &' + #git clone --depth 1 --branch v1.6.0 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 || echo 'deploy Bpmn done' #------------------Post-Installation-Steps-ends------------------------------- - run: name: Run Helm Tests command: | + kubectl delete pod $(kubectl get pods -n paymenthub | grep ph-ee-connector | cut -d ' ' -f1) -n paymenthub|| echo test + kubectl delete pod $(kubectl get pods -n paymenthub | grep ph-ee-connector-bill-pay | cut -d ' ' -f1) -n paymenthub|| echo test + #kubectl delete pod $(kubectl get pods -n paymenthub | grep ph-ee-connector-bulk | cut -d ' ' -f1) -n paymenthub|| echo test + #kubectl delete pod $(kubectl get pods -n paymenthub | grep ph-ee-connector-channel | cut -d ' ' -f1) -n paymenthub|| echo test + #kubectl delete pod $(kubectl get pods -n paymenthub | grep ph-ee-connector-crm | cut -d ' ' -f1) -n paymenthub|| echo test + #kubectl delete pod $(kubectl get pods -n paymenthub | grep ph-ee-connector-gsma | cut -d ' ' -f1) -n paymenthub|| echo test + #kubectl delete pod $(kubectl get pods -n paymenthub | grep ph-ee-connector-mock-payment-schema | cut -d ' ' -f1) -n paymenthub|| echo test + #kubectl delete pod $(kubectl get pods -n paymenthub | grep ph-ee-connector-mojaloop-java | cut -d ' ' -f1) -n paymenthub|| echo test + #kubectl delete pod $(kubectl get pods -n paymenthub | grep ph-ee-connector-notifications | cut -d ' ' -f1) -n paymenthub|| echo test + #kubectl delete pod $(kubectl get pods -n paymenthub | grep ph-ee-elasticsearch | cut -d ' ' -f1) -n paymenthub|| echo test + kubectl delete pod $(kubectl get pods -n paymenthub | grep ph-ee-identity-account-mapper | cut -d ' ' -f1) -n paymenthub|| echo test + kubectl delete pod $(kubectl get pods -n paymenthub | grep ph-ee-importer-es | cut -d ' ' -f1) -n paymenthub|| echo test + kubectl delete pod $(kubectl get pods -n paymenthub | grep ph-ee-importer-rdbms | cut -d ' ' -f1) -n paymenthub|| echo test + kubectl delete pod $(kubectl get pods -n paymenthub | grep ph-ee-vouchers | cut -d ' ' -f1) -n paymenthub|| echo test + #kubectl delete pod $(kubectl get pods -n paymenthub | grep kafka-controller | cut -d ' ' -f1) -n paymenthub|| echo test + helm test g2p-sandbox --filter name=g2p-sandbox-test-gov --namespace paymenthub || echo test - helm test g2p-sandbox --filter name=g2p-sandbox-test-ams --namespace paymenthub || echo test - + - run: name: Fetch Integration Test Report command: | #!/bin/bash mkdir -p integration_report/test-report - - echo "Fetch Integration Test Report for ams" - kubectl cp paymenthub/`kubectl get pods -n paymenthub | grep g2p-sandbox-test-ams |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-ams |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..." - mv integration_report/test-report/cucumber.xml integration_report/test-report/cucumber_ams.xml - mv integration_report/test-report/reports/tests/test integration_report/test-report/reports/tests/test_ams - # kubectl cp paymenthubb/`kubectl get pods -n paymenthub | grep g2p-sandbox-test-ams |cut -d " " -f1`:/ph-ee-connector-integration-test/build integration_report/test-report - - for i in $(kubectl get pods -n paymenthub | grep g2p-sandbox-test-ams |cut -d " " -f1); do - echo "--------------------------------------------------------------------Logs of $i Start---------------------------------------------------------------------------" >> all_pod_logs.log - kubectl logs -n paymenthub $i --all-containers=true >> all_pod_logs.log - echo "---------------------------------------------------------------------Logs of $i End----------------------------------------------------------------------------" >> all_pod_logs.log - echo " " >> all_pod_logs.log - echo " " >> all_pod_logs.log - done - echo "Fetch Integration Test Report for GOV" kubectl cp paymenthub/`kubectl get pods -n paymenthub | grep g2p-sandbox-test-gov |cut -d " " -f1`:/ph-ee-connector-integration-test/build integration_report/test-report # Specify the path to the downloaded file @@ -486,10 +391,10 @@ jobs: echo "File is no longer empty, processing..." mv integration_report/test-report/cucumber.xml integration_report/test-report/cucumber_gov.xml mv integration_report/test-report/reports/tests/test integration_report/test-report/reports/tests/test_gov - + mkdir -p integration_report_final cp integration_report/test-report/cucumber_gov.xml integration_report_final/ || echo "" - cp integration_report/test-report/cucumber_ams.xml integration_report_final/ || echo "" + #cp integration_report/test-report/cucumber_ams.xml integration_report_final/ || echo "" ls integration_report/test-report/ # kubectl cp paymenthub/`kubectl get pods -n paymenthub | grep g2p-sandbox-test-gov |cut -d " " -f1`:/ph-ee-connector-integration-test/build integration_report/test-report @@ -501,6 +406,13 @@ jobs: echo " " >> all_pod_logs.log done mv all_pod_logs.log integration_report/test-report/reports/tests/ + tar -cf release_artifacts.tar integration_report/test-report/reports/tests + echo "$CERT_FILE" | base64 --decode > b64encoded.pem + chmod 400 b64encoded.pem + scp -o StrictHostKeyChecking=No -i b64encoded.pem release_artifacts.tar ec2-user@13.233.68.128:~/ + - run: ssh -i b64encoded.pem -o StrictHostKeyChecking=No ec2-user@13.233.68.128 sudo mkdir -p /apps/apache-tomcat-7.0.82/webapps/ROOT/images/ph-ee-engine-$PH_RELEASE-SNAPSHOT + - run: ssh -i b64encoded.pem -o StrictHostKeyChecking=No ec2-user@13.233.68.128 sudo cp -t /apps/apache-tomcat-7.0.82/webapps/ROOT/images/ph-ee-engine-$PH_RELEASE-SNAPSHOT release_artifacts.tar + - store_test_results: path: integration_report_final/ @@ -519,29 +431,22 @@ workflows: - build-and-host-g2p-sandbox: requires: - build-and-host-engine - context: + context: - AWS - Helm - slack - - build-host-g2p-fyn-chart: - requires: - - build-and-host-g2p-sandbox - context: - - AWS - - Helm - build-and-host-g2p-sandbox-security: requires: - - build-host-g2p-fyn-chart - context: + - build-and-host-g2p-sandbox + context: - AWS - Helm - slack - minikube-run-helm-upgrade-and-helm-test: + requires: + - build-and-host-g2p-sandbox context: - AWS - Helm - slack - Ngrok - requires: - - build-host-g2p-fyn-chart - diff --git a/helm/g2p-sandbox-security/Chart.yaml b/helm/g2p-sandbox-security/Chart.yaml index aa8ff63fb..8d5797834 100644 --- a/helm/g2p-sandbox-security/Chart.yaml +++ b/helm/g2p-sandbox-security/Chart.yaml @@ -2,13 +2,10 @@ apiVersion: v2 description: PaymentHub EE Barebone Edition type: application name: ph-ee-g2psandbox-security -version: 1.2.0 -appVersion: 1.2.0 +version: 1.4.1 +appVersion: 1.4.1 dependencies: - name: ph-ee-engine - repository: https://fynarfin.io/images/ph-ee-engine-0.0.0-SNAPSHOT - version: 0.0.0-SNAPSHOT -- name: konga - version: 1.0.0 - repository: https://fynarfin.io/images/konga/ \ No newline at end of file + repository: https://fynarfin.io/images/ph-ee-engine-1.13.1-SNAPSHOT + version: 1.13.1-SNAPSHOT diff --git a/helm/g2p-sandbox/Chart.yaml b/helm/g2p-sandbox/Chart.yaml index dd32fe183..6d20ec844 100644 --- a/helm/g2p-sandbox/Chart.yaml +++ b/helm/g2p-sandbox/Chart.yaml @@ -2,13 +2,13 @@ apiVersion: v2 description: PaymentHub EE Barebone Edition type: application name: ph-ee-g2psandbox -version: 0.0.0 -appVersion: 0.0.0 +version: 1.5.1 +appVersion: 1.5.1 dependencies: - name: ph-ee-engine - repository: https://fynarfin.io/images/ph-ee-engine-0.0.0-SNAPSHOT - version: 0.0.0-SNAPSHOT + repository: https://fynarfin.io/images/ph-ee-engine-1.13.1-SNAPSHOT + version: 1.13.1-SNAPSHOT - name: account_mapper version: 1.0.0 diff --git a/helm/g2p-sandbox/values.yaml b/helm/g2p-sandbox/values.yaml index 96f5fdb00..603be255c 100644 --- a/helm/g2p-sandbox/values.yaml +++ b/helm/g2p-sandbox/values.yaml @@ -137,7 +137,6 @@ ph-ee-engine: ph_ee_connector_ams_mifos: enabled: true - image: docker.io/openmf/ph-ee-connector-ams-mifos:latest SPRING_PROFILES_ACTIVE: "fin12,bb" ams_local_enabled: true ams_local_interop_host: "https://fynams.sandbox.mifos.io/" @@ -165,7 +164,6 @@ ph-ee-engine: ph_ee_connector_mojaloop: enabled: true - image: docker.io/openmf/ph-ee-connector-mojaloop:latest SPRING_PROFILES_ACTIVE: "bb" hostname: "mojaloop.sandbox.mifos.io" ingress: @@ -205,7 +203,6 @@ ph-ee-engine: channel: enabled: true - image: docker.io/openmf/ph-ee-connector-channel:latest hostname: "channel.sandbox.mifos.io" stub_hostname: "channel-gsma.sandbox.mifos.io" SPRING_PROFILES_ACTIVE: "bb,tenants" @@ -249,7 +246,6 @@ ph-ee-engine: operations_app: enabled: true - image: docker.io/openmf/ph-ee-operations-app:latest hostname: "ops-bk.sandbox.mifos.io" datasource: username: "mifos" @@ -282,7 +278,6 @@ ph-ee-engine: operations_web: enabled: true - image: docker.io/openmf/ph-ee-operations-web:latest hostname: "ops.sandbox.mifos.io" ingress: enabled: false @@ -303,7 +298,6 @@ ph-ee-engine: ph_ee_connector_gsma: enabled: true - image: docker.io/openmf/ph-ee-connector-gsma:latest SPRING_PROFILES_ACTIVE: "bb" limits: cpu: "500m" @@ -329,7 +323,6 @@ ph-ee-engine: notifications: enabled: true - image: docker.io/openmf/ph-ee-notifications:latest imagePullPolicy: "Always" SPRING_PROFILES_ACTIVE: "bb" LOGGING_LEVEL_ROOT: "INFO" @@ -359,7 +352,6 @@ ph-ee-engine: connector_bulk: enabled: true - image: docker.io/openmf/ph-ee-bulk-processor:latest tenant: "rhino,gorilla" hostname: bulk-connector.sandbox.mifos.io operations_app: @@ -393,7 +385,6 @@ ph-ee-engine: zeebe_ops: enabled: true - image: docker.io/openmf/ph-ee-zeebe-ops:latest hostname: "zeebeops.sandbox.mifos.io" ingress: enabled: false @@ -416,7 +407,6 @@ ph-ee-engine: messagegateway: enabled: true - image: docker.io/openmf/message-gateway:latest secret: value: api_key: "" @@ -443,7 +433,6 @@ ph-ee-engine: importer_es: enabled: true - image: docker.io/openmf/ph-ee-importer-es:latest elasticsearch_sslverification: false elasticsearch_security_enabled: false reporting: @@ -451,7 +440,6 @@ ph-ee-engine: importer_rdbms: enabled: true - image: docker.io/openmf/ph-ee-importer-rdbms:latest LOGGING_LEVEL_ROOT: "DEBUG" keycloak: @@ -485,7 +473,6 @@ ph-ee-engine: vouchers: enabled: true - image: docker.io/openmf/ph-ee-vouchers:latest ingress: enabled: false annotations: @@ -515,7 +502,6 @@ ph-ee-engine: billPay: enabled: true - image: docker.io/openmf/ph-ee-bill-pay:latest hostname: "bill-pay.sandbox.mifos.io" stub_hostname: "bill-pay.sandbox.mifos.io" SPRING_PROFILES_ACTIVE: "bb,tenants" @@ -545,7 +531,6 @@ ph-ee-engine: crm: enabled: true - image: docker.io/openmf/ph-ee-connector-crm:latest hostname: "crm.sandbox.mifos.io" stub_hostname: "crm.sandbox.mifos.io" SPRING_PROFILES_ACTIVE: "bb,tenants" @@ -573,7 +558,6 @@ ph-ee-engine: ph-ee-connector: enabled: true - image: docker.io/openmf/ph-ee-connector-bulk:latest aws: region: "ap-south-1" access_key: "aws-access-key" @@ -598,7 +582,7 @@ ph-ee-engine: account_mapper: enabled: true - image: docker.io/openmf/ph-ee-identity-account-mapper:latest + image: docker.io/openmf/ph-ee-identity-account-mapper:v1.6.2 hostname: "identity-mapper.sandbox.mifos.io" LOGGING_LEVEL_ROOT: INFO livenessProbe: diff --git a/helm/ph-ee-engine/Chart.yaml b/helm/ph-ee-engine/Chart.yaml index d5e5e4a24..73ed3f192 100644 --- a/helm/ph-ee-engine/Chart.yaml +++ b/helm/ph-ee-engine/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v1 -appVersion: 0.0.0 +appVersion: 1.13.1 description: PaymentHub EE Engine name: ph-ee-engine -version: 0.0.0-SNAPSHOT +version: 1.13.1-SNAPSHOT diff --git a/helm/ph-ee-engine/templates/post-installation-job/job.yaml b/helm/ph-ee-engine/templates/post-installation-job/job.yaml index eb9112abd..4f33cc8e8 100644 --- a/helm/ph-ee-engine/templates/post-installation-job/job.yaml +++ b/helm/ph-ee-engine/templates/post-installation-job/job.yaml @@ -46,7 +46,7 @@ spec: chmod +x ./kubectl mv ./kubectl /usr/local/bin/kubectl kubectl version - + echo "---------------- kubectl installed -----------------" # Install Docker apt-get install sysvinit-utils apt-get --assume-yes install docker-ce docker-ce-cli containerd.io @@ -57,7 +57,7 @@ spec: apt-get --assume-yes install git apt-get --assume-yes install make - git clone https://github.com/openMF/ph-ee-env-labs.git + git clone --depth 1 --branch v1.6.0 https://github.com/openMF/ph-ee-env-labs.git cd ph-ee-env-labs/helm/es-secret/ make secrets || echo "elastic-secrets" already exists diff --git a/helm/ph-ee-engine/values.yaml b/helm/ph-ee-engine/values.yaml index e72735f10..a9c9a39b2 100644 --- a/helm/ph-ee-engine/values.yaml +++ b/helm/ph-ee-engine/values.yaml @@ -205,7 +205,7 @@ kibana: channel: enabled: false replicas: 1 - image: docker.io/openmf/ph-ee-connector-channel:v1.9.0 + image: docker.io/openmf/ph-ee-connector-channel:v1.12.0 imagePullPolicy: "Always" TRANSACTION_ID_LENGTH: 20 gsma_payee_tenant: "" @@ -344,7 +344,7 @@ operationsmysql: ph_ee_connector_ams_mifos: enabled: false replicas: 1 - image: docker.io/openmf/ph-ee-connector-ams-mifos:v1.3.0 + image: docker.io/openmf/ph-ee-connector-ams-mifos:v1.17.2 imagePullPolicy: "Always" ams_local_enabled: true ams_local_interop_host: "fineract-server" @@ -420,7 +420,7 @@ ph_ee_connector_ams_mifos: ph_ee_connector_mojaloop: enabled: false replicas: 1 - image: docker.io/openmf/ph-ee-connector-mojaloop:v1.3.0 + image: docker.io/openmf/ph-ee-connector-mojaloop:v1.5.1 imagePullPolicy: "Always" hostname: "" switch: @@ -522,7 +522,7 @@ ph_ee_connector_mojaloop: operations_app: enabled: true replicas: 1 - image: docker.io/openmf/ph-ee-operations-app:v1.10.0 + image: docker.io/openmf/ph-ee-operations-app:v1.20.1 imagePullPolicy: "Always" token_client_channel_secret: "" minio_public_host: "http://minio:9000" @@ -1204,7 +1204,7 @@ notifications: zeebe_ops: enabled: false replicas: 1 - image: docker.io/openmf/ph-ee-zeebe-ops:v1.2.0 + image: docker.io/openmf/ph-ee-zeebe-ops:v1.5.0 imagePullPolicy: "Always" imagePullSecrets: [] elasticsearch_contactpoint: "ph-ee-elasticsearch:9200" @@ -1395,7 +1395,7 @@ importer_es: mockpayment: enabled: false - image: docker.io/openmf/ph-ee-connector-mock-payment-schema:v1.4.0 + image: docker.io/openmf/ph-ee-connector-mock-payment-schema:v1.6.1 replicas: 1 mockFailure: percentage: "0" @@ -1454,7 +1454,7 @@ kafka: importer_rdbms: enabled: true replicas: 1 - image: docker.io/openmf/ph-ee-importer-rdbms:v1.7.1 + image: docker.io/openmf/ph-ee-importer-rdbms:v1.14.0 imagePullPolicy: "Always" SPRING_PROFILES_ACTIVE: "local,tenantsConnection" datasource: @@ -1541,7 +1541,7 @@ importer_rdbms: connector_bulk: enabled: false replicas: 1 - image: docker.io/openmf/ph-ee-bulk-processor:v1.9.0 + image: docker.io/openmf/ph-ee-bulk-processor:v1.13.0 imagePullPolicy: "Always" camel_disable_ssl: true channel: @@ -1665,7 +1665,7 @@ connector_bulk: ph_ee_connector_gsma: enabled: false replicas: 1 - image: docker.io/openmf/ph-ee-connector-gsma:v1.2.0 + image: docker.io/openmf/ph-ee-connector-gsma:v1.3.1 imagePullPolicy: "Always" # Whether this chart should self-manage its service account, role, and associated role binding. managedServiceAccount: true @@ -1824,7 +1824,7 @@ ph-ee-connector_slcb: ph-ee-connector: enabled: false replicas: 1 - image: docker.io/openmf/ph-ee-connector-bulk:v1.1.0 + image: docker.io/openmf/ph-ee-connector-bulk:v1.2.0 operations_app: contactpoint: "http://ph-ee-operations-app:5000" ingress: @@ -1900,8 +1900,8 @@ keycloak: integration_test: enabled: false replicas: 1 - image: "docker.io/openmf/ph-ee-integration-test:latest" - imageTag: v1.4.0-rc.1 + image: "docker.io/openmf/ph-ee-integration-test:v1.6.3" + imageTag: v1.6.2-rc.2 imagePullPolicy: "Never" limits: cpu: "500m" @@ -2029,7 +2029,7 @@ vouchers: enabled: false paymentadvice: false replicas: 1 - image: docker.io/openmf/ph-ee-vouchers:v1.1.0 + image: docker.io/openmf/ph-ee-vouchers:v1.4.0 ingress: enabled: true annotations: @@ -2074,7 +2074,7 @@ vouchers: billPay: enabled: false replicas: 1 - image: docker.io/openmf/ph-ee-bill-pay:v1.0.0 + image: docker.io/openmf/ph-ee-bill-pay:v1.2.0 imagePullPolicy: "Always" connector: contactpoint: "http://ph-ee-connector:80" @@ -2148,7 +2148,7 @@ billPay: crm: enabled: false replicas: 1 - image: docker.io/openmf/ph-ee-connector-crm:v1.0.0 + image: docker.io/openmf/ph-ee-connector-crm:v1.2.0 imagePullPolicy: "Always" livenessProbe: httpGet: