[JIRA] (JENKINS-39653) MARATHON PLUGIN ISSUE

27 views
Skip to first unread message

antoine.voiry@gmail.com (JIRA)

unread,
Nov 10, 2016, 1:09:01 PM11/10/16
to jenkinsc...@googlegroups.com
antoine voiry created an issue
 
Jenkins / Bug JENKINS-39653
MARATHON PLUGIN ISSUE
Issue Type: Bug Bug
Assignee: Colin
Components: marathon-plugin
Created: 2016/Nov/10 6:08 PM
Priority: Major Major
Reporter: antoine voiry

I get the below strange error when trying to deploy to MESOS.

The snippet of code looks as follow

marathon(
url: 'http://marathon-instance',
forceUpdate: false,
appid: 'someid',
docker: 'mesosphere/jenkins-dev')

Unfortunalety it fails with below error

java.lang.NoSuchMethodError: No such DSL method '$' found among steps [acceptGitLabMR, addGitLabMRComment, archive, artifactoryDownload, artifactoryPromoteBuild, artifactoryUpload, bat, build, catchError, checkout, collectEnv, deleteDir, dir, dockerFingerprintFrom, dockerFingerprintRun, echo, envVarsForTool, error, fileExists, getArtifactoryServer, git, gitlabBuilds, gitlabCommitStatus, input, isUnix, load, mail, marathon, milestone, newArtifactoryServer, newBuildInfo, node, parallel, properties, publishBuildInfo, pwd, readFile, readTrusted, retry, script, sh, sleep, sshagent, stage, stash, step, svn, timeout, timestamps, tool, unarchive, unstash, updateGitlabCommitStatus, waitUntil, withCredentials, withDockerContainer, withDockerRegistry, withDockerServer, withEnv, wrap, writeFile, ws] or symbols [all, always, apiToken, architecture, archiveArtifacts, artifactManager, batchFile, booleanParam, buildButton, buildDiscarder, caseInsensitive, caseSensitive, choice, choiceParam, clock, cloud, command, cron, crumb, defaultView, demand, disableConcurrentBuilds, downloadSettings, downstream, dumb, envVars, file, fileParam, filePath, fingerprint, frameOptions, freeStyle, freeStyleJob, git, hyperlink, hyperlinkToModels, installSource, jdk, jdkInstaller, jgit, jnlp, jobDsl, jobName, junit, lastDuration, lastFailure, lastGrantedAuthorities, lastStable, lastSuccess, legacy, list, local, location, logRotator, loggedInUsersCanDoAnything, masterBuild, maven, maven3Mojos, mavenErrors, mavenMojos, mavenWarnings, myView, nodeProperties, nonStoredPasswordParam, none, paneStatus, parameters, password, pattern, pipelineTriggers, plainText, plugin, projectNamingStrategy, proxy, queueItemAuthenticator, quietPeriod, run, runParam, schedule, scm, scmRetryCount, search, security, shell, slave, stackTrace, standard, status, string, stringParam, swapSpace, text, textParam, tmpSpace, toolLocation, unsecured, upstream, viewsTabBar, weather, zfs, zip]
at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:145)
at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:117)
forceUpdate: false,
appid: 'someid',
docker: 'mesosphere/jenkins-dev')

I can see I have the marathon 1.3.2 plugin installed. However, something appears to be wrong.

Antoine

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

colin@mesosphere.com (JIRA)

unread,
Nov 10, 2016, 1:30:01 PM11/10/16
to jenkinsc...@googlegroups.com
Colin commented on Bug JENKINS-39653
 
Re: MARATHON PLUGIN ISSUE

The stack trace mentions a dollar sign ($), but I do not see it in your marathon config block. Can you paste more of your pipeline code to help debug?

antoine.voiry@gmail.com (JIRA)

unread,
Nov 10, 2016, 1:44:01 PM11/10/16
to jenkinsc...@googlegroups.com
antoine voiry commented on Bug JENKINS-39653
 
Re: MARATHON PLUGIN ISSUE

Yes that's exactly my issue, if I remove the marathon plugin, I get no issue, as soon as I have it, it fail.
example 1 will work
stage 'Docker deploy to MESOS'
echo 'Docker deploy to MESOS'
echo "Build number $env.BUILD_NUMBER"
echo "Changed By $modifiedBy"
echo "Container Name $dockerContainerName"
example 2 will not work
stage 'Docker deploy to MESOS'
echo 'Docker deploy to MESOS'
echo "Build number $env.BUILD_NUMBER"
echo "Changed By $modifiedBy"
echo "Container Name $dockerContainerName"
marathon appid: 'test', docker: 'test', forceUpdate: true, url: 'http://marathon-instance'

Example 3 will also not work
stage 'Docker deploy to MESOS'
marathon appid: 'test', docker: 'test', forceUpdate: true, url: 'http://marathon-instance'
Here is the full JenkinsFile

#!groovy

