Skip to content

Commit 640fd47

Browse files
author
Julien Girardin
committed
Add dev stack base on compose
1 parent 5669f3d commit 640fd47

File tree

4 files changed

+251
-6
lines changed

4 files changed

+251
-6
lines changed

docker-compose.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ services:
44
image: hashicorp/terraform:${TERRAFORM_VERSION:-1.3.6}
55
working_dir: "${PWD}/tests/terraform/openstack"
66
entrypoint: ["${PWD}/scripts/detect-user.sh", "/bin/sh", "-c", "terraform $$@", "--"]
7+
command: ["init"]
78
volumes:
89
- /var/run/docker.sock:/var/run/docker.sock
910
- ${PWD}:${PWD}
@@ -18,9 +19,11 @@ services:
1819
OS_CLOUD:
1920
OS_CLIENT_CONFIG_FILE:
2021
OS_DOMAIN_NAME:
22+
OS_TOKEN:
2123
POETRY_CACHE_DIR: "${POETRY_CACHE_DIR:-/tmp}"
2224
POETRY_VIRTUALENVS_PATH: "${POETRY_VIRTUALENVS_PATH:-/tmp}"
2325
SSH_AUTH_SOCK:
26+
TF_VAR_ssh_key_path:
2427
TF_VAR_stem:
2528

2629
tests:
@@ -43,3 +46,35 @@ services:
4346
extends:
4447
file: docker-compose.yaml
4548
service: tests
49+
terraform_apply:
50+
extends:
51+
file: docker-compose.yaml
52+
service: terraform
53+
command: ["apply", "-auto-approve"]
54+
depends_on:
55+
terraform:
56+
condition: service_completed_successfully
57+
dev:
58+
extends:
59+
file: docker-compose.yaml
60+
service: tests
61+
environment:
62+
ANSIBLE_HOST_KEY_CHECKING: false
63+
depends_on:
64+
terraform_apply:
65+
condition: service_completed_successfully
66+
entrypoint:
67+
- "${PWD}/scripts/detect-user.sh"
68+
- "/bin/bash"
69+
- "-c"
70+
- >
71+
poetry install --with ansible &&
72+
poetry run ansible-galaxy install -r tests/ansible.requirements.yml &&
73+
poetry run ansible-playbook
74+
-i tests/terraform/openstack/kubeadm-hosts.cfg
75+
tests/playbooks/prepare.yml
76+
playbooks/00_apiserver_proxy.yml
77+
playbooks/01-site.yml
78+
$$@
79+
- "--"
80+
command: []

docs/tips_tricks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ansible-playbook -i <on_master_ip_look_at_comma_after>, -b -k -u admin playbooks
1212

1313
```
1414
export OS_CLOUD=openstack # and any other openstack environment variable
15-
docker compose run tests -k install --keep-servers -A -e kube_version=1.25
15+
docker compose run dev -e kube_version=1.25
1616
```
1717

1818
A bit of explanations:

0 commit comments

Comments
 (0)