Skip to content

Commit ec95140

Browse files
committed
Version 0.1.3
1 parent b1e2c7f commit ec95140

File tree

5 files changed

+21
-18
lines changed

5 files changed

+21
-18
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ This task takes only one `version` parameter input (semantic versioning) which i
2222
steps:
2323
- task: BicepInstall@0
2424
inputs:
25-
version: 0.2.328
25+
version: 0.3.1
2626
```
2727
2828
# Run Bicep CLI build command task
@@ -63,12 +63,12 @@ export AGENT_TOOLSDIRECTORY="/tools" # Or any other existing directory
6363

6464
```powershell
6565
# For PowerShell:
66-
$env:INPUT_VERSION = "0.2.328" # Or any other valid Bicep version
66+
$env:INPUT_VERSION = "0.3.1" # Or any other valid Bicep version
6767
$env:INPUT_SOURCEDIRECTORY = "C:\bicep_files\*.bicep" # Or any other existing directory with bicep file(s)
6868
```
6969
```bash
7070
# For bash:
71-
export INPUT_VERSION="0.2.328" # Or any other valid Bicep version
71+
export INPUT_VERSION="0.3.1" # Or any other valid Bicep version
7272
export INPUT_SOURCEDIRECTORY="C:\bicep_files\*.bicep" # Or any other existing directory with bicep file(s)
7373
```
7474

src/install/task.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"version": {
1717
"Major": 0,
1818
"Minor": 1,
19-
"Patch": 2
19+
"Patch": 3
2020
},
2121
"instanceNameFormat": "Install Bicep CLI",
2222
"inputs": [

src/run/index.ts

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,8 @@ import * as taskLib from 'azure-pipelines-task-lib/task';
44
import * as toolLib from 'azure-pipelines-tool-lib/tool';
55
import glob from 'glob';
66

7-
export function getArgumentList(sourceDirectory: string): string[] {
8-
const args: Array<string> = new Array<string>();
9-
args.push('build');
10-
const files = glob.sync(sourceDirectory);
11-
const finalArgs = args.concat(files);
12-
return finalArgs;
7+
export function getFilesList(sourceDirectory: string): string[] {
8+
return glob.sync(sourceDirectory);
139
}
1410

1511
async function run() {
@@ -20,7 +16,7 @@ async function run() {
2016
throw new Error("The variable 'sourceDirectory' is mandatory.");
2117
}
2218

23-
let bicepTool;
19+
let bicepTool: any;
2420
const bicepToolName = taskLib.getVariable('BICEP_TOOL_NAME');
2521
const bicepToolVersion = taskLib.getVariable('BICEP_TOOL_VERSION');
2622
try {
@@ -45,15 +41,22 @@ async function run() {
4541
' before this task or ensure Bicep is installed and available in PATH in the agent',
4642
);
4743
}
48-
const args = getArgumentList(sourceDirectory);
44+
const files = getFilesList(sourceDirectory);
4945

5046
taskLib.debug('Running Bicep build...');
5147

5248
if (bicepTool) {
53-
const bicepProcess = taskLib.tool(bicepTool).arg(args).execSync();
54-
if (bicepProcess.code !== 0) {
55-
throw new Error('Failed to execute script');
56-
}
49+
files.forEach((file: string) => {
50+
const args = ['build', file];
51+
const bicepProcess = taskLib.tool(bicepTool).arg(args).execSync();
52+
53+
if (bicepProcess.code !== 0) {
54+
throw new Error(`Failed to execute script. Related file: ${file}`);
55+
} else {
56+
taskLib.debug(`- Built '${file}' successfully`);
57+
}
58+
});
59+
5760
taskLib.debug('Executed successfully');
5861
} else {
5962
throw new Error('Failed to locate Bicep binary');

src/run/task.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"version": {
1717
"Major": 0,
1818
"Minor": 1,
19-
"Patch": 2
19+
"Patch": 3
2020
},
2121
"instanceNameFormat": "Run Bicep CLI build command",
2222
"inputs": [

vss-extension.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"manifestVersion": 1,
33
"id": "bicep-tasks",
4-
"version": "0.1.2",
4+
"version": "0.1.3",
55
"name": "Bicep Tasks",
66
"publisher": "piraces",
77
"description": "Provides Azure DevOps tasks to install and run Microsoft Bicep CLI commands (cross-platform)",

0 commit comments

Comments
 (0)