Skip to content

Instantly share code, notes, and snippets.

View MarcusFelling's full-sized avatar

Marcus Felling MarcusFelling

View GitHub Profile
@MarcusFelling
MarcusFelling / example.yml
Created January 23, 2019 00:46
Audhari Poornimarao YAML example
# Build app using Azure Pipelines
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript?view=vsts
pool:
vmImage: 'vs2017-win2016'
steps:
– script: echo hello world
– task: NodeTool@0
inputs:
versionSpec: '8.x'
<#
.Description
Script used to bulk update Azure Pipeline release definition's WindowsMachineFileCopy from v1 to v2
.Example
.\Update-ReleaseDefinitionsWindowsMachineFileCopyTask.ps1 -PAT "NoTaReAlPaT" -AzureDevOpsProjectURL "https://vsrm.dev.azure.com/{organization}/{project}"
#>
[CmdletBinding()]
Param
using namespace System.Net
# Input bindings are passed in via param block.
param($Request, $TriggerMetadata)
# Write to the Azure Functions log stream.
"PowerShell HTTP trigger function processed a request."
# Get Personal Access Token (PAT) from query parameter of the request.
$PAT = $Request.Query.PAT
{
"manifestVersion": 1,
"id": "pipelinedecorator",
"name": "SonarQube Decorator Example",
"version": "1.0.2",
"publisher": "MarcusFelling-Blog",
"targets": [
{
"id": "Microsoft.VisualStudio.Services"
}
steps:
- ${{ if eq(resources.repositories['self'].ref, resources.repositories['self'].defaultBranch) }}:
- task: SonarQubePrepare@4
displayName: 'Prepare Code Analysis (injected from decorator)'
inputs:
SonarQube: 'My SonarQube Server'
scannerMode: 'MSBuild'
projectKey: '$(Build.DefinitionName)'
projectName: '$(Build.DefinitionName)'
projectVersion: '$(Build.BuildId)'
steps:
- ${{ if eq(resources.repositories['self'].ref, resources.repositories['self'].defaultBranch) }}:
- task: SonarQubeAnalyze@4
displayName: 'Run Code Analysis (injected from decorator)'
@MarcusFelling
MarcusFelling / azure-pipelines.yml
Created April 22, 2020 18:06
YAML pipeline for Space Game webb app
name: $(Major).$(Minor).$(Patch)
variables:
buildConfiguration: 'Release'
dotnetSdkVersion: '2.1.505'
serviceConnection: 'tailspin-space-game-rg'
appName: 'tailspin-space-game-web'
appID: '26178'
SITE_URL: 'https://$(appName)-$(System.StageName)-$(appID).azurewebsites.net'
wwwrootDir: 'Tailspin.SpaceGame.Web/wwwroot'
Major: '1'
jobs:
terraform:
name: "Run Terraform Plan"
runs-on: ubuntu-latest
# Add env variables for service principal
env:
ARM_CLIENT_ID: ${{ secrets.TF_VAR_ARM_CLIENT_ID }}
ARM_CLIENT_SECRET: ${{ secrets.TF_VAR_ARM_CLIENT_SECRET }}
ARM_SUBSCRIPTION_ID: ${{ secrets.TF_VAR_ARM_SUBSCRIPTION_ID }}
ARM_TENANT_ID: ${{ secrets.TF_VAR_ARM_TENANT_ID }}
name: "Terraform Plan"
on: pull_request
jobs:
terraform:
name: "Run Terraform Plan"
runs-on: ubuntu-latest
# Add env variables for service principal
env:
ARM_CLIENT_ID: ${{ secrets.TF_VAR_ARM_CLIENT_ID }}
ARM_CLIENT_SECRET: ${{ secrets.TF_VAR_ARM_CLIENT_SECRET }}
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"appName": {
"type": "string"
},
"sku": {
"type": "string",
"defaultValue": "F1",