From 1efe475177e03feac35043b0bb92d598e9e4c634 Mon Sep 17 00:00:00 2001 From: Michal Nasiadka Date: Thu, 8 May 2025 14:26:26 +0000 Subject: [PATCH] Zuul CI deployment --- .github/workflows/pr.yml | 31 +++++++++++++++++++++++++++++++ ansible/inventory/hosts | 1 + ansible/run.yml | 12 ++++++++++++ test-requirements.txt | 1 + 4 files changed, 45 insertions(+) create mode 100644 .github/workflows/pr.yml create mode 100644 ansible/inventory/hosts create mode 100644 ansible/run.yml create mode 100644 test-requirements.txt diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..22ed702 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,31 @@ +--- +name: On Pull Request + +on: + workflow_dispatch: + pull_request: + types: [opened, reopened] + +jobs: + deploy-zuul: + + runs-on: self-hosted + + env: + ANSIBLE_FORCE_COLOR: True + + steps: + - uses: actions/checkout@v4 + + - name: Generate kubeconfig + env: + KUBE: ${{secrets.KUBE}} + OS_CLOUD: "smslab-stackhpc-ci" + run: | + mkdir -p ~/.kube + echo "$KUBE" > ~/.kube/config + + - name: Run playbook + run: > + ansible-playbook -i ansible/inventory ansible/run.yml + diff --git a/ansible/inventory/hosts b/ansible/inventory/hosts new file mode 100644 index 0000000..2302eda --- /dev/null +++ b/ansible/inventory/hosts @@ -0,0 +1 @@ +localhost ansible_connection=local diff --git a/ansible/run.yml b/ansible/run.yml new file mode 100644 index 0000000..a1ac080 --- /dev/null +++ b/ansible/run.yml @@ -0,0 +1,12 @@ +--- +- name: Ensure Zuul is configured + gather_facts: false + hosts: localhost + + tasks: + - name: Ensure Zuul namespace is created + kubernetes.core.k8s: + name: zuul + api_version: v1 + kind: Namespace + state: present diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 0000000..807e21b --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1 @@ +kubernetes