Skip to content

Commit

Permalink
minikube access
Browse files Browse the repository at this point in the history
  • Loading branch information
shkr7 committed Apr 18, 2024
1 parent e6d9b03 commit 0053051
Showing 1 changed file with 58 additions and 58 deletions.
116 changes: 58 additions & 58 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -244,65 +244,65 @@ jobs:
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"
#---------------------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 \<<EOF > /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 \<<EOF > /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
# # ngrok config add-authtoken $AUTH_TOKEN
# echo "web_addr: $LOCAL_PORT" >> /home/circleci/.config/ngrok/ngrok.yml
# ngrok http 8080 > /dev/null &
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 &

# 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"
#echo "test ngrok "
#curl -u minikube:minikube https://$NGROK_PUBLIC_URL
echo "https://$NGROK_PUBLIC_URL"

# # ---------------------minikube remote aceess end---------------------
# ---------------------minikube remote aceess 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
Expand Down Expand Up @@ -427,14 +427,14 @@ jobs:
# # 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 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'
#------------------Post-Installation-Steps-ends-------------------------------
- run:
Expand Down

0 comments on commit 0053051

Please sign in to comment.