]> git.pld-linux.org Git - packages/gitlab-runner.git/blame - gitlab-ci-multi-runner.spec
up to 1.8.0; prebuilt docker images moved to separate package
[packages/gitlab-runner.git] / gitlab-ci-multi-runner.spec
CommitLineData
72cef35a 1
3e1b3fba 2# the revision for images
ec0a53a6
ER
3# $ git fetch https://gitlab.com/gitlab-org/gitlab-ci-multi-runner refs/tags/v1.6.0
4# $ git rev-list -n 1 --abbrev-commit FETCH_HEAD
5#define revision 76fdacd
6# No changes to image, so don't refetch it
7%define revision 1.5.2
c5c6476d
ER
8Summary: The official GitLab CI runner written in Go
9Name: gitlab-ci-multi-runner
5d178ba2
ER
10Version: 1.8.0
11Release: 1
b306b97b 12License: MIT
c5c6476d
ER
13Group: Development/Building
14Source0: https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/repository/archive.tar.gz?ref=v%{version}&/%{name}-%{version}.tar.gz
5d178ba2 15# Source0-md5: aed7c89fb2d0fa9c61c97d0206cc048b
af21cb3e
ER
16Source3: %{name}.init
17Source4: %{name}.sysconfig
18Source5: %{name}.service
72cef35a 19Patch0: nodim_gz.patch
c4affa20 20Patch1: branch-preserver.patch
c5c6476d
ER
21URL: https://gitlab.com/gitlab-org/gitlab-ci-multi-runner
22BuildRequires: git-core
dfe9a179 23BuildRequires: golang >= 1.6
98c01f80
ER
24BuildRequires: rpmbuild(macros) >= 1.647
25Requires(post,preun): /sbin/chkconfig
26Requires(post,preun,postun): systemd-units >= 38
fbac930f
ER
27Requires(postun): /usr/sbin/groupdel
28Requires(postun): /usr/sbin/userdel
29Requires(pre): /bin/id
30Requires(pre): /usr/bin/getgid
31Requires(pre): /usr/sbin/groupadd
32Requires(pre): /usr/sbin/useradd
d20ff300 33Requires: bash
c5c6476d 34Requires: ca-certificates
c5c6476d 35Requires: git-core
98c01f80
ER
36Requires: rc-scripts
37Requires: systemd-units >= 0.38
c5c6476d 38Requires: tar
ff1d3f82 39Suggests: docker >= 1.8
5d178ba2
ER
40Suggests: gitlab-ci-multi-runner-image-arm
41Suggests: gitlab-ci-multi-runner-image-x86_64
fbac930f
ER
42Provides: group(gitlab-runner)
43Provides: user(gitlab-runner)
4ffe1735 44ExclusiveArch: %{ix86} %{x8664} %{arm}
c5c6476d
ER
45BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
46
4ffe1735
ER
47# go stuff
48%define _enable_debug_packages 0
49%define gobuild(o:) go build -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n')" -a -v -x %{?**};
7ad949a0 50%define import_path gitlab.com/gitlab-org/gitlab-ci-multi-runner
4ffe1735 51
c5c6476d
ER
52%description
53This is the official GitLab Runner written in Go. It runs tests and
54sends the results to GitLab. GitLab CI is the open-source continuous
55integration service included with GitLab that coordinates the testing.
56
57%prep
58%setup -qc
c5c6476d 59
7ad949a0
ER
60# for doc
61mv gitlab-ci-multi-runner-*/*.md .
62
63# don't you love go?
64install -d src/$(dirname %{import_path})
65mv gitlab-ci-multi-runner-* src/%{import_path}
66cd src/%{import_path}
bf2084d5 67
5d178ba2 68%patch0 -p1
dfe9a179 69%patch1 -p1
72cef35a 70
a0a05733
ER
71# avoid docker being used even if executable found
72cat <<'EOF' > docker
73#!/bin/sh
74echo >&2 "No docker"
75exit 1
76EOF
77chmod a+rx docker
78
c5c6476d 79%build
7ad949a0
ER
80export GOPATH=$(pwd)
81cd src/%{import_path}
a0a05733 82export PATH=$(pwd):$PATH
bf2084d5 83
69a70248 84%{__make} version | tee version.txt
d16d4f3d 85
7ad949a0
ER
86CN=gitlab.com/gitlab-org/gitlab-ci-multi-runner/common
87LDFLAGS="-X $CN.NAME=gitlab-ci-multi-runner -X $CN.VERSION=%{version} -X $CN.REVISION=%{revision}"
4ffe1735 88%gobuild
c5c6476d 89
f81cac35 90# verify that version matches
7ad949a0 91./gitlab-ci-multi-runner -v > v
f81cac35
ER
92v=$(awk '$1 == "Version:" {print $2}' v)
93test "$v" = "%{version}"
69a70248 94
c5c6476d
ER
95%install
96rm -rf $RPM_BUILD_ROOT
af21cb3e 97install -d $RPM_BUILD_ROOT{%{_sysconfdir}/gitlab-runner,%{_bindir},/etc/{rc.d/init.d,sysconfig},%{systemdunitdir},/var/lib/gitlab-runner/.gitlab-runner}
770719bc 98
7ad949a0 99install -p src/%{import_path}/%{name} $RPM_BUILD_ROOT%{_bindir}/gitlab-runner
af21cb3e
ER
100install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
101cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
102cp -p %{SOURCE5} $RPM_BUILD_ROOT%{systemdunitdir}
fbac930f 103
c2bf33c4
ER
104# backward compat name for previous pld packaging
105ln -s gitlab-runner $RPM_BUILD_ROOT%{_bindir}/gitlab-ci-multi-runner
c5c6476d
ER
106
107%clean
108rm -rf $RPM_BUILD_ROOT
109
fbac930f
ER
110%pre
111%groupadd -g 330 gitlab-runner
112%useradd -u 330 -d /var/lib/gitlab-runner -g gitlab-runner -c "GitLab Runner" gitlab-runner
113
114%postun
115if [ "$1" = "0" ]; then
116 %userremove gitlab-runner
117 %groupremove gitlab-runner
118fi
98c01f80
ER
119%systemd_reload
120
121%post
122/sbin/chkconfig --add %{name}
123%service %{name} restart
124%systemd_post %{name}.service
125
126%preun
127if [ "$1" = "0" ]; then
128 %service -q %{name} stop
129 /sbin/chkconfig --del %{name}
130fi
131%systemd_preun %{name}.service
fbac930f 132
c5c6476d
ER
133%files
134%defattr(644,root,root,755)
135%doc README.md CHANGELOG.md
af21cb3e
ER
136%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/gitlab-ci-multi-runner
137%attr(754,root,root) /etc/rc.d/init.d/gitlab-ci-multi-runner
770719bc 138%dir %attr(750,root,root) %{_sysconfdir}/gitlab-runner
4ffe1735 139%attr(755,root,root) %{_bindir}/gitlab-ci-multi-runner
c2bf33c4 140%attr(755,root,root) %{_bindir}/gitlab-runner
af21cb3e 141%{systemdunitdir}/gitlab-ci-multi-runner.service
fbac930f 142%dir %attr(750,gitlab-runner,gitlab-runner) /var/lib/gitlab-runner
dd56a935 143%dir %attr(750,gitlab-runner,gitlab-runner) /var/lib/gitlab-runner/.gitlab-runner
This page took 0.053512 seconds and 4 git commands to generate.