-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (59 loc) · 2.18 KB
/
edu-deploy-setup.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
---
name: EDU rerun setup
on:
workflow_call:
inputs:
CLUSTER:
required: true
type: string
NAMESPACE:
required: true
type: string
secrets:
token:
required: true
KUBECONFIG:
required: true
PROXY_CREDENTIALS:
required: false
jobs:
run_ansible_playbook_edusharing:
environment: ${{ inputs.CLUSTER }}
runs-on: ubuntu-latest
env:
# Necessary for ansible k8s module (doesn't use proxy defined in kubeconfig)
# https://github.com/kubernetes-client/python/issues/1862
# https://docs.ansible.com/ansible/latest/collections/kubernetes/core/k8s_module.html#parameter-proxy
K8S_AUTH_PROXY: ${{ vars.PROXY_URL }}
K8S_AUTH_PROXY_HEADERS_PROXY_BASIC_AUTH: ${{ secrets.PROXY_CREDENTIALS }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
path: "repo/infra-deploy"
repository: hpi-schul-cloud/infra-deploy
- name: Install requirements python3
working-directory: ${{ github.workspace }}/repo/infra-deploy/
shell: bash
run: |
python3 -m pip install -r requirements.txt
- name: Install requirements ansible-galaxy
working-directory: ${{ github.workspace }}/repo/infra-deploy/
run: ansible-galaxy install -r ansible/collections/requirements.yml
- name: Create Kubeconfig file
working-directory: ${{ github.workspace }}/
run: |
echo "${{ secrets.KUBECONFIG }}" > kubeconfig
- name: Set ENVs in config.yml file
working-directory: ${{ github.workspace }}/repo/infra-deploy/ansible/group_vars
run: |
echo -e "\nnamespace: ${{ inputs.NAMESPACE }}" >> config.yml
cat config.yml
- name: Execute Ansible Edusharing Setup Playbook
working-directory: ${{ github.workspace }}/repo/infra-deploy/
run: ansible-playbook ansible/edusharing-setup-playbook.yml --inventory-file hosts -e 'ansible_python_interpreter=/usr/bin/python3' -l ${{ inputs.CLUSTER }}
- name: Delete kubeconfig files
if: always()
working-directory: ${{ github.workspace }}
run: |
rm -f kubeconfig