-
Notifications
You must be signed in to change notification settings - Fork 2
59 lines (49 loc) · 1.84 KB
/
reusable_distro_workflow.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
name: "Reusable Distro Workflow"
on:
workflow_call:
inputs:
distro:
required: true
type: string
package_man:
required: true
type: string
defaults:
run:
shell: bash
jobs:
reusable-workflow:
runs-on: ubuntu-22.04
steps:
- name: Make container name
run: |
input_distro=${{ inputs.distro }}
distro_name_and_ver=$(echo input_distro | awk -F '/' '{print $NF}')
container_name=${distro_name_and_ver/:/_}
echo "CONTAINER_NAME=$container_name" >> $GITHUB_ENV
- name: Check if additional package is needed
run: |
if [[ ${{ inputs.package_man }} == "apt" ]]; then
echo "ADDITIONAL_PKG=libpam-systemd" >> $GITHUB_ENV
else
echo "ADDITIONAL_PKG=" >> $GITHUB_ENV
fi
- name: Update container
run: |
if [[ ${{ inputs.package_man }} == "apt" ]]; then
echo "UPDATE_COMMAND=sudo apt update && sudo apt upgrade -y" >> $GITHUB_ENV
else
echo "UPDATE_COMMAND=sudo dnf update -y" >> $GITHUB_ENV
fi
- name: Install Distrobox
run: curl -s https://raw.githubusercontent.com/89luca89/distrobox/main/install | sudo sh
- name: Create Distrobox
run: |
distrobox create --name $CONTAINER_NAME --image ${{ inputs.distro }} \
--additional-packages "git systemd ${{ inputs.package_man }} sudo $ADDITIONAL_PKG" \
--init-hooks "$UPDATE_COMMAND" \
--init --pull --root --unshare-all
- name: Clone FOG
run: distrobox enter --root $CONTAINER_NAME -- git clone -b dev-branch https://github.com/FOGProject/fogproject.git
- name: Install FOG
run: distrobox enter --root $CONTAINER_NAME -- sudo ./fogproject/bin/installfog.sh -y