iac/.woodpecker.yml

34 lines
1.8 KiB
YAML
Raw Normal View History

2023-12-09 03:55:20 +05:30
steps:
backend:
2023-12-09 04:42:25 +05:30
image: python:3-bookworm
2023-12-09 03:55:20 +05:30
commands:
- apt-get update
2023-12-11 19:30:28 +05:30
- apt-get install -y ca-certificates curl gnupg tar wget libssl-dev python3-pip cython3 pipx apt-transport-https coreutils iputils-ping openssh-client libvirt-clients genisoimage
- make ci.init
- cat /tmp/ci-ssh-id
- eval "$(ssh-agent -s)"
2023-12-11 19:30:28 +05:30
- ssh-add /tmp/ci-ssh-id
- ssh -o StrictHostKeyChecking=accept-new mcaptcha-ci@192.168.0.102 "echo f"
- install -m 0755 -d /etc/apt/keyrings
- curl -fsSL https://packages.opentofu.org/opentofu/tofu/gpgkey | gpg --no-tty --batch --dearmor -o /etc/apt/keyrings/opentofu.gpg
- chmod a+r /etc/apt/keyrings/opentofu.gpg
- echo "deb [signed-by=/etc/apt/keyrings/opentofu.gpg] https://packages.opentofu.org/opentofu/tofu/any/ any main" > /etc/apt/sources.list.d/opentofu.list
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"
2023-12-11 19:30:28 +05:30
- tofu -chdir=terraform/mcaptcha/ apply "mcaptcha"
- cd ../../
2023-12-09 03:55:20 +05:30
- pipx install --include-deps ansible
- pipx ensurepath && echo $SHELL
2023-12-09 04:25:38 +05:30
- /root/.local/bin/ansible-galaxy install -r ./ansible/requirements.yml
2023-12-09 04:42:25 +05:30
- /root/.local/bin/ansible-playbook --become --connection=local -i localhost, --limit 127.0.0.1 ./ansible/mcaptcha.yml
2023-12-09 04:12:23 +05:30
- pipx install --include-deps pytest-testinfra
2023-12-09 03:55:20 +05:30
- cd tests/cache/ && py.test --verbose base.py
- cd tests/mcaptcha/ && py.test --verbose base.py
2023-12-11 19:30:28 +05:30
- echo yes | tofu destroy \
-var-file="ci.tfvars"
2023-12-11 19:30:28 +05:30
- make ci.clean
secrets: [TEST_NODE_SSH_KEY]