From fb3fa7fcf702b217f5f0a3543d10fa8b1fadfc6b Mon Sep 17 00:00:00 2001 From: Julien Girardin Date: Thu, 21 Dec 2023 17:09:54 +0100 Subject: [PATCH] Add environment variable tunning and better dev support for Mac OS --- docker-compose.override.yaml.sample | 8 ++++---- docker-compose.yaml | 31 ++++++++++++++++++++++------- docs/tips_tricks.md | 2 ++ 3 files changed, 30 insertions(+), 11 deletions(-) diff --git a/docker-compose.override.yaml.sample b/docker-compose.override.yaml.sample index c5997be..2699eab 100644 --- a/docker-compose.override.yaml.sample +++ b/docker-compose.override.yaml.sample @@ -1,9 +1,9 @@ --- services: terraform: - environment: - SSH_KEY: ${HOME}/.ssh - # SSH_AUTH_SOCK: /run/host-services/ssh-auth.sock # For MacOS volumes: - - ${HOME}/.cache:${HOME}/.cache - ${OS_CLIENT_CONFIG_FILE}:${OS_CLIENT_CONFIG_FILE} + + tests: + volumes: + - ${HOME}/.cache:${HOME}/.cache diff --git a/docker-compose.yaml b/docker-compose.yaml index d17bda6..2ddcde6 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -10,21 +10,42 @@ services: - ${PWD}:${PWD} - /tmp:/tmp - ./.test-ansible:${HOME}/.ansible - - ${SSH_AUTH_SOCK:-/run}:${SSH_AUTH_SOCK:-/run} + - ${_SSH_AUTH_SOCK:-${SSH_AUTH_SOCK:-/run}}:${_SSH_AUTH_SOCK:-${SSH_AUTH_SOCK:-/run}} - ${SSH_KEY:-${HOME}}:${SSH_KEY_MOUNT:-${SSH_KEY:-${HOME}}} environment: KEEP_SERVERS: KEEP_SERVERS_AFTER_FAIL: HOME: + OS_AUTH_URL: OS_CLOUD: OS_CLIENT_CONFIG_FILE: OS_DOMAIN_NAME: + OS_IDENTITY_API_VERSION: + OS_INTERFACE: + OS_PASSWORD: + OS_PROJECT_DOMAIN_ID: + OS_PROJECT_DOMAIN_NAME: + OS_PROJECT_ID: + OS_PROJECT_NAME: + OS_TENANT_ID: + OS_TENANT_NAME: OS_TOKEN: + OS_REGION_NAME: + OS_USER_DOMAIN_NAME: + OS_USERNAME: POETRY_CACHE_DIR: "${POETRY_CACHE_DIR:-/tmp}" POETRY_VIRTUALENVS_PATH: "${POETRY_VIRTUALENVS_PATH:-/tmp}" - SSH_AUTH_SOCK: + SSH_AUTH_SOCK: "${_SSH_AUTH_SOCK:-${SSH_AUTH_SOCK:-/run}}" + TF_VAR_allocate_private_net: + TF_VAR_control_plane_count: + TF_VAR_floating_pool: + TF_VAR_image_name: + TF_VAR_network_name: + TF_VAR_inventory_dir: TF_VAR_ssh_key_path: TF_VAR_stem: + TF_VAR_worker_count: + tests: build: . @@ -37,18 +58,15 @@ services: ] command: ["-x"] extends: - file: docker-compose.yaml service: terraform shell: entrypoint: ["${PWD}/scripts/detect-user.sh"] - command: ["-c", "/bin/bash"] + command: ["/bin/bash"] extends: - file: docker-compose.yaml service: tests terraform_dev: extends: - file: docker-compose.yaml service: terraform environment: TF_VAR_inventory_dir: "${PWD}/tests/dev" @@ -58,7 +76,6 @@ services: condition: service_completed_successfully dev: extends: - file: docker-compose.yaml service: tests environment: ANSIBLE_HOST_KEY_CHECKING: false diff --git a/docs/tips_tricks.md b/docs/tips_tricks.md index a37327e..84e5702 100644 --- a/docs/tips_tricks.md +++ b/docs/tips_tricks.md @@ -27,3 +27,5 @@ To tear down manually when you finished export OS_CLOUD=openstack docker compose run terraform destroy ``` + +**NOTE**: for mac os users, please add `_SSH_AUTH_SOCK=/run/host-services/ssh-auth.sock` in a `.env` file at the top level directory of the repository