def gitCommit() {
sh "git rev-parse HEAD > GIT_COMMIT-$

{env.BUILD_NUMBER}"
def gitCommit = readFile("GIT_COMMIT-${env.BUILD_NUMBER}

").trim()
sh "rm f GIT_COMMIT$

{env.BUILD_NUMBER}"
return gitCommit
}

def gitEmail() {
sh "git -no-pager show -s --format='%ae' ${gitCommit()} > GIT_EMAIL${env.BUILD_NUMBER}

"
def gitEmail = readFile("GIT_EMAIL-$

{env.BUILD_NUMBER}").trim()
sh "rm f GIT_EMAIL${env.BUILD_NUMBER}

"
return gitEmail
}

node {

try {
stage 'Clean workspace'
deleteDir()
stage 'Checkout'
checkout scm
docker.withRegistry('https://hub.docker.xxxx/', 'docker_dc_creds') {
stage 'Build'
def dockerContainerName = "test:$

{env.BUILD_NUMBER}

"
def modifiedBy =gitEmail()

def app = docker.build "$

{dockerContainerName}

"
if(! env.BRANCH_NAME.startsWith('PR-'))

{ echo "This is branch $env.BRANCH_NAME" stage 'Docker publish' echo 'docker publish' app.push(); stage 'Docker deploy to MESOS' echo 'Docker deploy to MESOS' marathon appid: 'test', docker: 'test', forceUpdate: true, url: 'http://16.202.9.81:8080' }

// end if(! env.BRANCH_NAME.startsWith('PR-')) {
}// end docker.withRegistry

} catch (err) {
echo 'error, see below error message, Job will be marked as failed'
echo $

{err.message}

throw err
}

}

antoine.voiry@gmail.com (JIRA)

unread,
Nov 10, 2016, 1:44:02 PM11/10/16
to jenkinsc...@googlegroups.com
Yes that's exactly my issue, if I remove the marathon plugin, I get no issue, as soon as I have it, it fail.
example 1 will work
        stage 'Docker deploy to MESOS'
          echo 'Docker deploy to MESOS'
          echo "Build number $env.BUILD_NUMBER"
          echo "Changed By $modifiedBy"
          echo "Container Name $dockerContainerName"
example 2 will not work
        stage 'Docker deploy to MESOS'
          echo 'Docker deploy to MESOS'
          echo "Build number $env.BUILD_NUMBER"
          echo "Changed By $modifiedBy"
          echo "Container Name $dockerContainerName"
          marathon appid: 'test', docker: 'test', forceUpdate: true, url: 'http://marathon-instance'

Example 3 will also not work
        stage 'Docker deploy to MESOS'
          marathon appid: 'test', docker: 'test', forceUpdate: true, url: 'http://marathon-instance'
Here is the full JenkinsFile

#!groovy

def gitCommit() {
    sh "git rev-parse HEAD > GIT_COMMIT-${env.BUILD_NUMBER}"
    def gitCommit = readFile("GIT_COMMIT-${env.BUILD_NUMBER}").trim()
    sh "rm -f GIT_COMMIT-${env.BUILD_NUMBER}"
    return gitCommit
}

def gitEmail() {
    sh "git --no-pager show -s --format='%ae' ${gitCommit()} > GIT_EMAIL-${env.BUILD_NUMBER}"

    def gitEmail = readFile("GIT_EMAIL-${env.BUILD_NUMBER}").trim()
    sh "rm -f GIT_EMAIL-${env.BUILD_NUMBER}"

    return gitEmail
}


node {


  try {
    stage 'Clean workspace'
       deleteDir()
    stage 'Checkout'
       checkout scm
    docker.withRegistry('https://hub.docker.xxxx/', 'docker_dc_creds')  {
      stage 'Build'
        def dockerContainerName = "test:${env.BUILD_NUMBER}"
        def modifiedBy =gitEmail()

        def app = docker.build "${dockerContainerName}"
      if(! env.BRANCH_NAME.startsWith('PR-'))  {
        echo "This is branch $env.BRANCH_NAME"
        stage 'Docker publish'
            echo 'docker publish'
            app.push();

        stage 'Docker deploy to MESOS'
          echo 'Docker deploy to MESOS'
          marathon appid: 'test', docker: 'test', forceUpdate: true, url: 'http:// 16.202.9.81 xxx :8080'


      }// end if(! env.BRANCH_NAME.startsWith('PR-'))  {
    }// end docker.withRegistry



  } catch (err) {
      echo 'error, see below error message, Job will be marked as failed'
      echo ${err.message}
      throw err
  }

}

antoine.voiry@gmail.com (JIRA)

unread,
Nov 10, 2016, 2:09:02 PM11/10/16
to jenkinsc...@googlegroups.com
antoine voiry commented on Bug JENKINS-39653
 
Re: MARATHON PLUGIN ISSUE

It is like if marathon was a variable or command that wasn't existing.

ss@ss21k.co.uk (JIRA)

unread,
Dec 13, 2016, 8:02:02 PM12/13/16
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages