Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ stages:

# Deploy to Umbraco Cloud
# ####
# you can edit the variables noBuildAndRestore and skipVersionCheck
# you can edit the variables noBuildAndRestore, skipVersionCheck, skipPreserveUmbracoCloudJson,
# allowAnyTarget and runSchemaExtraction
# use booleans but as strings
- stage: CloudDeploymentStage
displayName: Deploy To Cloud
Expand All @@ -86,4 +87,7 @@ stages:
artifactId: $(artifactId)
noBuildAndRestore: 'true'
skipVersionCheck: 'true'
skipPreserveUmbracoCloudJson: 'false'
allowAnyTarget: 'false'
runSchemaExtraction: 'true'
targetEnvironmentAlias: $(targetEnvironment)
10 changes: 7 additions & 3 deletions V2/bash/azuredevops/azure-release-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,21 @@ stages:

# Deploy to Umbraco Cloud
# ####
# you can edit the variables noBuildAndRestore and skipVersionCheck
# you can edit the variables noBuildAndRestore, skipVersionCheck, skipPreserveUmbracoCloudJson,
# allowAnyTarget and runSchemaExtraction
# use booleans but as strings
- stage: CloudDeploymentStage
displayName: Deploy To Cloud
dependsOn: cloudPrepareArtifact
condition: in(dependencies.cloudPrepareArtifact.result, 'Succeeded')
variables:
artifactId: $[ stageDependencies.cloudPrepareArtifact.PrepareAndUploadArtifact.outputs['uploadArtifact.artifactId'] ]
jobs:
jobs:
- template: cloud-deployment.yml
parameters:
artifactId: $(artifactId)
noBuildAndRestore: 'false'
skipVersionCheck: 'false'
skipVersionCheck: 'false'
skipPreserveUmbracoCloudJson: 'false'
allowAnyTarget: 'false'
runSchemaExtraction: 'true'
17 changes: 16 additions & 1 deletion V2/bash/azuredevops/cloud-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ parameters:
- name: skipVersionCheck
type: string
default: 'false'
- name: skipPreserveUmbracoCloudJson
type: string
default: 'false'
- name: allowAnyTarget
type: string
default: 'false'
- name: runSchemaExtraction
type: string
default: 'true'
- name: targetEnvironmentAlias
type: string
default: $(targetEnvironmentAlias)
Expand All @@ -23,17 +32,23 @@ jobs:
artifactId: ${{ parameters.artifactId }}
noBuildAndRestore: ${{ parameters.noBuildAndRestore }}
skipVersionCheck: ${{ parameters.skipVersionCheck }}
skipPreserveUmbracoCloudJson: ${{ parameters.skipPreserveUmbracoCloudJson }}
allowAnyTarget: ${{ parameters.allowAnyTarget }}
runSchemaExtraction: ${{ parameters.runSchemaExtraction }}
inputs:
targetType: 'filePath'
filePath: devops/scripts/start_deployment.sh
arguments: >
arguments: >
$(projectId)
$(umbracoCloudApiKey)
$artifactId
${{ parameters.targetEnvironmentAlias }}
"Run for $(Build.BuildNumber)"
$noBuildAndRestore
$skipVersionCheck
$skipPreserveUmbracoCloudJson
$allowAnyTarget
$runSchemaExtraction
$(pipelineVendor)

- job: CheckDeploymentProgress
Expand Down
6 changes: 5 additions & 1 deletion V2/bash/github/advanced/main-more-targets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ jobs:

# Deploy to Umbraco Cloud
# ####
# you can edit the variables noBuildAndRestore and skipVersionCheck
# you can edit the variables noBuildAndRestore, skipVersionCheck, skipPreserveUmbracoCloudJson,
# allowAnyTarget and runSchemaExtraction
# use booleans but as strings
cloud-deployment:
name: "Deploy to Cloud"
Expand All @@ -68,6 +69,9 @@ jobs:
targetEnvironmentAlias: ${{ needs.set-env.outputs.targetEnvironmentAlias }}
noBuildAndRestore: "false"
skipVersionCheck: "false"
skipPreserveUmbracoCloudJson: "false"
allowAnyTarget: "false"
runSchemaExtraction: "true"
secrets:
projectId: ${{ secrets.PROJECT_ID }}
umbracoCloudApiKey: ${{ secrets.UMBRACO_CLOUD_API_KEY }}
24 changes: 21 additions & 3 deletions V2/bash/github/cloud-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,21 @@ on:
required: false
type: string
default: "false"
skipPreserveUmbracoCloudJson:
description: 'Skip preserving umbraco-cloud.json file'
required: false
type: string
default: "false"
allowAnyTarget:
description: 'Allows deployments to targets other than left-most or flexible'
required: false
type: string
default: "false"
runSchemaExtraction:
description: 'Run schema extraction during deployment'
required: false
type: string
default: "true"

