Difference between revisions of "Azure/Azure Devops + az extension"
Line 46: | Line 46: | ||
Software included: | Software included: | ||
* [https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu1804-README.md ubuntu 18.04] | * [https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu1804-README.md ubuntu 18.04] | ||
Environment: | |||
<source> | |||
# Default working directory, also where repos get cloned | |||
$(Build.SourcesDirectory): /home/vsts/work/1/s | |||
# Published artifacts | |||
cd ../name-of-artifact/ | |||
</source> | |||
= Pipeline variables = | = Pipeline variables = |
Revision as of 23:50, 1 September 2020
What is Azure DevOps:
- Azure Repos - SCM/VCS system hosted in Azure
- Azure Pipelines - Build, test, release automations
- Azure Boards - Kanban board; JIRA like to track work, code defects, issues using Kanban or Scrum
- Azure Test Plans
- Azure Artifacts - share Maven, npm, NuGet from private and public sources
dotnet commands reference
dotnet restore **/*.csproj # Restores the dependencies and tools of a project dotnet build # Builds a project and all of its dependencies dotnet test **/*[Tt]ests/*.csproj # .NET test driver used to execute unit tests dotnet publish # Publishes the application and its dependencies to a folder for deployment to a hosting system
az-cli with azure-devops extension
<syntaxhighlightjs lang="bash"> az extension list az extension show --name azure-devops az extension add --name azure-devops [
{ "experimental": false, "extensionType": "whl", "name": "azure-devops", "path": "/home/piotr/.azure/cliextensions/azure-devops", "preview": false, "version": "0.18.0" }
] az login # login to get subscription level authentication az devops login # login to Azure DevOps Token: **** # <- generate a token in AzureDevops > UserSerrings > Personal tokens
- Optional set default organization and project, or add them per each command
az devops configure --defaults organization=https://dev.azure.com/contoso project=ContosoWebApp
- List all repos
- Linux
az repos list --organization=https://dev.azure.com/contoso/ --project=ContosoWebApp --query '[].{Name:name, Url:remoteUrl}' -o json | jq -r .[].Name
- PowerShell
(az repos list --query '[].{Name:name, Url:remoteUrl}' -o json | ConvertFrom-Json) | %{ git clone $_.Url } </syntaxhighlightjs>
Azure pipeline agents
Software included:
Environment:
# Default working directory, also where repos get cloned $(Build.SourcesDirectory): /home/vsts/work/1/s # Published artifacts cd ../name-of-artifact/
Pipeline variables
Syntax
regionName : "${{ variables.aws_region }}" regionName : $(aws_region)
Resources
- azuredevopsdemogenerator
- Variables usage, syntax, secrets
- Code Assessment Tools
- Security Tools
- SonarCloud
- SonarAnalyzer
- FxCop - check your code for security, performance, and design issues by Microsoft