Advertisement

More Related Content

Slideshows for you(20)

Advertisement
Advertisement

Jenkins and Groovy

  1. Jenkins Groovy
  2. (@kiy0taka id:kiy0taka) Grails/Groovy Jenkins Plugin Terminal jQuery jQuery UI LT Hudson http://www.ustream.tv/recorded/10801838
  3. Jenkins
  4. Grape Maven/Ivy jar 2
  5. Grape @Grab(‘groupId:artifactId:version’) import groovy.grape.Grape Grape.grab(group:'groupId', module:'artifactId', version:'version') grape install <groupId> <artifactId> <version>
  6. @Grab ( ) @Grab('org.apache.poi:poi:3.2-FINAL') import org.apache.poi.hssf.usermodel.* def workBook = new HSSFWorkbook(new File('./foo.xls') workBook.newInputStream()).sheets.each { sheet -> sheet.firstRowNum.upto(sheet.lastRowNum) { sheet.getRow(it).with { row -> row.firstCellNum.upto(row.lastCellNum - 1) { println row.getCell(it).stringCellValue } } } }
  7. @Grab ( ) @Grab('org.mortbay.jetty:jetty-embedded:6.1.25') @Grab('com.h2database:h2:1.2.144') @Grab('mysql:mysql-connector-java:5.1.13') import org.mortbay.jetty.Server import org.mortbay.jetty.servlet.Context import org.h2.server.web.WebServlet def server = new Server(8080) new Context(server, "/", Context.SESSIONS) .addServlet(WebServlet, "/*") server.start()
  8. http://groovy.codehaus.org/Download $ unzip groovy-binary-1.7.8.zip -d $JENKINS_HOME/tools/ $ chmod -R +x /opt/groovy-1.7.8/ $ export GROOVY_HOME=/opt/groovy-1.7.8/ $ export PATH=$GROOVY_HOME/bin
  9. groovysh
  10. groovyConsole
  11. Groovy Jenkins Groovy Jenkins Jenkins Groovy
  12. Jenkins
  13. Groovy $JENKINS_HOME/init.groovy http://jenkinsserver/script Jenkins CLI Groovy Jenkins groovysh Jenkins
  14. init.groovy $JENKINS_HOME/init.groovy Post-initialization script import hudson.model.*; // start in the state that doesn't do any build. Hudson.instance.doQuietDown(); http://wiki.jenkins-ci.org/display/JENKINS/Post-initialization+script
  15. Groovy Jenkins http://jenkinsserver/script
  16. Jenkins CLI (Script) $ java -jar jenkins-cli.jar > -s http://jenkinsserver > groovy hoge.groovy http://wiki.jenkins-ci.org/display/JENKINS/Jenkins+Script+Console http://scriptlerweb.appspot.com/
  17. Jenkins CLI (groovysh) $ java -jar jenkins-cli.jar > -s http://jenkinsserver groovysh
  18. ... Groovy groovysh
  19. JenkinsGroovyConsole GroovyConsole Jenkins GroovyConsole jenkins-cli.jar groovy JenkinsGroovyConsole [jenkins_url] https://gist.github.com/843507
  20. @GrabResolver('http://maven.glassfish.org/content/groups/public/') @Grab('org.jenkins-ci.main:cli:1.398') import hudson.cli.CLI import groovy.ui.Console jenkinsUrl = args ? args[0] : 'http://localhost:8080' Console.metaClass.newScript = { ClassLoader parent, Binding binding -> delegate.shell = new GroovyShell(parent, binding) delegate.shell.metaClass.run = { String scriptText, String fileName, List list -> def file = File.createTempFile('jenkinsgroovyconsole', '.groovy') file.text = scriptText new CLI(jenkinsUrl.toURL()).execute(['groovy', file.absolutePath], System.in, System.out, System.err) file.delete() null } } new Console(Console.class.classLoader.getRootLoader()).run()
  21. Demo (JNLP) (SSH) -Dmven.test.skip=true
  22. CI Groovy
  23. Jenkins Groovy
  24. 1. Groovy
  25. 2. Groovy http://groovy.codehaus.org/Download $ unzip groovy-binary-1.7.8.zip -d $JENKINS_HOME/tools/ $ chmod -R +x $JENKINS_HOME/tools/groovy-1.7.8/
  26. 3. Jenkins http://jenkinsserver/configure
  27. Groovy Job
  28. Commons VFS Jenkins IRC Bot
  29. Groovy Grails/Groovy (JGGUG) http://www.jggug.org (?) G*Magazine http://grails.jp/g_mag_jp/

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
Advertisement