You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+30-5Lines changed: 30 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,21 +31,36 @@ This tasks runs the `bicep build` command with an input path containing `.bicep`
31
31
32
32
This task takes only one `sourceDirectory` parameter input which is the path where the bicep file/files reside (can be a glob, or a single file).
33
33
34
-
## Sample YAML with the task
34
+
## Sample YAML with the task (for multiple files)
35
35
36
36
```yaml
37
37
steps:
38
38
- task: BicepBuild@0
39
39
inputs:
40
+
process: 'multiple'
40
41
sourceDirectory: '.\bicep_files\*.bicep'
42
+
stdout: false # Note if stdout is true 'outputDirectory' will not be interpreted
43
+
outputDirectory: '.\bicep_files\out' # Only when 'stdout' is false or not defined
44
+
```
45
+
46
+
## Sample YAML with the task (for single file)
47
+
48
+
```yaml
49
+
steps:
50
+
- task: BicepBuild@0
51
+
inputs:
52
+
process: 'single'
53
+
sourceFile: '.\bicep_files\sample1.bicep'
54
+
stdout: false # Note if stdout is true 'outputDirectory' will not be interpreted
55
+
outputFile: '.\bicep_files\sample1.out.json' # Only when 'stdout' is false or not defined and 'outputDirectory' is empty or not defined
41
56
```
42
57
43
58
# Local Development
44
59
45
60
**Note:** [Bicep](https://github.com/Azure/bicep) must be installed in the local machine. [TypeScript](https://www.typescriptlang.org/download) must be also installed as a global package (`npm i typescript -g`).
46
61
47
-
1. Run `npm install` in the `src` directory.
48
-
2. Run `tsc` in the `src` directory.
62
+
1. Run `npm install` in the root directory.
63
+
2. Run `npm run build` in the root directory.
49
64
3. Define the needed agent environment parameters:
50
65
51
66
```powershell
@@ -59,20 +74,30 @@ export AGENT_TEMPDIRECTORY="/temp" # Or any other existing directory
59
74
export AGENT_TOOLSDIRECTORY="/tools" # Or any other existing directory
60
75
```
61
76
62
-
4. (Optional) Set variables for the tasks:
77
+
4. (Optional) Set variables for the tasks (as you want to test):
63
78
64
79
```powershell
65
80
# For PowerShell:
66
81
$env:INPUT_VERSION = "0.3.1" # Or any other valid Bicep version
82
+
$env:INPUT_PROCESS = "multiple" # Selection between 'multiple' or 'single' file(s) processing
67
83
$env:INPUT_SOURCEDIRECTORY = "C:\bicep_files\*.bicep" # Or any other existing directory with bicep file(s)
84
+
$env:INPUT_SOURCEFILE = "C:\bicep_files\sample1.bicep" # Or any other existing bicep file
85
+
$env:INPUT_STDOUT = $false # To print the output to standard output (stdout) or not
86
+
$env:INPUT_OUTPUTDIRECTORY = "C:\bicep_files\out" # Or any other existing directory to store the json generated file(s)
87
+
$env:INPUT_OUTPUTFILE = "C:\bicep_files\sample1.out.json" # Or any other path/filename to store the generated file
68
88
```
69
89
```bash
70
90
# For bash:
71
91
export INPUT_VERSION="0.3.1" # Or any other valid Bicep version
92
+
export INPUT_PROCESS = "multiple" # Selection between 'multiple' or 'single' file(s) processing
72
93
export INPUT_SOURCEDIRECTORY="C:\bicep_files\*.bicep" # Or any other existing directory with bicep file(s)
94
+
export INPUT_SOURCEFILE = "C:\bicep_files\sample1.bicep" # Or any other existing bicep file
95
+
export INPUT_STDOUT = false # To print the output to standard output (stdout) or not
96
+
export INPUT_OUTPUTDIRECTORY = "C:\bicep_files\out" # Or any other existing directory to store the json generated file(s)
97
+
export INPUT_OUTPUTFILE = "C:\bicep_files\sample1.out.json" # Or any other path/filename to store the generated file
73
98
```
74
99
75
-
5. Run `node install/index.js` and `node run/index.js` to execute the two tasks.
100
+
5. Run `node src/install/index.js` and `node src/build/index.js` to execute the two tasks.
76
101
77
102
*Note:* the `bicep_files` directory containing `.bicep` files are only for development and testing purposes.
0 commit comments