diff --git a/docker-build-centos.sh b/docker-build-centos.sh new file mode 100755 index 0000000..6e76d06 --- /dev/null +++ b/docker-build-centos.sh @@ -0,0 +1,80 @@ +#!/bin/bash + +VERSION=0.1 + +OUTPUT_DIR=$PWD + +SOURCE_DIR=$(readlink -f $(dirname ${BASH_SOURCE[0]})) + +docker run --rm -i -v $SOURCE_DIR:/root/rpmbuild/SOURCES/laminar-$VERSION:ro -v $OUTPUT_DIR:/output centos bash -xe < laminar.spec +Summary: Lightweight Continuous Integration Service +Name: laminar +Version: $VERSION +Release: 1 +License: GPL +BuildRequires: systemd-units +Requires: boost-filesystem + +%description +Lightweight Continuous Integration Service + +%prep + +%build +cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/ %{_sourcedir}/laminar-0.1 +pwd +make + +%install +%make_install + +%files +%{_bindir}/laminarc +%{_bindir}/laminard +%{_unitdir}/laminar.service +%config(noreplace) %{_sysconfdir}/laminar.conf + +%post +echo Creating laminar user with home in %{_sharedstatedir}/laminar +useradd -r -d %{_sharedstatedir}/laminar -s %{_sbindir}/nologin laminar +mkdir -p %{_sharedstatedir}/laminar/{jobs,archive,nodes,scripts} +chown -R laminar: %{_sharedstatedir}/laminar +EOF + +rpmbuild -ba laminar.spec +mv rpmbuild/RPMS/x86_64/laminar-0.1-1.x86_64.rpm /output/ +EOS \ No newline at end of file diff --git a/docker-build-ubuntu.sh b/docker-build-ubuntu.sh new file mode 100755 index 0000000..a32a079 --- /dev/null +++ b/docker-build-ubuntu.sh @@ -0,0 +1,71 @@ +#!/bin/bash + +VERSION=0.1 + +OUTPUT_DIR=$PWD + +SOURCE_DIR=$(readlink -f $(dirname ${BASH_SOURCE[0]})) + +#docker run --rm -i -v $SOURCE_DIR:/laminar:ro -v $OUTPUT_DIR:/output ubuntu bash -xe < laminar/DEBIAN/control +Package: laminar +Version: $VERSION +Section: +Priority: optional +Architecture: amd64 +Depends: libboost-filesystem1.54.0 +Description: Lightweight Continuous Integration Service +EOF +cat < laminar/DEBIAN/postinst +#!/bin/sh +echo Creating laminar user with home in /var/lib/laminar +useradd -r -d /var/lib/laminar -s /usr/sbin/nologin laminar +mkdir -p /var/lib/laminar/{jobs,archive,nodes,scripts} +chown -R laminar: /var/lib/laminar +EOF +chmod +x laminar/DEBIAN/postinst + +dpkg-deb --build laminar +mv laminar.deb /output/laminar_$VERSION-1_amd64.deb +EOS