Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/validate-bicep.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ jobs:
# Also ensure rad CLI can find bicep by creating the expected directory structure
mkdir -p ~/.rad/bin
cp /usr/local/bin/bicep ~/.rad/bin/rad-bicep
cp /usr/local/bin/bicep ~/.rad/bin/bicep
# Verify rad-bicep also works
~/.rad/bin/rad-bicep --version
# Verify bicep also works
~/.rad/bin/bicep --version
- name: Create a temporary file system
run: |
Expand Down
2 changes: 1 addition & 1 deletion bicep-types
2 changes: 1 addition & 1 deletion build/test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ test-functional-samples-noncloud: ## Runs Samples functional tests that do not r

.PHONY: test-validate-bicep
test-validate-bicep: ## Validates that all .bicep files compile cleanly
BICEP_PATH="${HOME}/.rad/bin/rad-bicep" ./build/validate-bicep.sh
BICEP_PATH="${HOME}/.rad/bin/bicep" ./build/validate-bicep.sh

.PHONY: test-helm
test-helm: ## Runs Helm chart unit tests
Expand Down
2 changes: 1 addition & 1 deletion deploy/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ Write-Output "rad CLI has been successfully installed"
Write-Output "`r`nInstalling Bicep..."
$cmd = (Start-Process -NoNewWindow -FilePath $RadiusCliFilePath -ArgumentList "bicep download" -PassThru -Wait)
if ($cmd.ExitCode -ne 0) {
Write-Warning "`r`nFailed to install rad-bicep"
Write-Warning "`r`nFailed to install bicep"
}
else {
Write-Output "Bicep has been successfully installed"
Expand Down
6 changes: 3 additions & 3 deletions deploy/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,13 @@ installFile() {
if [ -f "$RADIUS_CLI_FILE" ]; then
echo "$RADIUS_CLI_FILENAME installed into $RADIUS_INSTALL_DIR successfully"

echo "Installing rad-bicep (\"rad bicep download\")..."
echo "Installing bicep (\"rad bicep download\")..."
$RADIUS_CLI_FILE bicep download
result=$?
if [ $result -eq 0 ]; then
echo "rad-bicep installed successfully"
echo "bicep installed successfully"
else
echo "Failed to install rad-bicep"
echo "Failed to install bicep"
exit 1
fi

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ If you would like to test that your schema changes are compilable in a Bicep tem
1. Follow the steps in the Bicep [documentation](https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/install) to download Bicep.
Note: Alternatively, if you already have the Radius CLI installed, you can choose to use the Bicep binary that is installed as part of Radius. The Bicep binary gets downloaded to `./.rad/bin/rad-bicep`. You can use this file path instead.
Note: Alternatively, if you already have the Radius CLI installed, you can choose to use the Bicep binary that is installed as part of Radius. The Bicep binary gets downloaded to `./.rad/bin/bicep`. You can use this file path instead.
## Step 2: Create a file directory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ If you need to debug cleanup issues, re-run with RADIUS_TEST_FAST_CLEANUP=false
### Prerequisites

1. Place `rad` on your path
2. Make sure `rad-bicep` is downloaded (`rad bicep download`)
2. Make sure `bicep` is downloaded (`rad bicep download`)
3. Make sure your [local dev environment is setup](../contributing-code-control-plane/running-controlplane-locally.md)
4. Log into your Github account and [Generate PAT](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens)
5. Log-in to the container registry of your Github organization.
Expand Down
6 changes: 3 additions & 3 deletions pkg/cli/bicep/bicep.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ import (
)

const (
radBicepEnvVar = "RAD_BICEP"
binaryName = "rad-bicep"
BicepEnvVar = "BICEP"
binaryName = "bicep"
retryAttempts = 10
retryDelaySecs = 5
)

func GetBicepFilePath() (string, error) {
return tools.GetLocalFilepath(radBicepEnvVar, binaryName)
return tools.GetLocalFilepath(BicepEnvVar, binaryName)
}

// IsBicepInstalled returns true if our local copy of bicep is installed
Expand Down
12 changes: 6 additions & 6 deletions pkg/cli/bicep/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@ import (
// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
const SemanticVersionRegex = `(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?`

// Run rad-bicep with the given args and return the stdout. The stderr
// Run bicep with the given args and return the stdout. The stderr
// is not capture but instead redirected to that of the current process.
func runBicepRaw(args ...string) ([]byte, error) {
if installed, _ := IsBicepInstalled(); !installed {
return nil, fmt.Errorf("rad-bicep not installed, run \"rad bicep download\" to install")
return nil, fmt.Errorf("bicep not installed, run \"rad bicep download\" to install")
}

binPath, err := tools.GetLocalFilepath(radBicepEnvVar, binaryName)
binPath, err := tools.GetLocalFilepath(BicepEnvVar, binaryName)
if err != nil {
return nil, fmt.Errorf("failed to find rad-bicep: %w", err)
return nil, fmt.Errorf("failed to find bicep: %w", err)
}

// runs 'rad-bicep'
// runs 'bicep'
fullCmd := binPath + " " + strings.Join(args, " ")
c := exec.Command(binPath, args...)
c.Stderr = os.Stderr
Expand Down Expand Up @@ -72,7 +72,7 @@ func runBicepRaw(args ...string) ([]byte, error) {
// read the content
bytes, err := io.ReadAll(&buf)
if err != nil {
return nil, fmt.Errorf("failed to read rad-bicep output: %w", err)
return nil, fmt.Errorf("failed to read bicep output: %w", err)
}

return bytes, nil
Expand Down
6 changes: 3 additions & 3 deletions pkg/cli/bicep/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ func (i *Impl) PrepareTemplate(filePath string) (map[string]any, error) {

ok, err := IsBicepInstalled()
if err != nil {
return nil, fmt.Errorf("failed to find rad-bicep: %w", err)
return nil, fmt.Errorf("failed to find bicep: %w", err)
}

if !ok {
i.Output.LogInfo("Downloading Bicep for channel %s...", version.Channel())
err = DownloadBicep()
if err != nil {
return nil, fmt.Errorf("failed to download rad-bicep: %w", err)
return nil, fmt.Errorf("failed to download bicep: %w", err)
}
}

Expand All @@ -88,7 +88,7 @@ func (i *Impl) PrepareTemplate(filePath string) (map[string]any, error) {
return template, nil
}

// Call runs `rad-bicep` with the given arguments.
// Call runs `bicep` with the given arguments.
func (i *Impl) Call(args ...string) ([]byte, error) {
return runBicepRaw(args...)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/cmd/bicep/publishextension/publish.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func publishExtension(ctx context.Context, inputDirectoryPath string, target str
return err
}

// rad-bicep publish-extension <temp>/index.json --target <target>
// bicep publish-extension <temp>/index.json --target <target>
args := []string{
"publish-extension",
filepath.Join(inputDirectoryPath, "index.json"),
Expand Down
Loading