Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins Does Not Execute Steps in Jenkinsfile

Tags:

jenkins

Why does jenkins doesn't execute my jenkinsfile? The console ouput of my build is this:

20:06:19 Started by GitLab push by 
20:06:19 Building in workspace /var/jenkins_home/workspace/repo
20:06:19 [WS-CLEANUP] Deleting project workspace...
20:06:19 [WS-CLEANUP] Done
20:06:19 Cloning the remote Git repository
20:06:19 Cloning repository 
20:06:19  > git init /var/jenkins_home/workspace/ # timeout=10
20:06:19 Fetching upstream changes from https://gitlab.com/
20:06:19  > git --version # timeout=10
20:06:19 using GIT_ASKPASS to set credentials 
20:06:19  > git fetch --tags --progress https://gitlab.com/t+refs/heads/*:refs/remotes/origin/*
20:06:21  > git config remote.origin.url https://gitlab.com/ # timeout=10
20:06:21  > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
20:06:21  > git config remote.origin.url https://gitlab.com/ # timeout=10
20:06:21 Fetching upstream changes from https://gitlab.com/
20:06:21 using GIT_ASKPASS to set credentials 
20:06:21  > git fetch --tags --progress https://gitlab.com/ +refs/heads/*:refs/remotes/origin/*
20:06:22 skipping resolution of commit remotes/origin/jenkins, since it originates from another repository
20:06:22  > git rev-parse refs/remotes/origin/jenkins^{commit} # timeout=10
20:06:22  > git rev-parse refs/remotes/origin/origin/jenkins^{commit} # timeout=10
20:06:22 Checking out Revision 44f2afa95f961b5b28a482516abf05a17180ea48 (refs/remotes/origin/jenkins)
20:06:22  > git config core.sparsecheckout # timeout=10
20:06:22  > git checkout -f 44f2afa95f961b5b28a482516abf05a17180ea48
20:06:22 Commit message: "chore: test jenkins"
20:06:22  > git rev-list --no-walk dfff4c2214daa01de600086d6d28cf8f9d53cdc5 # timeout=10
20:06:22 Finished: SUCCESS

In my jenkins file I have this sample pipeline

pipeline {
    agent any

    stages {
        stage('Build') {
            steps {
                echo 'Building..'
           }
        }
        stage('Test') {
            steps {
              echo 'Testing..'
            }
        }
        stage('Deploy') {
            steps {
                echo 'Deploying....'
            }
        }
    }
}

Is there something I missed?

like image 594
Karias Bolster Avatar asked Aug 09 '18 12:08

Karias Bolster


People also ask

How do I run a Jenkinsfile script?

Click New Item on your Jenkins home page, enter a name for your (pipeline) job, select Pipeline, and click OK. In the Script text area of the configuration screen, enter your pipeline syntax.


1 Answers

You need to choose pipeline type after click new item on jenkins page, rather than choose freestyle/maven type. Input a name and click 'OK', then choose pipeline from SCM

like image 147
yong Avatar answered Oct 23 '22 22:10

yong