summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2018-03-29 12:45:40 +0200
committerGerd Hoffmann <kraxel@redhat.com>2018-03-29 12:45:40 +0200
commit568492d87777067b77320d84d44ebe7825d78b87 (patch)
tree2d14a0b41dd20fbb215f049ddf686803dc4006d4
parent007fea5af1349652a689d8b2c8e22d2438dce4fc (diff)
downloadseabios-568492d87777067b77320d84d44ebe7825d78b87.tar.gz
jenkinsfile
-rw-r--r--Jenkinsfile76
1 files changed, 76 insertions, 0 deletions
diff --git a/Jenkinsfile b/Jenkinsfile
new file mode 100644
index 0000000..9e554bf
--- /dev/null
+++ b/Jenkinsfile
@@ -0,0 +1,76 @@
+#!/usr/bin/env groovy
+
+def RPMSource() {
+ dir ('source') {
+ checkout([
+ $class: 'GitSCM',
+ branches: [
+ [ name: '*/master' ]
+ ],
+ extensions: [
+ [
+ $class: 'CloneOption',
+ timeout: 60
+ ]
+ ],
+ userRemoteConfigs: [
+ [ url: 'git://git.seabios.org/seabios.git' ]
+ ]])
+ }
+}
+
+def RPMBuild() {
+ sh '''
+ # fresh snapshot tarball
+ rm -f *.tar*
+ (cd source; scripts/tarball.sh)
+ tarball="$(cd source; ls *.tar*)"
+ mv source/$tarball .
+
+ # figure version
+ commit="$(cd source; git describe --long --match 'rel-*')"
+ ghash="${commit##*-}"
+ commit="${commit%-*}"
+ gcnt="${commit##*-}"
+ commit="${commit%-*}"
+ version="${commit#rel-}"
+
+ # tweak spec file
+ sed -i.orig \
+ -e "s/(Version:[ \t]+)(.*)/\$1${version}/"
+ *.spec
+ diff *.spec.orig *.spec
+
+ # build package
+ echo "TODO: rpmbuild"
+
+ # revert spec file changes
+ git reset --hard
+ '''
+}
+
+pipeline {
+ agent {
+ node 'sys-rhel7-x64'
+ }
+
+ triggers {
+ pollSCM('H * * * *')
+ }
+
+ stages {
+
+ stage ('Prepare') {
+ steps {
+ RPMSource();
+ }
+ }
+
+ stage ("RPM Build") {
+ steps {
+ RPMBuild()
+ }
+ }
+
+ }
+}