VM Azure YML's
+904 · 16 files changed
-
vm-azure/ssh/artifactory-connector.yml+11 −0 -
vm-azure/ssh/azure-connector.yml+19 −0 -
vm-azure/ssh/environment.yml+9 −0 -
vm-azure/ssh/infrastructure-definition.yml+19 −0 -
vm-azure/ssh/pipeline-ssh-basic.yml+129 −0 -
vm-azure/ssh/pipeline-ssh-canary.yml+182 −0 -
vm-azure/ssh/pipeline-ssh-rolling.yml+157 −0 -
vm-azure/ssh/service.yml+19 −0 -
vm-azure/winrm/artifactory-connector.yml+11 −0 -
vm-azure/winrm/azure-connector.yml+19 −0 -
vm-azure/winrm/environment.yml+9 −0 -
vm-azure/winrm/infrastructure-definition.yml+19 −0 -
vm-azure/winrm/pipeline-basic.yml+80 −0 -
vm-azure/winrm/pipeline-canary.yml+94 −0 -
vm-azure/winrm/pipeline-rolling.yml+108 −0 -
vm-azure/winrm/service.yml+19 −0
@@ -0,0 +1,11 @@ +connector: + name: harness_artifactrepo + identifier: harness_artifactrepo + orgIdentifier: default + projectIdentifier: default_project + type: Artifactory + spec: + artifactoryServerUrl: https://harness.jfrog.io/artifactory + auth: + type: Anonymous + executeOnDelegate: false @@ -0,0 +1,19 @@ +connector: + name: harness_azureconnector + identifier: harness_azureconnector + description: "" + orgIdentifier: default + projectIdentifier: default_project + type: Azure + spec: + credential: + type: ManualConfig + spec: + applicationId: APPLICATION_ID + tenantId: TENANT_ID + auth: + type: Secret + spec: + secretRef: azuresecret + azureEnvironmentType: AZURE + executeOnDelegate: false @@ -0,0 +1,9 @@ +environment: + name: harnessdevenv + identifier: harnessdevenv + description: "" + tags: {} + type: PreProduction + orgIdentifier: default + projectIdentifier: default_project + variables: [] @@ -0,0 +1,19 @@ +infrastructureDefinition: + name: harness_remoteinstance + identifier: harness_remoteinstance + description: "" + tags: {} + orgIdentifier: default + projectIdentifier: default_project + environmentRef: harnessdevenv + deploymentType: Ssh + type: SshWinRmAzure + spec: + credentialsRef: harness_sshprivatekey + connectorRef: harness_azureconnector + subscriptionId: VM_SUBSCRIPTION_ID + resourceGroup: VM_RESOURCE_GROUP + tags: + Name: INSTANCE_NAME + hostConnectionType: PublicIP + allowSimultaneousDeployments: false @@ -0,0 +1,129 @@ +pipeline: + name: harness_ssh_pipeline + identifier: harness_ssh_pipeline + projectIdentifier: default_project + orgIdentifier: default + tags: {} + stages: + - stage: + name: deploy-ssh + identifier: deployssh + description: "" + type: Deployment + spec: + deploymentType: Ssh + service: + serviceRef: harness_ssh + serviceInputs: + serviceDefinition: + type: Ssh + spec: + artifacts: + primary: + primaryArtifactRef: <+input> + sources: <+input> + environment: + environmentRef: harnessdevenv + deployToAll: false + infrastructureDefinitions: + - identifier: harness_remoteinstance + execution: + steps: + - step: + name: Deploy + identifier: Deploy + type: Command + timeout: 10m + strategy: + repeat: + items: <+stage.output.hosts> + spec: + onDelegate: false + environmentVariables: [] + outputVariables: [] + commandUnits: + - identifier: Setup_Runtime_Paths + name: Setup Runtime Paths + type: Script + spec: + shell: Bash + source: + type: Inline + spec: + script: |- + # Execute as root and pass environment variables + # su -p - + + # Execute as root via user credentials (with root privileges) + # sudo -E su -p - + + # Creating runtime, backup and staging folders: + + mkdir -p $HOME/<+service.name>/<+env.name>/runtime + mkdir -p $HOME/<+service.name>/<+env.name>/backup + mkdir -p $HOME/<+service.name>/<+env.name>/staging + - identifier: Copy_Artifact + name: Copy Artifact + type: Copy + spec: + sourceType: Artifact + destinationPath: $HOME/<+service.name>/<+env.name> + - identifier: Copy_Config + name: Copy Config + type: Copy + spec: + sourceType: Artifact + destinationPath: $HOME/<+service.name>/<+env.name> + rollbackSteps: + - step: + name: Rollback + identifier: Rollback + type: Command + timeout: 10m + strategy: + repeat: + items: <+stage.output.hosts> + spec: + onDelegate: false + environmentVariables: [] + outputVariables: [] + commandUnits: + - identifier: Setup_Runtime_Paths_Rollback + name: Setup Runtime Paths Rollback + type: Script + spec: + shell: Bash + source: + type: Inline + spec: + script: |- + # Execute as root and pass environment variables + # su -p - + + # Execute as root via user credentials (with root privileges) + # sudo -E su -p - + + # Creating runtime, backup and staging folders: + + mkdir -p $HOME/<+service.name>/<+env.name>/runtime + mkdir -p $HOME/<+service.name>/<+env.name>/backup + mkdir -p $HOME/<+service.name>/<+env.name>/staging + - identifier: Copy_Artifact_Rollback + name: Copy Artifact Rollback + type: Copy + spec: + sourceType: Artifact + destinationPath: $HOME/<+service.name>/<+env.name> + - identifier: Copy_Config_Rollback + name: Copy Config Rollback + type: Copy + spec: + sourceType: Config + destinationPath: $HOME/<+service.name>/<+env.name> + tags: {} + failureStrategies: + - onFailure: + errors: + - AllErrors + action: + type: StageRollback @@ -0,0 +1,182 @@ +pipeline: + name: harness_ssh_pipeline + identifier: harness_ssh_pipeline + projectIdentifier: default_project + orgIdentifier: default + tags: {} + stages: + - stage: + name: deploy-ssh + identifier: deployssh + description: "" + type: Deployment + spec: + deploymentType: Ssh + service: + serviceRef: harness_ssh + serviceInputs: + serviceDefinition: + type: Ssh + spec: + artifacts: + primary: + primaryArtifactRef: <+input> + sources: <+input> + environment: + environmentRef: harnessdevenv + deployToAll: false + infrastructureDefinitions: + - identifier: harness_remoteinstance + execution: + steps: + - stepGroup: + identifier: Step_Group_1 + name: Step Group + strategy: + repeat: + items: <+stage.output.hosts> + start: 0 + end: 1 + unit: Count + steps: + - step: + name: Deploy + identifier: Deploy_1 + type: Command + timeout: 10m + spec: + onDelegate: false + environmentVariables: [] + outputVariables: [] + commandUnits: + - identifier: Setup_Runtime_Paths_1 + name: Setup Runtime Paths + type: Script + spec: + shell: Bash + source: + type: Inline + spec: + script: |- + # Execute as root and pass environment variables + # su -p - + + # Execute as root via user credentials (with root privileges) + # sudo -E su -p - + + # Creating runtime, backup and staging folders: + + mkdir -p $HOME/<+service.name>/<+env.name>/runtime + mkdir -p $HOME/<+service.name>/<+env.name>/backup + mkdir -p $HOME/<+service.name>/<+env.name>/staging + - identifier: Stop_1 + name: Stop + type: Script + spec: + workingDirectory: $HOME/<+service.name>/<+env.name> + shell: Bash + source: + type: Inline + spec: + script: echo "Stopping..." + - identifier: Copy_Artifact_1 + name: Copy Artifact + type: Copy + spec: + sourceType: Artifact + destinationPath: $HOME/<+service.name>/<+env.name> + - identifier: Copy_Config_1 + name: Copy Config + type: Copy + spec: + sourceType: Artifact + destinationPath: $HOME/<+service.name>/<+env.name> + - identifier: Start_1 + name: Start + type: Script + spec: + workingDirectory: $HOME/<+service.name>/<+env.name> + shell: Bash + source: + type: Inline + spec: + script: echo "Starting..." + rollbackSteps: + - stepGroup: + identifier: Step_Group_Rollback_1 + name: Step Group + strategy: + repeat: + items: <+stage.output.hosts> + start: 0 + end: 1 + unit: Count + steps: + - step: + name: Rollback + identifier: Rollback_1 + type: Command + timeout: 10m + spec: + onDelegate: false + environmentVariables: [] + outputVariables: [] + commandUnits: + - identifier: Stop_Rollback_1 + name: Stop Rollback + type: Script + spec: + workingDirectory: $HOME/<+service.name>/<+env.name> + shell: Bash + source: + type: Inline + spec: + script: echo "Stopping..." + - identifier: Setup_Runtime_Paths_Rollback_1 + name: Setup Runtime Paths Rollback + type: Script + spec: + shell: Bash + source: + type: Inline + spec: + script: |- + # Execute as root and pass environment variables + # su -p - + + # Execute as root via user credentials (with root privileges) + # sudo -E su -p - + + # Creating runtime, backup and staging folders: + + mkdir -p $HOME/<+service.name>/<+env.name>/runtime + mkdir -p $HOME/<+service.name>/<+env.name>/backup + mkdir -p $HOME/<+service.name>/<+env.name>/staging + - identifier: Copy_Artifact_Rollback_1 + name: Copy Artifact Rollback + type: Copy + spec: + sourceType: Artifact + destinationPath: $HOME/<+service.name>/<+env.name> + - identifier: Copy_Config_Rollback_1 + name: Copy Config Rollback + type: Copy + spec: + sourceType: Config + destinationPath: $HOME/<+service.name>/<+env.name> + - identifier: Start_Rollback_1 + name: Start Rollback + type: Script + spec: + shell: Bash + source: + type: Inline + spec: + script: echo "Starting..." + tags: {} + failureStrategies: + - onFailure: + errors: + - AllErrors + action: + type: StageRollback @@ -0,0 +1,157 @@ +pipeline: + name: harness_ssh_pipeline + identifier: harness_ssh_pipeline + projectIdentifier: default_project + orgIdentifier: default + tags: {} + stages: + - stage: + name: deploy-ssh + identifier: deployssh + description: "" + type: Deployment + spec: + deploymentType: Ssh + service: + serviceRef: harness_ssh + serviceInputs: + serviceDefinition: + type: Ssh + spec: + artifacts: + primary: + primaryArtifactRef: <+input> + sources: <+input> + environment: + environmentRef: harnessdevenv + deployToAll: false + infrastructureDefinitions: + - identifier: harness_remoteinstance + execution: + steps: + - stepGroup: + name: Phase + identifier: Phase + strategy: + repeat: + items: <+stage.output.hosts> + maxConcurrency: 1 + partitionSize: 1 + unit: Count + steps: + - stepGroup: + name: Phase Group + identifier: phase_group + strategy: + repeat: + items: <+repeat.partition> + steps: + - step: + name: Deploy + type: Command + identifier: Deploy + timeout: 10m + spec: + onDelegate: false + environmentVariables: [] + outputVariables: [] + commandUnits: + - identifier: Setup_Runtime_Paths + name: Setup Runtime Paths + type: Script + spec: + shell: Bash + source: + type: Inline + spec: + script: |- + # Execute as root and pass environment variables + # su -p - + + # Execute as root via user credentials (with root privileges) + # sudo -E su -p - + + # Creating runtime, backup and staging folders: + + mkdir -p $HOME/<+service.name>/<+env.name>/runtime + mkdir -p $HOME/<+service.name>/<+env.name>/backup + mkdir -p $HOME/<+service.name>/<+env.name>/staging + - identifier: Copy_Artifact + name: Copy Artifact + type: Copy + spec: + sourceType: Artifact + destinationPath: $HOME/<+service.name>/<+env.name> + - identifier: Copy_Config + name: Copy Config + type: Copy + spec: + sourceType: Artifact + destinationPath: $HOME/<+service.name>/<+env.name> + rollbackSteps: + - stepGroup: + name: Phase + identifier: Phase + strategy: + repeat: + items: <+stage.output.hosts> + maxConcurrency: 1 + partitionSize: 1 + unit: Count + steps: + - stepGroup: + name: Phase Group Rollback + identifier: phase_group_rollback + strategy: + repeat: + items: <+repeat.partition> + steps: + - step: + name: Rollback + identifier: Rollback + type: Command + timeout: 10m + spec: + onDelegate: false + environmentVariables: [] + outputVariables: [] + commandUnits: + - identifier: Setup_Runtime_Paths_Rollback + name: Setup Runtime Paths Rollback + type: Script + spec: + shell: Bash + source: + type: Inline + spec: + script: |- + # Execute as root and pass environment variables + # su -p - + + # Execute as root via user credentials (with root privileges) + # sudo -E su -p - + + # Creating runtime, backup and staging folders: + + mkdir -p $HOME/<+service.name>/<+env.name>/runtime + mkdir -p $HOME/<+service.name>/<+env.name>/backup + mkdir -p $HOME/<+service.name>/<+env.name>/staging + - identifier: Copy_Artifact_Rollback + name: Copy Artifact Rollback + type: Copy + spec: + sourceType: Artifact + destinationPath: $HOME/<+service.name>/<+env.name> + - identifier: Copy_Config_Rollback + name: Copy Config Rollback + type: Copy + spec: + sourceType: Artifact + destinationPath: $HOME/<+service.name>/<+env.name> + tags: {} + failureStrategies: + - onFailure: + errors: + - AllErrors + action: + type: StageRollback @@ -0,0 +1,19 @@ +service: + name: harness_ssh + identifier: harness_ssh + tags: {} + serviceDefinition: + spec: + artifacts: + primary: + primaryArtifactRef: <+input> + sources: + - spec: + connectorRef: harness_artifactrepo + artifactDirectory: / + artifactPath: todolist.war + repository: todolist-tutorial + repositoryFormat: generic + identifier: Todolist + type: ArtifactoryRegistry + type: Ssh @@ -0,0 +1,11 @@ +connector: + name: harness_artifactrepo + identifier: harness_artifactrepo + orgIdentifier: default + projectIdentifier: default_project + type: Artifactory + spec: + artifactoryServerUrl: https://harness.jfrog.io/artifactory + auth: + type: Anonymous + executeOnDelegate: false @@ -0,0 +1,19 @@ +connector: + name: harness_azureconnector + identifier: harness_azureconnector + description: "" + orgIdentifier: default + projectIdentifier: default_project + type: Aws + spec: + credential: + type: ManualConfig + spec: + accessKey: AWS_ACCESS_KEY_ID + secretKeyRef: azuresecret + awsSdkClientBackOffStrategyOverride: + type: FixedDelayBackoffStrategy + spec: + fixedBackoff: 0 + retryCount: 0 + executeOnDelegate: false @@ -0,0 +1,9 @@ +environment: + name: harnessdevenv + identifier: harnessdevenv + description: "" + tags: {} + type: PreProduction + orgIdentifier: default + projectIdentifier: default_project + variables: [] @@ -0,0 +1,19 @@ +infrastructureDefinition: + name: harness_remoteinstance + identifier: harness_remoteinstance + description: "" + tags: {} + orgIdentifier: default + projectIdentifier: default_project + environmentRef: harnessdevenv + deploymentType: WinRm + type: SshWinRmAzure + spec: + credentialsRef: harness_winrmpwd + connectorRef: harness_azureconnector + subscriptionId: VM_SUBSCRIPTION_ID + resourceGroup: VM_RESOURCE_GROUP + tags: + Name: INSTANCE_NAME + hostConnectionType: PublicIP + allowSimultaneousDeployments: false @@ -0,0 +1,80 @@ +pipeline: + name: harness_winrm_pipeline + identifier: harness_winrm_pipeline + projectIdentifier: default_project + orgIdentifier: default + tags: {} + stages: + - stage: + name: winrm-deploy + identifier: winrmdeploy + description: "" + type: Deployment + spec: + deploymentType: WinRm + service: + serviceRef: harness_winrm + serviceInputs: + serviceDefinition: + type: WinRm + spec: + artifacts: + primary: + primaryArtifactRef: <+input> + sources: <+input> + environment: + environmentRef: harnessdevenv + deployToAll: false + infrastructureDefinitions: + - identifier: harness_remoteinstance + execution: + steps: + - step: + name: Deploy + identifier: Deploy + type: Command + timeout: 10m + strategy: + repeat: + items: <+stage.output.hosts> + spec: + onDelegate: false + environmentVariables: [] + outputVariables: [] + commandUnits: + - identifier: Download_Artifact + name: Download Artifact + type: DownloadArtifact + spec: + destinationPath: "%USERPROFILE%\\<+service.name>\\<+env.name>" + rollbackSteps: + - step: + name: Rollback + identifier: Rollback + type: Command + timeout: 10m + strategy: + repeat: + items: <+stage.output.hosts> + spec: + onDelegate: false + environmentVariables: [] + outputVariables: [] + commandUnits: + - identifier: Do_Nothing_and_Print_Hello_World + name: Do Nothing and Print Hello World + type: Script + spec: + shell: PowerShell + source: + type: Inline + spec: + script: echo "Hello World!" + shell: PowerShell + tags: {} + failureStrategies: + - onFailure: + errors: + - AllErrors + action: + type: StageRollback @@ -0,0 +1,94 @@ +pipeline: + name: harness_winrm_pipeline + identifier: harness_winrm_pipeline + projectIdentifier: default_project + orgIdentifier: default + tags: {} + stages: + - stage: + name: deploy-winrm + identifier: deploywinrm + description: "" + type: Deployment + spec: + deploymentType: WinRm + service: + serviceRef: harness_winrm + serviceInputs: + serviceDefinition: + type: WinRm + spec: + artifacts: + primary: + primaryArtifactRef: <+input> + sources: <+input> + environment: + environmentRef: harnessdevenv + deployToAll: false + infrastructureDefinitions: + - identifier: harness_remoteinstance + execution: + steps: + - stepGroup: + identifier: Step_Group_1 + name: Step Group + strategy: + repeat: + items: <+stage.output.hosts> + start: 0 + end: 1 + unit: Count + steps: + - step: + name: Deploy + identifier: Deploy_1 + type: Command + timeout: 10m + spec: + onDelegate: false + environmentVariables: [] + outputVariables: [] + commandUnits: + - identifier: Download_Artifact + name: Download Artifact + type: DownloadArtifact + spec: + destinationPath: "%USERPROFILE%\\\\\\\\<+service.name>\\\\\\\\<+env.name>" + rollbackSteps: + - stepGroup: + identifier: Step_Group_Rollback_1 + name: Step Group Rollback + strategy: + repeat: + items: <+stage.output.hosts> + start: 0 + end: 1 + unit: Count + steps: + - step: + name: Rollback + identifier: Rollback_1 + type: Command + timeout: 10m + spec: + onDelegate: false + environmentVariables: [] + outputVariables: [] + commandUnits: + - identifier: Do_nothing_and_Print_Hello_World + name: Do nothing and Print Hello World + type: Script + spec: + shell: PowerShell + source: + type: Inline + spec: + script: echo "Hello World!" + shell: PowerShell + tags: {} + failureStrategies: + - onFailure: + errors: + - AllErrors + action: + type: StageRollback @@ -0,0 +1,108 @@ +pipeline: + name: harness_winrm_pipeline + identifier: harness_winrm_pipeline + projectIdentifier: default_project + orgIdentifier: default + tags: {} + stages: + - stage: + name: winrm-deploy + identifier: winrmdeploy + description: "" + type: Deployment + spec: + deploymentType: WinRm + service: + serviceRef: harness_winrm + serviceInputs: + serviceDefinition: + type: WinRm + spec: + artifacts: + primary: + primaryArtifactRef: <+input> + sources: <+input> + environment: + environmentRef: harnessdevenv + deployToAll: false + infrastructureDefinitions: + - identifier: harness_remoteinstance + execution: + steps: + - stepGroup: + name: Phase + identifier: Phase + strategy: + repeat: + items: <+stage.output.hosts> + maxConcurrency: 1 + partitionSize: 1 + unit: Count + steps: + - stepGroup: + name: Phase Group + identifier: phase_group + strategy: + repeat: + items: <+repeat.partition> + steps: + - step: + name: Deploy + identifier: Deploy + type: Command + timeout: 10m + spec: + onDelegate: false + environmentVariables: [] + outputVariables: [] + commandUnits: + - identifier: Download_Artifact + name: Download Artifact + type: DownloadArtifact + spec: + destinationPath: "%USERPROFILE%\\\\<+service.name>\\\\<+env.name>" + rollbackSteps: + - stepGroup: + name: Phase Rollback + identifier: Phase_Rollback + strategy: + repeat: + items: <+stage.output.hosts> + maxConcurrency: 1 + partitionSize: 1 + unit: Count + steps: + - stepGroup: + name: Phase Group Rollback + identifier: phase_group_rollback + strategy: + repeat: + items: <+repeat.partition> + steps: + - step: + name: Rollback + identifier: Rollback + type: Command + timeout: 10m + spec: + onDelegate: false + environmentVariables: [] + outputVariables: [] + commandUnits: + - identifier: Do_Nothing_and_Print_Hello_World + name: Do Nothing and Print Hello World + type: Script + spec: + shell: PowerShell + source: + type: Inline + spec: + script: echo "Hello World!" + shell: PowerShell + tags: {} + failureStrategies: + - onFailure: + errors: + - AllErrors + action: + type: StageRollback @@ -0,0 +1,19 @@ +service: + name: harness_winrm + identifier: harness_winrm + tags: {} + serviceDefinition: + spec: + artifacts: + primary: + primaryArtifactRef: <+input> + sources: + - spec: + connectorRef: harness_artifactrepo + artifactDirectory: / + artifactPath: todolist.zip + repository: todolist-tutorial + repositoryFormat: generic + identifier: Todolist + type: ArtifactoryRegistry + type: WinRm