GithubHelp home page GithubHelp logo

Comments (6)

leoherran-aws avatar leoherran-aws commented on June 14, 2024

Thanks for letting us know about this. I'll attempt to reproduce it and then diagnose the root cause.

from aws-codebuild-jenkins-plugin.

leoherran-aws avatar leoherran-aws commented on June 14, 2024

The issue here is that the plugin does not recognize the step([$class : 'CodeBuilder' syntax as a pipeline step. One workaround is to replace that with awsCodeBuild (see the pipeline snippet generator). Another option is to check the build status after the build and throw an exception if the status is failed:

script {    
  if(currentBuild.result == "FAILURE") {
    throw new Exception()
  }
}

from aws-codebuild-jenkins-plugin.

vedarthk avatar vedarthk commented on June 14, 2024

I am facing same issue with following configuration:

stage('package') {
    steps {
        withCredentials([[$class: 'AmazonWebServicesCredentialsBinding', credentialsId: 'aws']]) {
            awsCodeBuild credentialsId: 'CodeBuild', credentialsType: 'jenkins', projectName: 'Package', region: 'us-east-1', sourceControlType: 'project', sourceVersion: "${params.COMMIT_HASH}", envVariables: "[{BUILD_SCRIPT, docker/package/pack.sh}, {JENKINS_BUILD_NUMBER, ${env.BUILD_NUMBER}}, {AWS_SECRET_ACCESS_KEY, ${env.AWS_SECRET_ACCESS_KEY}}, {AWS_ACCESS_KEY_ID, ${env.AWS_ACCESS_KEY_ID}}, {ARTIFACTS_BUCKET, ${env.ARTIFACTS_BUCKET}}, {BRANCH, ${env.BRANCH}}]"
        }
    }
}

Codebuild Plugin Version - 0.17

The build continued even though the codebuild run failed in DOWNLOAD_SOURCE stage.

from aws-codebuild-jenkins-plugin.

leoherran-aws avatar leoherran-aws commented on June 14, 2024

Can you confirm that you're still having problems getting your use case working?

from aws-codebuild-jenkins-plugin.

shawnpetros avatar shawnpetros commented on June 14, 2024

this has NOTHING to do with this particular issue which remains open, but...anyone know how to access the ENV vars in the CodeBuild buildspec.yml when they are supplied by this plugin? @vedarthk has envVariables listed in his Jenkins Pipeline file, I want to know how to access these vars in the CodeBuild environment...sorry if it derails the convo...

from aws-codebuild-jenkins-plugin.

lkolchin avatar lkolchin commented on June 14, 2024

Hi,

If using try { cbResult = awsCodeBuild ....} catch {} (as advised here https://issues.jenkins-ci.org/browse/JENKINS-61259?focusedCommentId=386419&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel)

Even if one of the CodeBuild phases fails in the previous stages the other stages continue

So to work around it I have to add:

                        if(currentBuild.result == "FAILURE") {
                            throw new Exception()
                        }

Is that something that can be fixed?

from aws-codebuild-jenkins-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.