Last active
April 22, 2021 16:34
-
-
Save 2018kguo/47f88e73a802790ae992b4044a09c330 to your computer and use it in GitHub Desktop.
Jenkinsfile snippet #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
environment { | |
OCTOPUS_ID = "" | |
DOCKER_REGISTRY = "" | |
VERSION = "$BUILD_TIMESTAMP" | |
DEPLOY = "" | |
RELEASE_NOTES = sh (script: """git log --format="medium" -1 ${GIT_COMMIT}""", returnStdout:true) | |
} | |
stages { | |
... | |
stage ("Create/Deploy Release") { | |
steps { | |
withCredentials([string(credentialsId: "OctopusApiKey", variable: "OCTOPUS_CLI_API_KEY")]) { | |
sh """ | |
dotnet octo create-release --project "$OCTOPUS_ID" \ | |
$DEPLOY --packageVersion $VERSION \ | |
--releaseNotes "$RELEASE_NOTES" | |
""" | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment