Skip to content

Commit

Permalink
Determine Juju details in the same run in k8stunnel workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
cderici committed Sep 29, 2023
1 parent 677a825 commit 9f90daa
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions .github/workflows/k8s_tunnel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,21 @@ jobs:
with:
provider: ${{ matrix.cloud }}
juju-channel: 2.9/stable
- name: "Set environment to configure provider"
# language=bash
run: |
echo "CONTROLLER=$(juju whoami --format yaml | yq .controller)" >> $GITHUB_ENV
echo "JUJU_USERNAME=$(juju show-controller | yq .$CONTROLLER.account.user)" >> $GITHUB_ENV
echo "JUJU_PASSWORD=$(cat ~/.local/share/juju/accounts.yaml | yq .controllers.$CONTROLLER.password)" >> $GITHUB_ENV
echo "JUJU_CA_CERT=$(juju show-controller | yq .$CONTROLLER.details.ca-cert)" >> $GITHUB_ENV
- run: go mod download
- name: "Bring up loadbalancer & access via terraform plan"
run: |
echo "Controller:"
juju show-controller
echo "Determine Juju details"
CONTROLLER=$(juju whoami --format yaml | yq .controller)
JUJU_USERNAME=$(juju show-controller | yq .$CONTROLLER.account.user)
JUJU_PASSWORD=$(cat ~/.local/share/juju/accounts.yaml | yq .controllers.$CONTROLLER.password)
JUJU_CA_CERT=$(juju show-controller | yq .$CONTROLLER.details.ca-cert)
# Ensure Juju controller name
echo "Controller name: $CONTROLLER"
echo "Juju Username: $JUJU_USERNAME"
# Enable Ingress in MicroK8s
sudo microk8s enable ingress
Expand All @@ -86,16 +89,10 @@ jobs:
sudo usermod -a -G microk8s $(whoami)
chown -R $(whoami) ~/.kube
echo "Juju Username 1: $JUJU_USERNAME"
# Apply changes to group membership
newgrp microk8s
/snap/microk8s/current/usr/bin/env
# Ensure we have Juju username
echo "Juju Username 2: $JUJU_USERNAME"
echo "JUJU_USERNAME=$(juju show-controller | yq .$CONTROLLER.account.user)" >> $GITHUB_ENV
echo "Juju Username 3: $JUJU_USERNAME"
# Display services layout
echo "Services layout:"
sudo microk8s.kubectl get services -n controller-$CONTROLLER
Expand Down

0 comments on commit 9f90daa

Please sign in to comment.