diff --git a/.woodpecker.yml b/.woodpecker.yml index 7cf44b6..8289480 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -7,16 +7,17 @@ steps: - export PATH=$PATH:/root/.local/bin - eval "$(ssh-agent -s)" - make ci.init - - tofu -chdir=terraform/mcaptcha/ init - - tofu -chdir=terraform/mcaptcha/ plan -var-file="ci.tfvars" -out="mcaptcha" - - tofu -chdir=terraform/mcaptcha/ apply "mcaptcha" - - pip install virtualenv && virtualenv venv - - . venv/bin/activate && pip install ansible pytest-testinfra requests - - . venv/bin/activate && ansible-galaxy install -r ./ansible/requirements.yml - - . venv/bin/activate && ansible-playbook --become -i terraform/mcaptcha/hosts.ini ./ansible/mcaptcha.yml - cat terraform/mcaptcha/hosts.ini - - export ANSIBLE_REMOTE_USER=root - - . venv/bin/activate && py.test --hosts="ansible://mcaptcha_hosts" --ansible-inventory=terraform/mcaptcha/hosts.ini --verbose tests/cache/base.py - - . venv/bin/activate && py.test --hosts="ansible://mcaptcha_hosts" --ansible-inventory=terraform/mcaptcha/hosts.ini --verbose tests/mcaptcha/base.py + # db: mariadb cache: redis + - . venv/bin/activate && ansible-playbook --become -i terraform/mcaptcha/hosts.ini --extra-vars "database_type=mariadb cache_type=redis" ./ansible/mcaptcha.yml + - INVENTORY=terraform/mcaptcha/hosts.ini make test.cache + - INVENTORY=terraform/mcaptcha/hosts.ini make test.mcaptcha + # db: postgres cache: redis + - . venv/bin/activate && ansible-playbook --become -i terraform/mcaptcha/hosts.ini --extra-vars "database_type=postgres cache_type=redis" ./ansible/mcaptcha.yml + - INVENTORY=terraform/mcaptcha/hosts.ini make test.cache + - INVENTORY=terraform/mcaptcha/hosts.ini make test.mcaptcha + # embedded cache + - . venv/bin/activate && ansible-playbook --become -i terraform/mcaptcha/hosts.ini --extra-vars "database_type=postgres cache_type=embedded" ./ansible/mcaptcha.yml + - INVENTORY=terraform/mcaptcha/hosts.ini make test.mcaptcha - make ci.clean secrets: [TEST_NODE_SSH_KEY] diff --git a/Makefile b/Makefile index 4539d40..e8a0343 100644 --- a/Makefile +++ b/Makefile @@ -147,9 +147,15 @@ ci.init: echo "deb-src [signed-by=/etc/apt/keyrings/opentofu.gpg] https://packages.opentofu.org/opentofu/tofu/any/ any main" >> /etc/apt/sources.list.d/opentofu.list apt-get update apt-get install -y tofu + tofu -chdir=terraform/mcaptcha/ init + tofu -chdir=terraform/mcaptcha/ plan -var-file="ci.tfvars" -out="mcaptcha" + tofu -chdir=terraform/mcaptcha/ apply "mcaptcha" + pip install virtualenv && virtualenv venv + . venv/bin/activate && pip install ansible pytest-testinfra requests + . venv/bin/activate && ansible-galaxy install -r ./ansible/requirements.yml ci.clean: - echo yes | tofu destroy -var-file="ci.tfvars" + echo yes | tofu -chdir=terraform/mcaptcha/ destroy -var-file="ci.tfvars" ./scripts/ci.sh --clean help: ## Prints help for targets with comments