Sfoglia il codice sorgente

dockerized rpm build

Tobias von Dewitz 6 anni fa
parent
commit
1b479eb4d2
1 ha cambiato i file con 8 aggiunte e 1 eliminazioni
  1. 8 1
      build-rpm-centos7.sh

+ 8 - 1
build-rpm-centos7.sh

@@ -1,5 +1,7 @@
 #!/bin/bash
 
+set -x
+
 DESTDIR=./dist
 VERSION=$(git describe --tag | sed 's/^v//')
 ITERATION=1
@@ -26,6 +28,8 @@ install -v -m 644 $BINARY.toml $DESTDIR/usr/share/$BINARY/
 install -v -m 644 ca-chain.cert.pem $DESTDIR/etc/$BINARY/
 
 
+
+docker run --rm -i -t -v $PWD:/scw -v $PWD/rpmmacros:/home/build/.rpmmacros -w /scw scw-centos7-build:latest \
 fpm -s dir -t $PKG_TYPE -C $DESTDIR --name $BINARY \
   --version $VERSION \
   --iteration $ITERATION \
@@ -37,6 +41,7 @@ fpm -s dir -t $PKG_TYPE -C $DESTDIR --name $BINARY \
   -p $OUTDIR \
   --rpm-sign
 
+
 ok=$?
 
 rm -rf $DESTDIR
@@ -46,7 +51,9 @@ if [ $ok -eq 0 -a -f "$rpm_file" ]; then
 	# rm -f "$RPM_DIR/$BINARY-*.rpm"
   cp "$rpm_file" "$RPM_DIR"
 
+	docker run --rm -i -t -v $RPM_DIR:/rpms -w /rpms scw-centos7-build:latest \
+    createrepo -v . \
+
 	(cd "$RPM_DIR" && \
-   createrepo -v . && \
    rsync -av --progress --delete . fender.spyz.org:/srv/http-vhosts/rpm.scraperwall.com/centos7/)
 fi