pipeline {
agent any
environment {
ANYPOINT_ORG_ID = '1234abc-b34a-7cd3-4s32-12345abc2345'
CATALOG_DESCRIPTOR = './descriptor.yaml' (1)
}
stages {
stage('git checkout') {
steps {
git url: 'git@github.com:mygitlocation/api-catalog-cli.git'
// additional checkout tasks
}
}
stage('Build Artifacts') {
steps {
// building
}
}
stage('API Cataloging') {
steps {
withCredentials([
usernamePassword(credentialsId: 'my-anypoint-creds',
usernameVariable: 'ANYPOINT_USERNAME',
passwordVariable: 'ANYPOINT_PASSWORD')
]) {
sh 'api-catalog-cli publish-asset -d $CATALOG_DESCRIPTOR --organization=$ANYPOINT_ORG_ID --host=anypoint.mulesoft.com/ --trigger-criteria=branch:main' (2)
}
}
}
stage('Deploy') {
steps {
// Any deployment tasks to be performed, here.
}
}
}