modified version of jenkins debian glue (https://github.com/mika/jenkins-debian-glue) for devuan
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

fabfile.py 1.3 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. ################################################################################
  2. # Deploy Debian package to jenkins build system(s)
  3. #
  4. # Usage examples:
  5. # % fab all
  6. # % fab build && fab deploy
  7. # % fab -H root@jenkins.example.org deploy
  8. ################################################################################
  9. from fabric.api import *
  10. import os, paramiko, sys
  11. def set_hosts():
  12. if not env.hosts:
  13. env.hosts = []
  14. for host in 'jenkins', 'jenkins-slave1', 'jenkins-slave2', 'jenkins-slave3', 'jenkins-slave4', 'jenkins-slave5', 'jenkins-slave6':
  15. config = paramiko.SSHConfig()
  16. config.parse(open(os.path.expandvars("$HOME") + '/.ssh/config'))
  17. h = config.lookup(host)
  18. env.hosts.append(h['user'] + "@" + h['hostname'])
  19. return env.hosts
  20. @runs_once
  21. def build():
  22. local('rm -f ../jenkins-debian-glue*all.deb')
  23. local('fakeroot debian/rules clean')
  24. local('fakeroot debian/rules binary')
  25. local('fakeroot debian/rules clean')
  26. @hosts(set_hosts())
  27. def deploy():
  28. put('../jenkins-debian-glue*_all.deb', '~/')
  29. run('dpkg -i ~/jenkins-debian-glue*_all.deb || apt-get -f install')
  30. def all():
  31. build()
  32. deploy()
  33. ## END OF FILE #################################################################