How to use jenkinsfile in the freestyle project

We have jenkinsfiles from out githib repository. We need to create freestyle project and use the jenkinsfile as a build.

But I don’t see any option in the build steps to use the jenkinsfile github location.

Please suggest

you can’t, jenkinsfile are a pipeline job type, freestyle are freestyle job type.

Don’t use freestyle.

Thanks for your reply.

There is no post-build actions in the pipeline type. I want to get the Email notification if the build itself failed. We can configure Email notification in the freestype project using the post-build actions.

Is there anyworkaround in the freestyle project to use the jenkinsfile?

you add a

post {
  failed {
  // do the email thing here
  }
}

to your jenkinsfile.

I recommend looking at $JENKINS_URL/pipeline-syntax/ to build out the action you want to do

no, they are entirely differnet job types, like firm no, i hate the firm no, but no.

Its like asking if you can fly through the sky in a car instead of an airplane. Yes they are both vehicles, but not the same.

Thanks again.
We have a current pipeline which is using the jenkinsfile from the AWS CodeCommit. This pipeline got failed because of the git fetch error due to invalid branch name etc. But we are looking any kind of email notification if there is any git fetch errors.

I know that we can write post build stage in the jenkinsfile itself. But in this senario, it doesn’t fetch the jensfile file itself from the CodeComit because of the git fetch error.