This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
dagger/stdlib/azure/resourcegroup/rg.cue
Guillaume de Rouville bdd6b5a56e Port azure.#CLI from up to os.#Container + manual testing + integrate bats test
Signed-off-by: Guillaume de Rouville <guillaume.derouville@gmail.com>
2021-08-11 16:39:35 +02:00

40 lines
684 B
CUE

package resourcegroup
import (
"alpha.dagger.io/azure"
"alpha.dagger.io/os"
)
// Create a resource group
#ResourceGroup: {
// Azure Config
config: azure.#Config
// ResourceGroup name
rgName: string @dagger(input)
// ResourceGroup location
rgLocation: string @dagger(input)
// Container image
ctr: os.#Container & {
image: azure.#CLI & {
"config": config
}
always: true
command: """
az group create -l "\(rgLocation)" -n "\(rgName)"
az group show -n "\(rgName)" --query "id" -o json | jq -r . | tr -d "\n" > /resourceGroupId
"""
}
// Resource Id
id: {
os.#File & {
from: ctr
path: "/resourceGroupId"
}
}.contents @dagger(output)
}