Created Azure Pipelines (markdown)

Vince Salvino
2019-08-14 18:44:18 -04:00
parent 6028ad88e1
commit 47790361c0

36
Azure-Pipelines.md Normal file

@@ -0,0 +1,36 @@
ShellCheck is installed by default on the `ubuntu-latest` host in Azure Pipelines. To see all installed software, consult the [Azure documentation](https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops#use-a-microsoft-hosted-agent).
## Caveats
Trying to run ShellCheck as usual within the pipeline will produce an error:
```console
$ shellcheck myscripts/*.sh
myscripts/*.sh: myscripts/*.sh: openBinaryFile: does not exist (No such file or directory)
```
The recommended approach is to use `find` to search the files and pass a list of those to ShellCheck:
```console
$ shellcheck $(find $(pwd)/myscripts/ -name "*.sh")
```
## Example Pipeline
Copy the following yaml to run ShellCheck in Azure Pipelines against all *.sh files in the current directory:
```yaml
trigger:
- master
jobs:
- job: shellcheck
displayName: ShellCheck
pool:
vmImage: 'ubuntu-latest'
steps:
- script: shellcheck $(find $(pwd) -name "*.sh")
displayName: 'Running ShellCheck'
```