aboutsummaryrefslogtreecommitdiffstats
path: root/.gitlab-ci.yml
blob: dc6c59cf6ffbe96c4290a2ae90476788a0e046aa (plain)
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
stages:
  - images
  - publish

variables:
  FISHDEPS: "/usr/bin/guestfish /usr/bin/virt-sysprep /usr/bin/virt-sparsify xz sudo jq"
  KICKDEPS: "/usr/bin/virt-install"

.store_images: &store_images
  - export LIBGUESTFS_BACKEND=direct
  - mkdir $CI_JOB_NAME
  - for image in *.qcow2;
    do
    virt-sysprep -a "$image";
    virt-sparsify --inplace "$image";
    info=${image%.qcow2}.info;
    qemu-img info --output=json $image > $info;
    mv --verbose $info $CI_JOB_NAME;
    done
  - xz --verbose $(ls *.tar *.qcow2)
  - mv --verbose *.xz $CI_JOB_NAME
  - (cd $CI_JOB_NAME; for info in *.info; do ../scripts/make-index.sh $info; done)
  - name="$CI_JOB_NAME images"
  - base="$CI_JOB_URL/artifacts/raw/$CI_JOB_NAME"
  - tree -i -f -s -h -D --charset utf8 -T "$name" -H "$base" $CI_JOB_NAME > index.html
  - mv --verbose index.html $CI_JOB_NAME
  - ls -l -h $CI_JOB_NAME

centos7:
  stage: images
  image: registry.gitlab.com/kraxel/rpm-package-builder:centos7
  before_script:
    - time yum install -y $FISHDEPS
  script:
    - sed -i -e '/proxy/d' repos/centos-7.repo
    - time ./CentOS7-efi.sh
    - *store_images
  artifacts:
    paths:
      - centos7

centos8:
  stage: images
  image: registry.gitlab.com/kraxel/rpm-package-builder:centos8
  before_script:
    - time dnf install -y $FISHDEPS
  script:
    - sed -i -e '/proxy/d' repos/centos-8.repo
    - time ./CentOS8-efi.sh
    - *store_images
  artifacts:
    paths:
      - centos8

fedora:
  stage: images
  image: registry.gitlab.com/kraxel/rpm-package-builder:fedora
  before_script:
    - time dnf install -y $FISHDEPS
  script:
    - time ./Fedora-efi-grub2.sh
    - *store_images
  artifacts:
    paths:
      - fedora

fedora_systemd:
  stage: images
  image: registry.gitlab.com/kraxel/rpm-package-builder:fedora
  before_script:
    - time dnf install -y $FISHDEPS
  script:
    - time ./Fedora-efi-systemd.sh
    - *store_images
  artifacts:
    paths:
      - fedora_systemd

fedora_kickstart:
  stage: images
  image: registry.gitlab.com/kraxel/rpm-package-builder:fedora
  when: manual
  before_script:
    - time dnf install -y $FISHDEPS $KICKDEPS
  script:
    - sudo systemctl start libvirtd
    - time ./kickstart/run-install.sh
      fedora-34-ks-x86_64.qcow2
      https://download.fedoraproject.org/pub/fedora/linux/releases/34/Server/x86_64/os/
      kickstart/fedora.ks
    - *store_images
  artifacts:
    paths:
      - fedora_kickstart

wsl:
  stage: images
  image: registry.gitlab.com/kraxel/rpm-package-builder:fedora
  script:
    - sed -i -e '/proxy/d' repos/centos-8.repo
    - dnf install -y which
    - time ./Fedora-wsl.sh
    - time ./CentOS8-wsl.sh
    - *store_images
  artifacts:
    paths:
      - wsl

pages:
  stage: publish
  image: registry.gitlab.com/kraxel/rpm-package-builder:fedora
  dependencies:
    - centos7
    - centos8
    - fedora
    - fedora_systemd
    - wsl
  script:
    - mkdir public
    - for d in centos7 centos8 fedora wsl; do mv -v ${d}/index.html public/${d}.html; done
    - cat pages/header.html                     >  listing.html
    - cat pages/efi.html                        >> listing.html
    - cat public/*.html | grep "href.*qcow2.xz" >> listing.html
    - cat pages/wsl.html                        >> listing.html
    - cat public/*.html | grep "href.*tar.xz"   >> listing.html
    - cat pages/footer.html                     >> listing.html
    - mv -v listing.html public/index.html
    - tree --charset utf8 -T "images" -H . public > tree.html
    - mv -v tree.html public
  artifacts:
    paths:
      - public/