-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pushing updated Jenkinsfile for blog post
- Loading branch information
Cory Reid
committed
Aug 23, 2021
1 parent
eb618bc
commit 88cfdcc
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
pipeline{ | ||
agent any | ||
|
||
environment { | ||
// Primary .csproj location | ||
projectLocation = "RandomQuotes\\RandomQuotes.csproj" | ||
// Default publish location | ||
publishedPath = ".\\RandomQuotes\\bin\\Debug\\net5.0\\publish\\" | ||
// Git location for checkout | ||
gitUrl = "https://github.com/OctopusSamples/RandomQuotes.git" | ||
// Branch for checkout | ||
gitBranch = "config-as-code-walkthrough" | ||
// ServerId from Configure System -> Octopus Deploy Plugin | ||
octopusServerId = "NewLocal" | ||
} | ||
|
||
stages{ | ||
|
||
stage('Prep - Clean/Checkout'){ | ||
steps{ | ||
cleanWs deleteDirs: true | ||
git credentialsId: 'GitHub-PAT', url: "${env.gitUrl}", branch: 'main' | ||
} | ||
} | ||
|
||
stage('Dotnet - Restore/Clean/Build/Publish'){ | ||
steps{ | ||
bat "dotnet restore ${env.projectLocation}" | ||
bat "dotnet clean ${env.projectLocation}" | ||
bat "dotnet publish ${env.projectLocation}" | ||
} | ||
} | ||
|
||
stage('Octopus'){ | ||
steps{ | ||
octopusPack additionalArgs: '', includePaths: '', outputPath: '', packageFormat: 'zip', packageId: "${JOB_NAME}", packageVersion: "${BUILD_NUMBER}", sourcePath: "${publishedPath}", toolId: 'Default', verboseLogging: true | ||
octopusPushPackage additionalArgs: '', overwriteMode: 'FailIfExists', packagePaths: "${JOB_NAME}.${BUILD_NUMBER}.zip", serverId: "${octopusServerId}", spaceId: 'Spaces-1', toolId: 'Default' | ||
} | ||
} | ||
} | ||
} |