Skip to content

Commit

Permalink
Setup nuke
Browse files Browse the repository at this point in the history
  • Loading branch information
mattbrailsford committed Sep 30, 2021
1 parent 62818b6 commit 6ea5205
Show file tree
Hide file tree
Showing 16 changed files with 531 additions and 81 deletions.
111 changes: 111 additions & 0 deletions .nuke/build.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Build Schema",
"$ref": "#/definitions/build",
"definitions": {
"build": {
"type": "object",
"properties": {
"Configuration": {
"type": "string",
"description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)",
"enum": [
"Debug",
"Release"
]
},
"Continue": {
"type": "boolean",
"description": "Indicates to continue a previously failed build attempt"
},
"Help": {
"type": "boolean",
"description": "Shows the help text for this build assembly"
},
"Host": {
"type": "string",
"description": "Host for execution. Default is 'automatic'",
"enum": [
"AppVeyor",
"AzurePipelines",
"Bamboo",
"Bitrise",
"GitHubActions",
"GitLab",
"Jenkins",
"Rider",
"SpaceAutomation",
"TeamCity",
"Terminal",
"TravisCI",
"VisualStudio",
"VSCode"
]
},
"NoLogo": {
"type": "boolean",
"description": "Disables displaying the NUKE logo"
},
"Partition": {
"type": "string",
"description": "Partition to use on CI"
},
"Plan": {
"type": "boolean",
"description": "Shows the execution plan (HTML)"
},
"Profile": {
"type": "array",
"description": "Defines the profiles to load",
"items": {
"type": "string"
}
},
"Root": {
"type": "string",
"description": "Root directory during build execution"
},
"Skip": {
"type": "array",
"description": "List of targets to be skipped. Empty list skips all dependencies",
"items": {
"type": "string",
"enum": [
"Clean",
"Compile",
"Pack",
"Restore"
]
}
},
"Solution": {
"type": "string",
"description": "Path to a solution file that is automatically loaded"
},
"Target": {
"type": "array",
"description": "List of targets to be invoked. Default is '{default_target}'",
"items": {
"type": "string",
"enum": [
"Clean",
"Compile",
"Pack",
"Restore"
]
}
},
"Verbosity": {
"type": "string",
"description": "Logging verbosity during build execution. Default is 'Normal'",
"enum": [
"Minimal",
"Normal",
"Quiet",
"Verbose"
]
}
}
}
}
}
4 changes: 4 additions & 0 deletions .nuke/parameters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "./build.schema.json",
"Solution": "Vendr.PaymentProviders.Mollie.sln"
}
49 changes: 49 additions & 0 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
branches:
master:
regex: ^(v[0-9]+\/)?ma(ster|in)$
release-alpha:
regex: ^releases?[/-](.*)-alpha$
mode: ContinuousDeployment
tag: alpha
increment: Patch
prevent-increment-of-merged-branch-version: true
track-merge-target: false
tracks-release-branches: false
is-release-branch: true
pre-release-weight: 1000
source-branches: ['main', 'develop', 'feature', 'hotfix']
release-beta:
regex: ^(v[0-9]+\/)?releases?[/-].*-beta$
mode: ContinuousDeployment
tag: beta
increment: Patch
prevent-increment-of-merged-branch-version: true
track-merge-target: false
tracks-release-branches: false
is-release-branch: true
pre-release-weight: 2000
source-branches: ['main', 'develop', 'feature', 'hotfix', 'release-alpha']
release:
regex: ^(v[0-9]+\/)?releases?[/-].*(?<!-(alpha|beta))$
mode: ContinuousDeployment
tag: rc
commit-message-incrementing: Disabled
pre-release-weight: 3000
source-branches: ['main', 'develop', 'feature', 'hotfix', 'release-alpha', 'release-beta']
feature:
regex: ^(v[0-9]+\/)?features?[/-]
mode: ContinuousDeployment
tag: alpha-{BranchName}
pull-request:
regex: ^(v[0-9]+\/)?(pull|pull\-requests|pr|patch)[/-]
mode: ContinuousDeployment
hotfix:
regex: ^(v[0-9]+\/)?hotfix(es)?[/-]
mode: ContinuousDeployment
support:
regex: ^(v[0-9]+\/)?support[/-]
mode: ContinuousDeployment
tag: 'support'
increment: 'None'
develop:
regex: ^(v[0-9]+\/)?dev(elop)?(ment)?$
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Vendr Mollie Payment Provider

Mollie Payment Provider for Vendr, the eCommerce package for Umbrao v8+
Mollie Payment Provider for Vendr, the eCommerce package for Umbraco
6 changes: 5 additions & 1 deletion Vendr.PaymentProviders.Mollie.sln
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29503.13
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vendr.PaymentProvider.Mollie", "src\Vendr.PaymentProvider.Mollie\Vendr.PaymentProvider.Mollie.csproj", "{1AC2CE83-B474-4776-BE0C-227FED386D5F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "_build", "build\_build.csproj", "{F9094F2A-B15B-425A-8600-819134240391}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F9094F2A-B15B-425A-8600-819134240391}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F9094F2A-B15B-425A-8600-819134240391}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1AC2CE83-B474-4776-BE0C-227FED386D5F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1AC2CE83-B474-4776-BE0C-227FED386D5F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1AC2CE83-B474-4776-BE0C-227FED386D5F}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down
131 changes: 52 additions & 79 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
trigger:
branches:
include:
- dev
- hotfix/*
- release/*
- v2/feature/*
- v2/hotfix/*
- v2/release/*
tags:
include:
- v*
Expand All @@ -20,88 +20,61 @@ variables:
- name: 'nuGetOrgServiceCreds'
value: 'NuGet.org (Vendr)'
- name: 'packageName'
value: 'Vendr.PaymentProviders.Mollie'
value: 'Vendr.PaymentProviders.PayPal'

stages:
- stage: Build
displayName: Build stage

jobs:
- job: Build
- stage: build
displayName: Build
dependsOn: [ ]
pool:
vmImage: $(vmImageName)

steps:
- task: MSBuild@1
displayName: 'Build solution'
inputs:
solution: 'build/build.proj'
configuration: 'Release'
msbuildArguments: '-target:PrepareAndPackageAll -property:ArtifactsDir=$(Build.ArtifactStagingDirectory)'

- publish: $(Build.ArtifactStagingDirectory)
displayName: 'Publish Artifacts'
artifact: BuildArtifacts

- stage: Deploy
displayName: Deploy stage
dependsOn: Build
condition: succeeded()

jobs:
- deployment: Deploy
displayName: Deploy
environment: 'development'
pool:
vmImage: $(vmImageName)

strategy:
runOnce:
deploy:

steps:

- powershell: |
# get the umbraco package file (assumes there is just one zip file package)
$f = (Get-ChildItem -Path "$(Pipeline.Workspace)\BuildArtifacts\packages\*" -File -Include $(packageName).*.zip | Select-Object -First 1).FullName
# assign the filename to a variable
echo "$f"
echo "##vso[task.setvariable variable=umbracoPackageFile]$f"
displayName: 'Get Umbraco Package path'
# Unstable Deploy
- task: NuGetCommand@2
displayName: 'Deploy to unstable feed'
inputs:
command: 'push'
packagesToPush: '$(Pipeline.Workspace)/BuildArtifacts/**/*.nupkg;!$(Pipeline.Workspace)/BuildArtifacts/**/*.snupkg'
nuGetFeedType: 'internal'
publishVstsFeed: '576196d3-9f20-4a86-8fd6-b0d7428fe5ee/cfadaa44-aa4e-45d7-8303-91a38d020c50'

# Realease Deploy
- task: UseDotNet@2
condition: and(succeeded(), startsWith(variables['build.sourceBranch'], 'refs/tags/v'))
jobs:

- job: build
displayName: 'Build'
dependsOn: [ ]
steps:
- task: CmdLine@2
inputs:
version: 3.0.100

- task: NuGetCommand@2
displayName: 'Deploy to NuGet.org'
condition: and(succeeded(), startsWith(variables['build.sourceBranch'], 'refs/tags/v'))
script: './build.cmd Pack'
- task: PublishBuildArtifacts@1
inputs:
command: push
nuGetFeedType: external
packagesToPush: '$(Pipeline.Workspace)/BuildArtifacts/**/*.nupkg;!$(Pipeline.Workspace)/BuildArtifacts/**/*.snupkg'
publishFeedCredentials: '$(nuGetOrgServiceCreds)'
pathToPublish: './artifacts'
artifactName: artifacts

- script: |
dotnet tool install --global Umbraco.Tools.Packages
condition: and(succeeded(), startsWith(variables['build.sourceBranch'], 'refs/tags/v'))
displayName: 'Install UmbPack'
- script: |
umbpack push $(umbracoPackageFile) -k %OUR_UMBRACO_API_KEY% -w v860,v850,v840,v830,v820 -c false -a $(packageName).*.zip
condition: and(succeeded(), startsWith(variables['build.sourceBranch'], 'refs/tags/v'))
displayName: 'Deploy to Our Umbraco'
env:
OUR_UMBRACO_API_KEY: $(our-umbraco-api-key)
- stage: deploy
displayName: Deploy
condition: succeeded()
dependsOn: [ build ]

jobs:
- deployment: deploy
displayName: Deploy
environment: 'development'
pool:
vmImage: $(vmImageName)

strategy:
runOnce:
deploy:
steps:

# Unstable Deploy
- task: NuGetCommand@2
displayName: 'Deploy to unstable feed'
inputs:
command: 'push'
packagesToPush: '$(Pipeline.Workspace)/artifacts/**/*.nupkg;!$(Pipeline.Workspace)/artifacts/**/*.snupkg'
nuGetFeedType: 'internal'
publishVstsFeed: '576196d3-9f20-4a86-8fd6-b0d7428fe5ee/cfadaa44-aa4e-45d7-8303-91a38d020c50'

# Realease Deploy
- task: NuGetCommand@2
displayName: 'Deploy to NuGet.org'
condition: and(succeeded(), startsWith(variables['build.sourceBranch'], 'refs/tags/v'))
inputs:
command: push
nuGetFeedType: external
packagesToPush: '$(Pipeline.Workspace)/artifacts/**/*.nupkg;!$(Pipeline.Workspace)/artifacts/**/*.snupkg'
publishFeedCredentials: '$(nuGetOrgServiceCreds)'
7 changes: 7 additions & 0 deletions build.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
:; set -eo pipefail
:; SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
:; ${SCRIPT_DIR}/build.sh "$@"
:; exit $?

@ECHO OFF
powershell -ExecutionPolicy ByPass -NoProfile -File "%~dp0build.ps1" %*
Loading

0 comments on commit 6ea5205

Please sign in to comment.