Skip to content

Commit be77883

Browse files
committed
Enhance deployment script to improve service endpoint visibility and streamline output formatting
1 parent fc51da9 commit be77883

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

.github/workflows/deploy.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
run: |
4444
helm upgrade --install ${{ vars.APP_NAME }} ./helm \
4545
--namespace ${{ vars.APP_NAMESPACE }} \
46-
--set namespace=${{ vars.APP_NAMESPACE }} \
46+
-
4747
--set mongo.uri="${{ secrets.MONGO_URI }}" \
4848
--set mongo.username="${{ secrets.MONGO_USERNAME }}" \
4949
--set mongo.password="${{ secrets.MONGO_PASSWORD }}" \
@@ -59,13 +59,22 @@ jobs:
5959
- name: Print Service Endpoints
6060
run: |
6161
echo "================= SERVICE ENDPOINTS ================="
62-
echo "ArgoCD: http://$(kubectl get svc argocd-server -n argocd -o jsonpath='{.status.loadBalancer.ingress[0].hostname}' 2>/dev/null || echo 'Not found')"
63-
echo "Prometheus: http://$(kubectl get svc kube-prometheus-stack-prometheus -n monitoring -o jsonpath='{.status.loadBalancer.ingress[0].hostname}' 2>/dev/null || echo 'Not found'):9090"
64-
echo "Grafana: http://$(kubectl get svc kube-prometheus-stack-grafana -n monitoring -o jsonpath='{.status.loadBalancer.ingress[0].hostname}' 2>/dev/null || echo 'Not found')"
65-
echo "App: http://$(kubectl get svc my-app-svc -n ${{ vars.APP_NAMESPACE }} -o jsonpath='{.status.loadBalancer.ingress[0].hostname}' 2>/dev/null || echo 'Not found')"
62+
63+
ARGOCD_HOST=$(kubectl get svc argocd-server -n ${{ vars.ARGOCD_NAMESPACE }} -o jsonpath='{.status.loadBalancer.ingress[0].hostname}' 2>/dev/null || echo 'Not found')
64+
PROM_HOST=$(kubectl get svc kube-prometheus-stack-prometheus -n ${{ vars.MONITORING_NAMESPACE }} -o jsonpath='{.status.loadBalancer.ingress[0].hostname}' 2>/dev/null || echo 'Not found')
65+
GRAFANA_HOST=$(kubectl get svc kube-prometheus-stack-grafana -n ${{ vars.MONITORING_NAMESPACE }} -o jsonpath='{.status.loadBalancer.ingress[0].hostname}' 2>/dev/null || echo 'Not found')
66+
APP_HOST=$(kubectl get svc ${{ vars.APP_NAME }}-svc -n ${{ vars.APP_NAMESPACE }} -o jsonpath='{.status.loadBalancer.ingress[0].hostname}' 2>/dev/null || echo 'Not found')
67+
68+
echo "ArgoCD: http://$ARGOCD_HOST"
69+
echo "Prometheus: http://$PROM_HOST:9090"
70+
echo "Grafana: http://$GRAFANA_HOST"
71+
echo "App: http://$APP_HOST"
72+
6673
echo "================= DEFAULT CREDENTIALS ================="
74+
ARGOCD_PASS=$(kubectl -n ${{ vars.ARGOCD_NAMESPACE }} get secret argocd-initial-admin-secret -o jsonpath='{.data.password}' 2>/dev/null | base64 -d || echo 'Not found')
75+
6776
echo "ArgoCD -> Username: admin"
68-
echo "ArgoCD -> Password: $(kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath='{.data.password}' 2>/dev/null | base64 -d || echo 'Not found')"
77+
echo "ArgoCD -> Password: $ARGOCD_PASS"
6978
echo "Grafana -> Username: admin"
7079
echo "Grafana -> Password: ${{ secrets.GRAFANA_PASSWORD }}"
71-
echo "Prometheus -> No login needed (anonymous access by default)"s
80+
echo "Prometheus -> No login needed (anonymous access by default)"

0 commit comments

Comments
 (0)