-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Css 4587 backport generic fixes (#965)
* Added documentation and setup files * Improve docker compose * Merged backport ci/cd * Fix compose for two exposed services * Added improved setup instructions * Further improvements * Eliminated unnecessary sections
- Loading branch information
Showing
12 changed files
with
163 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ tmp_dir = "tmp" | |
|
||
[log] | ||
time = false | ||
main_only = true | ||
|
||
[misc] | ||
clean_on_exit = false | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/bash | ||
|
||
# RUN THIS SCRIPT FROM PROJECT ROOT! | ||
# | ||
# This script adds a local controller to your compose JIMM instance. | ||
# Due to TLS SANs we need to modify JIMMs /etc/hosts to map to the SANs a controller certificate has. | ||
# | ||
# For completeness sake, the SANs are: DNS:anything, DNS:localhost, DNS:juju-apiserver, DNS:juju-mongodb | ||
# "juju-apiserver" feels most appropriate, so we use this. | ||
# | ||
# Requirements to run this script: | ||
# - yq (snap) | ||
set -eux | ||
|
||
JIMM_CONTROLLER_NAME="${JIMM_CONTROLLER_NAME:-jimm-dev}" | ||
CONTROLLER_NAME="${CONTROLLER_NAME:-qa-controller}" | ||
CONTROLLER_YAML_PATH="${CONTROLLER_NAME}".yaml | ||
CLIENT_CREDENTIAL_NAME="${CLIENT_CREDENTIAL_NAME:-localhost}" | ||
|
||
echo | ||
echo "JIMM controller name is: $JIMM_CONTROLLER_NAME" | ||
echo "Target controller name is: $CONTROLLER_NAME" | ||
echo "Target controller path is: $CONTROLLER_YAML_PATH" | ||
echo | ||
echo "Building jimmctl..." | ||
# Build jimmctl so we may add a controller. | ||
go build ./cmd/jimmctl | ||
echo "Built." | ||
echo | ||
echo "Switching juju controller to $JIMM_CONTROLLER_NAME" | ||
juju switch "$JIMM_CONTROLLER_NAME" | ||
echo | ||
echo "Retrieving controller info for $CONTROLLER_NAME" | ||
./jimmctl controller-info "$CONTROLLER_NAME" "$CONTROLLER_YAML_PATH" | ||
if [[ -f "$CONTROLLER_YAML_PATH" ]]; then | ||
echo "Controller info retrieved." | ||
else | ||
echo "Controller info couldn't be created, exiting..." | ||
exit 1 | ||
fi | ||
echo | ||
echo "Adding controller from path: $CONTROLLER_YAML_PATH" | ||
./jimmctl add-controller "$CONTROLLER_YAML_PATH" | ||
echo | ||
echo "Updating cloud credentials for: $JIMM_CONTROLLER_NAME, from client credential: $CLIENT_CREDENTIAL_NAME" | ||
juju update-credentials "$CLIENT_CREDENTIAL_NAME" --controller "$JIMM_CONTROLLER_NAME" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
# RUN THIS SCRIPT FROM PROJECT ROOT! | ||
# It will bootstrap a Juju controller and configure the necessary config to enable the controller | ||
# to communicate with the docker compose | ||
|
||
set -ux | ||
|
||
CONTROLLER_NAME="${CONTROLLER_NAME:-qa-controller}" | ||
|
||
echo "Bootstrapping controller" | ||
juju bootstrap localhost "${CONTROLLER_NAME}" --config allow-model-access=true --config identity-url=https://candid.localhost | ||
CONTROLLER_ID=$(juju show-controller --format json | jq --arg name "${CONTROLLER_NAME}" '.[$name]."controller-machines"."0"."instance-id"' | tr -d '"') | ||
echo "Adding proxy to LXC instance ${CONTROLLER_ID}" | ||
lxc config device add "${CONTROLLER_ID}" myproxy proxy listen=tcp:0.0.0.0:443 connect=tcp:127.0.0.1:443 bind=instance | ||
echo "Pushing local CA" | ||
lxc file push local/traefik/certs/ca.crt "${CONTROLLER_ID}"/usr/local/share/ca-certificates/ | ||
lxc exec "${CONTROLLER_ID}" -- update-ca-certificates | ||
echo "Restarting controller" | ||
lxc stop "${CONTROLLER_ID}" | ||
lxc start "${CONTROLLER_ID}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters