Skip to content

Support Jenkins DSL #2

@boumenot

Description

@boumenot

It would be great if this plugin natively supported the Jenkins DSL. I managed to patch something together using the escape hatch, but it is ugly.

job('ci') {
    configure { project ->
        def keyVaultNode = project / 'org.jenkinsci.plugins.azurekeyvaultplugin.AzureKeyVaultBuildWrapper'(plugin: 'azure-keyvault@0.9.3') 
        
        def azureKeyVaultSecrets = keyVaultNode.appendNode('org.jenkinsci.plugins.azurekeyvaultplugin.AzureKeyVaultSecret')
        azureKeyVaultSecrets << {
            secretType('Certificate')
            name('27ccd4e0-f279-40d0-91d8-f043397cf9bb)
            version()
            envVariable('MY_KV_CERTIFICATE')
        }
        
        keyVaultNode << keyVaultURL('https://my.vault.azure.net')
        keyVaultNode << applicationID('14c89445-e4b0-4f7a-aa8c-4171de84718f')
        keyVaultNode << applicationSecret('password')
    }
}

The repo Extending-the-DSL has details on the changes needed to support the DSL.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions