Hi,
here it is. I just extracted the two stages (push package and Release & Deploy)
//Stage to push build information using Octo.exe.
echo “Pushing build informaiton, please wait…”
def checkoutVars = checkout([$class: ‘GitSCM’, userRemoteConfigs: [[credentialsId: env.APP_GIT_CREDENTIAL_ID, url: env.APP_GIT_REPOSITORY]]])
env.GIT_URL = checkoutVars.GIT_URL
env.GIT_COMMIT = checkoutVars.GIT_COMMIT
echo “Git url is : ${GIT_URL}”
echo “build url is : ${BUILD_URL}”
def data = [
“BuildEnvironment”:“Jenkins”,
“Branch”:"${BRANCH_NAME}",
“BuildNumber”:"${BUILD_NUMBER}",
“BuildUrl”:"${BUILD_URL}",
“VcsType”:“Git”,
“VcsRoot”:"${GIT_URL}",
“VcsCommitNumber”:"${GIT_COMMIT}",
“Commits”:[
[
“Id”:"${GIT_COMMIT}",
“Comment”:"${COMMIT_COMMENT}"
]
]
]
def json = JsonOutput.toJson(data)
json = JsonOutput.prettyPrint(json)
writeFile(file:‘buildInfo.json’, text: json)
bat “${OCTOPACK} build-information --package-id=TMS --version=${vNumber}-${versionSuffix} --file=${WORKSPACE}\buildInfo.json --server=${OCKTOPUS_SERVER} --apiKey=${OCTOPUS_API_KEY} --space=Victor-US”
//Stage to create release and deploy. The thing I want to clear is these: releaseNotesFile: ‘’, releaseNotesSource: ‘scm’
octopusCreateRelease additionalArgs: ‘’, channel: ‘bug-fix’, cancelOnTimeout: false,deploymentTimeout: ‘00:15:00’,environment: ‘DEV-1’,deployThisRelease: true, project: ‘TMS’, releaseNotes: true, releaseNotesFile: ‘’, releaseNotesSource: ‘scm’, releaseVersion: “${vNumber}-${versionSuffix}”, serverId: ‘OctopusDeploy’, spaceId: ‘Spaces-2’, tenant: ‘’, jenkinsUrlLinkback: true,tenantTag: ‘’, toolId: ‘Octocli’, variables: ‘’