message: add reusable command for lnpage
diff: @@ -17,11 +17,23 @@ commands:
  gcloud auth activate-service-account --key-file=gcloud-service-key.json
  gcloud config set project ${GOOGLE_PROJECT_ID}
  gcloud container clusters get-credentials testnet-cluster --region us-central1-a --project ${GOOGLE_PROJECT_ID}
  - # update-lnpage:
  - # steps:
  - # - run:
  - # name: Update lnpage
  - # command:
  + update-lnpage:
  + parameters:
  + namespace:
  + type: string
  + steps:
  + - run:
  + name: Update lnpage
  + command: |
  + wget https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 -O jq
  + chmod +x ./jq
  + helm -n <<parameters.namespace>> upgrade -i lnpage ./lnpage-chart -f ./lnpage-chart/<<parameters.namespace>>-values.yaml
  + sleep 15 #without sleep wait hangs because it targets older pod
  + kubectl -n << parameters.namespace >> wait --for=condition=ready pod -l app=lnpage
  + LND_ADDR=$(kubectl -n <<parameters.namespace>> get services | awk '/lnd-service/ {print $4}')
  + LND_PUB_KEY=$(kubectl -n <<parameters.namespace>> exec lnd-container-0 -- lncli -n <<parameters.namespace>> getinfo | ./jq -r '.identity_pubkey')
  + echo "window.env={'LND_PUB_KEY':'$LND_PUB_KEY','LND_ADDR':'$LND_ADDR'}" > env.js
  + kubectl -n <<parameters.namespace>> cp ./env.js $(kubectl -n <<parameters.namespace>> get pods -l app=lnpage --no-headers -o custom-columns=":metadata.name"):/usr/share/nginx/html/env.js
  jobs:
  build_ios:
  