1

I want to deploy a java maven webapp to a local tomcat8 via jenkins. I found out that I need to install the "Deploy to container plugin", which I did.

I figured, now I should be able to add a post-build action in the configuration of my pipeline. (like described here: Deploy webapp to Tomcat after Maven build on Jenkins)

But under "configure" of my pipeline there is no tab that says "post build action" (I also don't have the build tab, which I saw on a few screenshots). After researching I added a bunch of plugins described in a few tutorials, like "Hudson Post build task" and "PostBuildScript Plugin" but that didn't change anything.

Am I missing a specific plugin or is there something else wrong?

Thanks in advance!

alex
  • 180
  • 1
  • 13

1 Answers1

0

If you're using a job of 'Pipeline' type (not a 'Freestyle' type where those 'PostBuildScript plugin' refers to), you need the perform the above in the 'post' part of your pipeline:

pipeline {
  agent
  ...
  stages {
    ...
  }
  post {
    PUT YOUR CODE HERE!!!
  }
}
yorammi
  • 6,272
  • 1
  • 28
  • 34
  • Ah yes I also figured that out. But still thanks! so this means that if I choose the "pipeline" type, I can only add post build actions in the Jenkinsfile itself, is that correct? – alex Nov 23 '18 at 07:38