Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/pull-request-actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
pull_request:
branches:
- master
- staging

jobs:
shellcheck:
Expand Down
11 changes: 7 additions & 4 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,15 @@ if [ "$(yq -r '.clouds.openstack.auth.application_credential_id' clouds.yaml)" =
exit 1
fi

if [ "$(yq -r '.clouds.openstack.auth.project_id' clouds.yaml)" == "null" ]; then
if [ "$(yq '.clouds.openstack.auth.project_id' clouds.yaml)" == "null" ]; then
echo "Looking up project_id for clouds.yaml..."
APP_CRED_ID=$(yq -r '.clouds.openstack.auth.application_credential_id' clouds.yaml)
PROJECT_ID="$(openstack --os-cloud openstack application credential show "${APP_CRED_ID}" -c project_id -f value)"
APP_CRED_ID=$(yq '.clouds.openstack.auth.application_credential_id' clouds.yaml | tr -d '"')
PROJECT_ID=$(openstack --os-cloud openstack application credential show "${APP_CRED_ID}" -c project_id -f value)
echo "Injecting project ID: '${PROJECT_ID}' into clouds.yaml..."
injected_id=$PROJECT_ID yq e '.clouds.openstack.auth.project_id = env(injected_id)' -i clouds.yaml

# shellcheck disable=SC2016
# needs to be single quotes for yq to work
yq -yi --arg injected_id "$PROJECT_ID" '.clouds.openstack.auth.project_id = $injected_id' clouds.yaml
fi

echo "Installing and starting microk8s..."
Expand Down