secrets:
projectId:
Expand All @@ -54,13 +69,16 @@ jobs:
shell: bash
run: >
bash ${{ GITHUB.WORKSPACE }}/.github/scripts/start_deployment.sh
${{ secrets.projectId }}
${{ secrets.umbracoCloudApiKey }}
${{ secrets.projectId }}
${{ secrets.umbracoCloudApiKey }}
${{ inputs.artifactId }}
${{ inputs.targetEnvironmentAlias }}
"Run for ${{ github.run_number }}"
${{ inputs.noBuildAndRestore}}
${{ inputs.noBuildAndRestore }}
${{ inputs.skipVersionCheck }}
${{ inputs.skipPreserveUmbracoCloudJson }}
${{ inputs.allowAnyTarget }}
${{ inputs.runSchemaExtraction }}
GITHUB

awaitDeploymentFinished:
Expand Down
6 changes: 5 additions & 1 deletion V2/bash/github/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ jobs:

# Deploy to Umbraco Cloud
# ####
# you can edit the variables noBuildAndRestore and skipVersionCheck
# you can edit the variables noBuildAndRestore, skipVersionCheck, skipPreserveUmbracoCloudJson,
# allowAnyTarget and runSchemaExtraction
# use booleans but as strings
cloud-deployment:
name: "Deploy to Cloud"
Expand All @@ -42,6 +43,9 @@ jobs:
targetEnvironmentAlias: ${{ vars.TARGET_ENVIRONMENT_ALIAS }}
noBuildAndRestore: "false"
skipVersionCheck: "false"
skipPreserveUmbracoCloudJson: "false"
allowAnyTarget: "false"
runSchemaExtraction: "true"
secrets:
projectId: ${{ secrets.PROJECT_ID }}
umbracoCloudApiKey: ${{ secrets.UMBRACO_CLOUD_API_KEY }}
13 changes: 10 additions & 3 deletions V2/bash/start_deployment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ targetEnvironmentAlias="$4"
commitMessage="$5"
noBuildAndRestore="${6:-false}"
skipVersionCheck="${7:-false}"
pipelineVendor="$8"
skipPreserveUmbracoCloudJson="${8:-false}"
allowAnyTarget="${9:-false}"
runSchemaExtraction="${10:-true}"
pipelineVendor="${11}"

# Not required, defaults to https://api.cloud.umbraco.com
baseUrl="${9:-https://api.cloud.umbraco.com}"
baseUrl="${12:-https://api.cloud.umbraco.com}"


### Endpoint docs
Expand All @@ -27,11 +30,15 @@ function call_api {
echo " - commitMessage: $commitMessage"
echo " - noBuildAndRestore: $noBuildAndRestore"
echo " - skipVersionCheck: $skipVersionCheck"
echo " - skipPreserveUmbracoCloudJson: $skipPreserveUmbracoCloudJson"
echo " - allowAnyTarget: $allowAnyTarget"
echo " - runSchemaExtraction: $runSchemaExtraction"


response=$(curl -s -w "%{http_code}" -X POST $url \
-H "Umbraco-Cloud-Api-Key: $apiKey" \
-H "Content-Type: application/json" \
-d "{\"targetEnvironmentAlias\": \"$targetEnvironmentAlias\",\"artifactId\": \"$artifactId\",\"commitMessage\": \"$commitMessage\",\"noBuildAndRestore\": $noBuildAndRestore,\"skipVersionCheck\": $skipVersionCheck}")
-d "{\"targetEnvironmentAlias\": \"$targetEnvironmentAlias\",\"artifactId\": \"$artifactId\",\"commitMessage\": \"$commitMessage\",\"noBuildAndRestore\": $noBuildAndRestore,\"skipVersionCheck\": $skipVersionCheck,\"allowAnyTarget\": $allowAnyTarget,\"runSchemaExtraction\": $runSchemaExtraction,\"skipPreserveUmbracoCloudJson\": $skipPreserveUmbracoCloudJson}")

responseCode=${response: -3}
content=${response%???}
Expand Down
37 changes: 26 additions & 11 deletions V2/powershell/Start-Deployment.ps1
Original file line number Diff line number Diff line change
@@ -1,38 +1,50 @@
param(
[Parameter(Position=0)]
[string]
[string]
$ProjectId,

[Parameter(Position=1)]
[string]
[string]
$ApiKey,

[Parameter(Position=2)]
[string]
[string]
$ArtifactId,

[Parameter(Position=3)]
[string]
[string]
$TargetEnvironmentAlias,

[Parameter(Position=4)]
[string]
[string]
$CommitMessage = "",

[Parameter(Position=5)]
[bool]
[bool]
$NoBuildAndRestore = $false,

[Parameter(Position=6)]
[bool]
[bool]
$SkipVersionCheck = $false,

[Parameter(Position=7)]
[string]
[bool]
$SkipPreserveUmbracoCloudJson = $false,

[Parameter(Position=8)]
[bool]
$AllowAnyTarget = $false,

[Parameter(Position=9)]
[bool]
$RunSchemaExtraction = $true,

[Parameter(Position=10)]
[string]
$PipelineVendor, ## GITHUB or AZUREDEVOPS

[Parameter(Position=8)]
[string]
[Parameter(Position=11)]
[string]
$BaseUrl = "https://api.cloud.umbraco.com"
)

