diff --git a/debuild/Dockerfile b/debuild/Dockerfile index 33efab3..e43899f 100644 --- a/debuild/Dockerfile +++ b/debuild/Dockerfile @@ -8,7 +8,7 @@ RUN apt-get update \ debhelper \ devscripts \ reprepro \ - && mkdir /build /reprepro + sudo RUN apt-get update \ && apt-get install -y --no-install-recommends \ @@ -20,7 +20,11 @@ RUN apt-get update \ && apt-get install -y --no-install-recommends \ nodejs -VOLUME ["/build", "/reprepro"] -WORKDIR /build +RUN groupadd -g 1000 jenkins \ + && useradd -d /var/jenkins_home -u 1000 -g 1000 -m -s /bin/bash jenkins \ + && echo "jenkins ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/jenkins \ + && mkdir /reprepro -COPY vn-debuild vn-include /usr/bin/ +VOLUME ["/reprepro"] + +COPY vn-includedeb /usr/bin/ diff --git a/debuild/vn-debuild b/debuild/vn-debuild deleted file mode 100755 index edb83d3..0000000 --- a/debuild/vn-debuild +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -set -e - -srcDir=$1 - -if [ ! -f "$srcDir/debian/changelog" ]; then - echo "Invalid source directory." - exit 1 -fi - -echo "Building Debian packages." -(cd "$srcDir" && debuild -uc -us -b) diff --git a/debuild/vn-include b/debuild/vn-includedeb similarity index 79% rename from debuild/vn-include rename to debuild/vn-includedeb index 871a523..6b588c2 100755 --- a/debuild/vn-include +++ b/debuild/vn-includedeb @@ -1,14 +1,14 @@ #!/bin/bash set -e -srcDir=$1 +srcDir=. if [ ! -f "$srcDir/debian/changelog" ]; then echo "Invalid source directory." exit 1 fi -codename=$2 +codename=$1 buildDir="$srcDir/.." if [ -z "$codename" ]; then @@ -22,7 +22,8 @@ while read debFile; do fi echo "Adding $debFile" - reprepro -b "/reprepro" includedeb $codename "$buildDir/$debFile" + cp "$buildDir/$debFile" /tmp + sudo -u www-data reprepro -b "/reprepro" includedeb $codename "/tmp/$debFile" done echo "Cleaning."