jenkinsci / aws-codecommit-trigger-plugin

Jenkins plugin for triggering jobs with AWS CodeCommit repo updates
https://www.ribose.com
Apache License 2.0
6 stars 12 forks source link

Add more specifications on now to code it in Jenkinsfile #86

Open XargonWan opened 5 months ago

XargonWan commented 5 months ago

Describe your use-case which is not covered by existing documentation.

Greetings,

I wish to configure the SQS behaviour from Jenkinsfile instead of WebUI, after some resarch I found this to be working. Can you please expand the docs? Moreover is there any clean way to refer to the uuid (i had to search it in the jenkins files pipeline xmls).

Thanks in advance

def GIT_URL="https://some.repo.git"
def BRANCH="develop"
def SQS_QUEUE_UUID="123456-789012-1234"

properties([
    pipelineTriggers([
        [
            $class: 'com.ribose.jenkins.plugin.awscodecommittrigger.SQSTrigger',
            queueUuid: "${SQS_QUEUE_UUID}",
            sqsScmConfigs: [
                [
                    subscribedBranches: "${BRANCH}",
                    type: "ManualSubscription",
                    url: "${GIT_URL}"
                ]
            ],
            subscribeInternalScm: false
        ]
    ])
])

pipeline {

    agent {
        label 'my-agent'
    }

    stages {
        stage('Git Checkout') {
            steps {
                git branch: "${BRANCH}", credentialsId: 'my-credentials', url: "${GIT_URL}"
            }
        }
    }
}

Reference any relevant documentation, other materials or issues/pull requests that can be used for inspiration.

https://www.jenkins.io/doc/pipeline/steps/params/pipelinetriggers/

Are you interested in contributing to the documentation?

No response