|
|
@ -1,5 +1,7 @@ |
|
|
|
|
|
|
|
%define ccdir /var/lib/concourse/ |
|
|
|
|
|
|
|
|
|
|
|
Name: concourse |
|
|
|
Name: concourse |
|
|
|
Version: 7.1.0 |
|
|
|
Version: 7.2.0 |
|
|
|
Release: 1%{?dist} |
|
|
|
Release: 1%{?dist} |
|
|
|
Source0: https://github.com/concourse/concourse/archive/v%{version}.tar.gz |
|
|
|
Source0: https://github.com/concourse/concourse/archive/v%{version}.tar.gz |
|
|
|
Summary: Concourse is a container-based continuous thing-doer written in Go and Elm. |
|
|
|
Summary: Concourse is a container-based continuous thing-doer written in Go and Elm. |
|
|
@ -17,16 +19,15 @@ Concourse presents a general approach to automation that makes it great for CI/C |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%package web |
|
|
|
%package web |
|
|
|
Source100: concourse-web.service |
|
|
|
Source100: concourse-web.config |
|
|
|
Source101: concourse-web.config |
|
|
|
|
|
|
|
Summary: Concourse Web |
|
|
|
Summary: Concourse Web |
|
|
|
Requires: concourse |
|
|
|
Requires: concourse |
|
|
|
|
|
|
|
BuildArch: noarch |
|
|
|
%description web |
|
|
|
%description web |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%package worker |
|
|
|
%package worker |
|
|
|
Source200: concourse-worker.service |
|
|
|
Source200: concourse-worker.config |
|
|
|
Source201: concourse-worker.config |
|
|
|
|
|
|
|
Summary: Concourse Worker |
|
|
|
Summary: Concourse Worker |
|
|
|
Requires: concourse |
|
|
|
Requires: concourse |
|
|
|
%description worker |
|
|
|
%description worker |
|
|
@ -42,44 +43,96 @@ Summary: A command line interface that runs a build in a container with ATC |
|
|
|
mkdir -p src/github.com/concourse/ |
|
|
|
mkdir -p src/github.com/concourse/ |
|
|
|
tar xvf %{SOURCE0} |
|
|
|
tar xvf %{SOURCE0} |
|
|
|
mv concourse-%{version} src/github.com/concourse/concourse/ |
|
|
|
mv concourse-%{version} src/github.com/concourse/concourse/ |
|
|
|
|
|
|
|
mkdir -p src/github.com/cloudfoundry/ |
|
|
|
|
|
|
|
cd src/github.com/cloudfoundry/ |
|
|
|
|
|
|
|
git clone https://github.com/cloudfoundry/guardian |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%build |
|
|
|
%build |
|
|
|
export GOPATH=`pwd` |
|
|
|
export GOPATH=`pwd` |
|
|
|
export GO111MODULE=on |
|
|
|
export GO111MODULE=on |
|
|
|
cd src/github.com/concourse/concourse |
|
|
|
pushd src/github.com/concourse/concourse |
|
|
|
%ifarch ppc64 |
|
|
|
%ifarch ppc64 |
|
|
|
export CGO_ENABLED=1 |
|
|
|
export CGO_ENABLED=1 |
|
|
|
%endif |
|
|
|
%endif |
|
|
|
go mod download |
|
|
|
go mod download |
|
|
|
go build -v -gcflags=all="-N -l" -ldflags "-extldflags -s -w -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')" -o concourse ./cmd/concourse |
|
|
|
go build -v -trimpath -gcflags=all="-N -l" -ldflags "-extldflags -s -w -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -buildid "%{version}" -X 'github.com/concourse.Version="%{version}"'" -o concourse ./cmd/concourse |
|
|
|
pushd fly |
|
|
|
pushd fly |
|
|
|
go build -v -gcflags=all="-N -l" -ldflags "-extldflags -s -w -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')" -o fly |
|
|
|
go build -v -trimpath -gcflags=all="-N -l" -ldflags "-extldflags -s -w -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -buildid "%{version}" -X 'gibhub.com/concourse.Version="%{version}"'" -o fly |
|
|
|
|
|
|
|
popd |
|
|
|
|
|
|
|
### TODO: port elm/ghc to ppc64le |
|
|
|
|
|
|
|
### currently build as noarch on x64 and use assets on other arches |
|
|
|
|
|
|
|
%ifarch x86_64 |
|
|
|
|
|
|
|
#pushd web/assets/css/ |
|
|
|
|
|
|
|
npm install -g lessc |
|
|
|
|
|
|
|
#$GOPATH/src/github.com/concourse/concourse/node_modules/lessc/node_modules/less/bin/lessc -x main.less > main.css; |
|
|
|
|
|
|
|
yarnpkg build-less |
|
|
|
|
|
|
|
yarnpkg build-elm |
|
|
|
|
|
|
|
npm install -g webpack |
|
|
|
|
|
|
|
npm install -g webpack-cli |
|
|
|
|
|
|
|
#$GOPATH/src/github.com/concourse/concourse/node_modules/webpack-cli/bin/cli.js --mode production |
|
|
|
|
|
|
|
yarnpkg build-js |
|
|
|
|
|
|
|
#popd |
|
|
|
|
|
|
|
%endif |
|
|
|
|
|
|
|
popd |
|
|
|
|
|
|
|
pushd src/github.com/cloudfoundry/guardian |
|
|
|
|
|
|
|
go build -v -trimpath -gcflags=all="-N -l" -ldflags "-extldflags -s -w -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -buildid "%{version}" -X 'main.version="%{version}"'" -o gdn ./cmd/gdn |
|
|
|
popd |
|
|
|
popd |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%install |
|
|
|
%install |
|
|
|
|
|
|
|
mkdir -p %{buildroot}%{ccdir}/bin/ |
|
|
|
|
|
|
|
cp -rv src/github.com/concourse/concourse/concourse %{buildroot}%{ccdir}/bin/ |
|
|
|
mkdir -p %{buildroot}%{_bindir} |
|
|
|
mkdir -p %{buildroot}%{_bindir} |
|
|
|
cp -rv src/github.com/concourse/concourse/concourse %{buildroot}%{_bindir} |
|
|
|
|
|
|
|
cp -rv src/github.com/concourse/concourse/fly/fly %{buildroot}%{_bindir} |
|
|
|
cp -rv src/github.com/concourse/concourse/fly/fly %{buildroot}%{_bindir} |
|
|
|
mkdir -p %{buildroot}%{_unitdir} |
|
|
|
mkdir -p %{buildroot}%{_unitdir} |
|
|
|
cp -rv %{SOURCE100} %{buildroot}%{_unitdir} |
|
|
|
cat > %{buildroot}%{_unitdir}/concourse-web.service <<EOF |
|
|
|
cp -rv %{SOURCE200} %{buildroot}%{_unitdir} |
|
|
|
[Unit] |
|
|
|
mkdir -p %{buildroot}%{_sysconfdir}/%{name}/web/ |
|
|
|
Description=Concourse CI Web Process |
|
|
|
cp %{SOURCE101} %{buildroot}%{_sysconfdir}/%{name}/web/config |
|
|
|
After=postgresql.service |
|
|
|
mkdir -p %{buildroot}%{_sysconfdir}/%{name}/worker/ |
|
|
|
|
|
|
|
cp %{SOURCE201} %{buildroot}%{_sysconfdir}/%{name}/worker/config |
|
|
|
[Service] |
|
|
|
|
|
|
|
User=concourse |
|
|
|
|
|
|
|
Restart=on-failure |
|
|
|
|
|
|
|
EnvironmentFile=%{ccdir}etc/web/config |
|
|
|
|
|
|
|
ExecStart=%{ccdir}bin/concourse web |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Install] |
|
|
|
|
|
|
|
WantedBy=multi-user.target |
|
|
|
|
|
|
|
EOF |
|
|
|
|
|
|
|
cat > %{buildroot}%{_unitdir}/concourse-worker.service <<EOF |
|
|
|
|
|
|
|
[Unit] |
|
|
|
|
|
|
|
Description=Concourse CI Worker |
|
|
|
|
|
|
|
After=network-online.target |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Service] |
|
|
|
|
|
|
|
User=concourse |
|
|
|
|
|
|
|
Restart=on-failure |
|
|
|
|
|
|
|
EnvironmentFile=%{ccdir}etc/worker/config |
|
|
|
|
|
|
|
ExecStart=%{ccdir}bin/concourse worker |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Install] |
|
|
|
|
|
|
|
WantedBy=multi-user.target |
|
|
|
|
|
|
|
EOF |
|
|
|
|
|
|
|
mkdir -p %{buildroot}%{ccdir}/etc/web/ |
|
|
|
|
|
|
|
cp %{SOURCE100} %{buildroot}%{ccdir}/etc/web/config |
|
|
|
|
|
|
|
mkdir -p %{buildroot}%{ccdir}/etc/worker/ |
|
|
|
|
|
|
|
cp %{SOURCE200} %{buildroot}%{ccdir}/etc/worker/config |
|
|
|
|
|
|
|
mkdir -p %{buildroot}%{ccdir}/web/ |
|
|
|
|
|
|
|
%ifarch x86_64 |
|
|
|
|
|
|
|
cp -rv src/github.com/concourse/concourse/web/public %{buildroot}%{ccdir}/web/ |
|
|
|
|
|
|
|
%endif |
|
|
|
|
|
|
|
mkdir -p %{buildroot}%{ccdir}/keys/ |
|
|
|
|
|
|
|
cp src/github.com/cloudfoundry/guardian/gdn %{buildroot}/%{_bindir}/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%pre |
|
|
|
%pre |
|
|
|
getent group concourse > /dev/null || groupadd -r concourse |
|
|
|
getent group concourse > /dev/null || groupadd -r concourse |
|
|
|
getent passwd concourse > /dev/null || useradd -r -d /var/lib/concourse -g concourse -s /sbin/nologin -c "Concourse User" concourse |
|
|
|
getent passwd concourse > /dev/null || useradd -r -d %{ccdir} -g concourse -s /sbin/nologin -c "Concourse User" concourse |
|
|
|
exit 0 |
|
|
|
exit 0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%post web |
|
|
|
%post web |
|
|
|
%{_bindir}/concourse generate-key -t rsa -f /etc/concourse/web/session_signing_key |
|
|
|
|
|
|
|
%{_bindir}/concourse generate-key -t ssh -f /etc/concourse/web/tsa_host_key |
|
|
|
|
|
|
|
%systemd_post concourse-web.service |
|
|
|
%systemd_post concourse-web.service |
|
|
|
%preun web |
|
|
|
%preun web |
|
|
|
%systemd_preun concourse-web.service |
|
|
|
%systemd_preun concourse-web.service |
|
|
@ -88,7 +141,6 @@ exit 0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%post worker |
|
|
|
%post worker |
|
|
|
%{_bindir}/concourse generate-key -t ssh -f /etc/concourse/worker/tsa_host_key |
|
|
|
|
|
|
|
%systemd_post concourse-worker.service |
|
|
|
%systemd_post concourse-worker.service |
|
|
|
%postun worker |
|
|
|
%postun worker |
|
|
|
%systemd_postun concourse-worker.service |
|
|
|
%systemd_postun concourse-worker.service |
|
|
@ -97,17 +149,22 @@ exit 0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%files |
|
|
|
%files |
|
|
|
%{_bindir}/concourse |
|
|
|
%{ccdir}/bin/concourse |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%ifarch x86_64 |
|
|
|
%files web |
|
|
|
%files web |
|
|
|
%{_sysconfdir}/%{name}/web/config |
|
|
|
%config(noreplace) %{ccdir}/etc/web/config |
|
|
|
|
|
|
|
%{ccdir}/ |
|
|
|
|
|
|
|
%{ccdir}/web/public/ |
|
|
|
%{_unitdir}/concourse-web.service |
|
|
|
%{_unitdir}/concourse-web.service |
|
|
|
|
|
|
|
%endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%files worker |
|
|
|
%files worker |
|
|
|
%{_sysconfdir}/%{name}/worker/config |
|
|
|
%config(noreplace) %{ccdir}/etc/worker/config |
|
|
|
%{_unitdir}/concourse-worker.service |
|
|
|
%{_unitdir}/concourse-worker.service |
|
|
|
|
|
|
|
%{_bindir}/gdn |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%files fly |
|
|
|
%files fly |
|
|
|