Se ha denunciado esta presentación.
Utilizamos tu perfil de LinkedIn y tus datos de actividad para personalizar los anuncios y mostrarte publicidad más relevante. Puedes cambiar tus preferencias de publicidad en cualquier momento.

Jenkins 2を使った究極のpipeline ~ 明日もう一度来てください、本物のpipelineをお見せしますよ ~

13.840 visualizaciones

Publicado el

第9回Jenkins勉強会
http://jenkins.connpass.com/event/35030/

Publicado en: Tecnología
  • Sé el primero en comentar

Jenkins 2を使った究極のpipeline ~ 明日もう一度来てください、本物のpipelineをお見せしますよ ~

  1. 1. catchError { def stage def util // node { checkout scm stage = load 'jenkins/stage.groovy' util = load 'jenkins/util.groovy' } // stage.compile(util) if (!stage.test(util)) return stage.pkg(util, 'dev') stage.deploy(util, 'dev') if (!stage.smokeTest(util)) return stage.pkg(util, 'beta') } typetalkSend name: 'Jenkins', topicId: 1234
  2. 2. catchError { stage.compile(util) if (!stage.test(util)) return } typetalkSend name: 'Jenkins', topicId: 1234 def isSuccess() { currentBuild.result == 'SUCCESS' || currentBuild.result == null }
  3. 3. def image = docker.image('nulab-operation-server') image.inside('-u root') { sh "fab $target app.release }
  4. 4. public class TypetalkSendStep extends AbstractStepImpl { @DataBoundConstructor public TypetalkSendStep(@Nonnull String name, @Nonnull Long topicId) { this.name = name; this.topicId = topicId; } @Extension public static class DescriptorImpl extends AbstractStepDescriptorImpl { @Override public String getFunctionName() { return "typetalkSend"; } @Override public String getDisplayName() { return "Notify Typetalk when the build fails"; } public DescriptorImpl() { super(TypetalkSendStepExecution.class); } }
  5. 5. public static class TypetalkSendStepExecution extends AbstractSynchronousNonBlockingStepExecution<Void> { private static final long serialVersionUID = 1L; @Inject transient TypetalkSendStep step; @StepContextParameter transient TaskListener listener; @StepContextParameter transient Run run; @Override protected Void run() throws Exception { new NotifyDelegate(step.name, step.topicId, listener, run) .notifyResult(); return null; } } }
  6. 6. List<RefSpec> refSpecs = getRefSpecs(); client.fetch(remoteName, refSpecs.toArray(new RefSpec[refSpecs.size()])); … for (Branch b : client.getRemoteBranches()) { if (!isPullRequestOpen(pullRequests, branchName)) { continue; } … } protected List<RefSpec> getRefSpecs() { // return Arrays.asList(new RefSpec("+refs/heads/*:refs/remotes/" + getRemoteName() + "/*")); return Arrays.asList(new RefSpec("+refs/pull/*:refs/remotes/" + getRemoteName() + "/*")); }

×