Skip to content

Commit

Permalink
Merge pull request #64 from enix/environment_variable
Browse files Browse the repository at this point in the history
Add environment variable tunning and better dev support for Mac OS
  • Loading branch information
Zempashi authored Jan 30, 2024
2 parents 7225819 + fb3fa7f commit 6e3c0aa
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 11 deletions.
8 changes: 4 additions & 4 deletions docker-compose.override.yaml.sample
Original file line number Diff line number Diff line change
@@ -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
31 changes: 24 additions & 7 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: .
Expand All @@ -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"
Expand All @@ -58,7 +76,6 @@ services:
condition: service_completed_successfully
dev:
extends:
file: docker-compose.yaml
service: tests
environment:
ANSIBLE_HOST_KEY_CHECKING: false
Expand Down
2 changes: 2 additions & 0 deletions docs/tips_tricks.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 6e3c0aa

Please sign in to comment.