Created
January 15, 2020 00:35
-
-
Save robpearson/0c7dd3aa72b955890a3a1ac103406c7b to your computer and use it in GitHub Desktop.
Sample Octopus Jenkins pipeline
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
pipeline { | |
agent any | |
stages { | |
stage('Build') { | |
steps { | |
sh 'dotnet publish RandomQuotes.sln --output published-app --configuration Release' | |
} | |
} | |
stage('Run Tests') { | |
steps { | |
sh 'dotnet test RandomQuotes.sln --logger "trx;LogFileName=TestResults.trx"' | |
} | |
} | |
stage('Package') { | |
steps { | |
sh "/opt/Octo/Octo pack --id RandomQuotes --version 1.6.${env.BUILD_NUMBER} --format=Zip --basePath RandomQuotes/published-app" | |
} | |
} | |
stage ('Push to Octopus') { | |
steps { | |
sh "/opt/Octo/Octo push --package=RandomQuotes.1.6.${env.BUILD_NUMBER}.zip --replace-existing --server=https://myinstance.octopus.app/ --space=RobP --apiKey=API-MYKEY" | |
} | |
} | |
stage ('Create release') { | |
steps { | |
sh "/opt/Octo/Octo create-release --project='Random Quotes' --releaseNumber 1.6.${env.BUILD_NUMBER} --server=https://myinstance.octopus.app/ --space=RobP --apiKey=API-MYKEY" | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment