aboutsummaryrefslogtreecommitdiffstats
path: root/gitlab-ci-rpms-tito-devel.yml
blob: 91265cb646f3a6c4cbb4a5a3068ed62a04e4cdcd (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
tito_fedora_aarch64:
  stage: rpms
  image: registry.gitlab.com/kraxel/rpm-package-builder:fedora
  tags:
    - aarch64
  rules:
    - if: '$BUILD_AARCH64 == "yes"'
  before_script:
    - dnf builddep -y *.spec
  script:
    - tito build --test --rpm --output rpms-fedora-aarch64
    - createrepo rpms-fedora-aarch64
  artifacts:
    paths:
      - rpms-fedora-aarch64/

tito_fedora_x86_64:
  stage: rpms
  image: registry.gitlab.com/kraxel/rpm-package-builder:fedora
  before_script:
    - dnf builddep -y *.spec
  script:
    - tito build --test --rpm --output rpms-fedora-x86_64
    - createrepo rpms-fedora-x86_64
  artifacts:
    paths:
      - rpms-fedora-x86_64/

tito_el7_x86_64:
  stage: rpms
  image: registry.gitlab.com/kraxel/rpm-package-builder:el7
  before_script:
    - yum-builddep -y *.spec
  script:
    - tito build --test --rpm --output rpms-el7-x86_64
    - createrepo rpms-el7-x86_64
  artifacts:
    paths:
      - rpms-el7-x86_64/

tito_el8_x86_64:
  stage: rpms
  image: registry.gitlab.com/kraxel/rpm-package-builder:el8
  before_script:
    - dnf builddep -y *.spec
  script:
    - tito build --test --rpm --output rpms-el8-x86_64
    - createrepo rpms-el8-x86_64
  artifacts:
    paths:
      - rpms-el8-x86_64/

tito_stream8_x86_64:
  stage: rpms
  image: registry.gitlab.com/kraxel/rpm-package-builder:stream8
  before_script:
    - dnf builddep -y *.spec
  script:
    - tito build --test --rpm --output rpms-stream8-x86_64
    - createrepo rpms-stream8-x86_64
  artifacts:
    paths:
      - rpms-stream8-x86_64/

pages:
  stage: repo
  image: registry.gitlab.com/kraxel/rpm-package-builder:fedora
  script:
    - >
      for dir in rpms-*;
      do
      item="${dir#rpms-}";
      arch="${item#*-}";
      distro="${item%%-*}";
      test -d "${dir}/${arch}" && mkdir -p "public/${distro}/${arch}";
      test -d "${dir}/${arch}" && mv -v ${dir}/${arch}/*.rpm "public/${distro}/${arch}";
      test -d "${dir}/noarch" && mkdir -p "public/${distro}/noarch";
      test -d "${dir}/noarch" && mv -v ${dir}/noarch/*.rpm "public/${distro}/noarch";
      mkdir -p "public/${distro}/src";
      mv -v ${dir}/*.src.rpm "public/${distro}/src";
      createrepo public/${distro};
      done
    - >
      for dir in public/*;
      do
      distro="${dir#public/}";
      name="gitlab-${CI_PROJECT_NAME}-${distro}";
      repo="public/${name}.repo";
      echo "[${name}]"                            >  "$repo";
      echo "name=${name}"                         >> "$repo";
      echo "baseurl=${CI_PAGES_URL}/${distro}/"   >> "$repo";
      echo "skip_if_unavailable=1"                >> "$repo";
      echo "metadata_expire=10m"                  >> "$repo";
      echo "gpgcheck=0"                           >> "$repo";
      done
    - tree -T "$CI_PROJECT_NAME rpms" --charset utf8 -H . public > index.html
    - mv index.html public
  artifacts:
    paths:
      - public/