Expand All @@ -52,6 +64,9 @@ $requestBody = @{
'commitMessage' = $CommitMessage
'noBuildAndRestore' = $NoBuildAndRestore
'skipVersionCheck' = $SkipVersionCheck
'skipPreserveUmbracoCloudJson' = $SkipPreserveUmbracoCloudJson
'allowAnyTarget' = $AllowAnyTarget
'runSchemaExtraction' = $RunSchemaExtraction
} | ConvertTo-Json

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ stages:

# Deploy to Umbraco Cloud
# ####
# you can edit the variables noBuildAndRestore and skipVersionCheck
# you can edit the variables noBuildAndRestore, skipVersionCheck, skipPreserveUmbracoCloudJson,
# allowAnyTarget and runSchemaExtraction
# use booleans
- stage: CloudDeploymentStage
displayName: Deploy To Cloud
Expand All @@ -86,4 +87,7 @@ stages:
artifactId: $(artifactId)
noBuildAndRestore: false
skipVersionCheck: false
skipPreserveUmbracoCloudJson: false
allowAnyTarget: false
runSchemaExtraction: true
targetEnvironmentAlias: $(targetEnvironment)
10 changes: 7 additions & 3 deletions V2/powershell/azuredevops/azure-release-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,21 @@ stages:

# Deploy to Umbraco Cloud
# ####
# you can edit the variables noBuildAndRestore and skipVersionCheck
# you can edit the variables noBuildAndRestore, skipVersionCheck, skipPreserveUmbracoCloudJson,
# allowAnyTarget and runSchemaExtraction
# use booleans
- stage: CloudDeploymentStage
displayName: Deploy To Cloud
dependsOn: cloudPrepareArtifact
condition: in(dependencies.cloudPrepareArtifact.result, 'Succeeded')
variables:
artifactId: $[ stageDependencies.cloudPrepareArtifact.PrepareAndUploadArtifact.outputs['uploadArtifact.artifactId'] ]
jobs:
jobs:
- template: cloud-deployment.yml
parameters:
artifactId: $(artifactId)
noBuildAndRestore: false
skipVersionCheck: false
skipVersionCheck: false
skipPreserveUmbracoCloudJson: false
allowAnyTarget: false
runSchemaExtraction: true
14 changes: 13 additions & 1 deletion V2/powershell/azuredevops/cloud-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ parameters:
- name: skipVersionCheck
type: boolean
default: false
- name: skipPreserveUmbracoCloudJson
type: boolean
default: false
- name: allowAnyTarget
type: boolean
default: false
- name: runSchemaExtraction
type: boolean
default: true
- name: targetEnvironmentAlias
type: string
default: $(targetEnvironmentAlias)
Expand All @@ -23,14 +32,17 @@ jobs:
pwsh: true
targetType: 'filePath'
filePath: devops/powershell/Start-Deployment.ps1
arguments: >
arguments: >
-ProjectId $(projectId)
-ApiKey $(umbracoCloudApiKey)
-ArtifactId ${{ parameters.artifactId }}
-TargetEnvironmentAlias ${{ parameters.targetEnvironmentAlias }}
-CommitMessage "Run for $(Build.BuildNumber)"
-NoBuildAndRestore $${{ parameters.noBuildAndRestore }}
-SkipVersionCheck $${{ parameters.skipVersionCheck }}
-SkipPreserveUmbracoCloudJson $${{ parameters.skipPreserveUmbracoCloudJson }}
-AllowAnyTarget $${{ parameters.allowAnyTarget }}
-RunSchemaExtraction $${{ parameters.runSchemaExtraction }}
-PipelineVendor $(pipelineVendor)

- job: CheckDeploymentProgress
Expand Down
6 changes: 5 additions & 1 deletion V2/powershell/github/advanced/main-more-targets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ jobs:

# Deploy to Umbraco Cloud
# ####
# you can edit the variables noBuildAndRestore and skipVersionCheck
# you can edit the variables noBuildAndRestore, skipVersionCheck, skipPreserveUmbracoCloudJson,
# allowAnyTarget and runSchemaExtraction
# use 0 for false and 1 for true
cloud-deployment:
name: "Deploy to Cloud"
Expand All @@ -68,6 +69,9 @@ jobs:
targetEnvironmentAlias: ${{ needs.set-env.outputs.targetEnvironmentAlias }}
noBuildAndRestore: 0
skipVersionCheck: 0
skipPreserveUmbracoCloudJson: 0
allowAnyTarget: 0
runSchemaExtraction: 1
secrets:
projectId: ${{ secrets.PROJECT_ID }}
umbracoCloudApiKey: ${{ secrets.UMBRACO_CLOUD_API_KEY }}
Loading