Skip to content

Commit 5d1ff3c

Browse files
committed
chore: added backed-url param to allow remote storage on windows azure tekton task. Fix #212
Signed-off-by: Adrian Riobo Lorenzo <[email protected]>
1 parent f6f1c09 commit 5d1ff3c

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

tkn/infra-azure-windows-desktop.yaml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ spec:
2020
params:
2121
- name: project-name
2222
description: identifier for project.
23+
- name: backed-url
24+
description: |
25+
If we want to backed resources externally we can use az storage setting this param(i.e azblob://existing-storage).
26+
27+
If default will be store on storage workspace at path set by param ws-output-path.
28+
default: "''"
2329
- name: operation
2430
description: operation to execute within the infrastructure. Current values (create, destroy)
2531
default: create
@@ -66,6 +72,12 @@ spec:
6672
export ARM_SUBSCRIPTION_ID=$(cat /opt/credentials/subscription_id)
6773
export ARM_CLIENT_ID=$(cat /opt/credentials/client_id)
6874
export ARM_CLIENT_SECRET=$(cat /opt/credentials/client_secret)
75+
if ! [ -f /opt/credentials/storage_account ]; then
76+
export AZURE_STORAGE_ACCOUNT=$(cat /opt/credentials/storage_account)
77+
fi
78+
if ! [ -f /opt/credentials/storage_key ]; then
79+
export AZURE_STORAGE_KEY=$(cat /opt/credentials/storage_key)
80+
fi
6981
7082
# Output folder
7183
workspace_path=$(workspaces.pipelines-data.path)/$(params.workspace-resources-path)
@@ -79,7 +91,11 @@ spec:
7991
# Run qenvs
8092
cmd="qenvs azure windows $(params.operation) "
8193
cmd="$cmd --project-name $(params.project-name) "
82-
cmd="$cmd --backed-url file://${workspace_path} "
94+
if [[ $(params.backed-url) != "" ]]; then
95+
cmd="$cmd --backed-url $(params.backed-url) "
96+
else
97+
cmd="$cmd --backed-url file://${workspace_path} "
98+
fi
8399
if [[ $(params.operation) == "create" ]]; then
84100
cmd="$cmd --conn-details-output ${workspace_path} "
85101
cmd="$cmd --windows-featurepack $(params.windows-featurepack) "
@@ -123,5 +139,7 @@ spec:
123139
* subscription_id
124140
* client_id
125141
* client_secret
142+
* storage_account (optional if we use remote az storage)
143+
* storage_key (optional if we use remote az storage)
126144
mountPath: /opt/credentials
127145

0 commit comments

Comments
 (0)