36
36
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
37
37
- uses : actions/checkout@v2
38
38
39
+ - name : Find test files
40
+ run : |
41
+ find ./DataPipelineTools.Functions.Tests/TestData -type f -name ".keepFolder"|while IFS=/ read filename; do
42
+ echo "$filename"
43
+ relativePath=$(echo "$filename" | sed -r 's/\.\/DataPipelineTools\.Functions\.Tests//g')
44
+ echo "$relativePath"
45
+ done
46
+
39
47
40
48
# Build and run the unit tests
41
49
- name : Setup .NET
@@ -160,6 +168,7 @@ jobs:
160
168
echo "Deployment Outputs"
161
169
#echo "::set-output name=STORAGE_ACCOUNTCONNECTION_STRING::$(echo $DEPLOYMENTOUTPUT | jq --raw-output '.storageAccountConnectionString.value')"
162
170
echo "::set-output name=STORAGE_ACCOUNT_NAME::$(echo $DEPLOYMENTOUTPUT | jq --raw-output '.storageAccountName.value')"
171
+ echo "::set-output name=STORAGE_CONTAINER_NAME::$(echo $DEPLOYMENTOUTPUT | jq --raw-output '.storageContainerName.value')"
163
172
echo "::set-output name=FUNCTIONS_APP_NAME::$(echo $DEPLOYMENTOUTPUT | jq --raw-output '.functionsAppName.value')"
164
173
echo "::set-output name=FUNCTIONS_APP_URI::$(echo $DEPLOYMENTOUTPUT | jq --raw-output '.functionsAppUri.value')"
165
174
echo "::set-output name=KEY_VAULT_NAME::$(echo $DEPLOYMENTOUTPUT | jq --raw-output '.keyVaultName.value')"
@@ -180,6 +189,7 @@ jobs:
180
189
#echo "FUNCTIONS_APP_KEY: ${{ steps.create-devtest-labs-environment.outputs.FUNCTIONS_APP_KEY }}"
181
190
#echo "STORAGE_ACCOUNTCONNECTION_STRING: ${{ steps.create-devtest-labs-environment.outputs.STORAGE_ACCOUNTCONNECTION_STRING }}"
182
191
echo "STORAGE_ACCOUNT_NAME: ${{ steps.create-devtest-labs-environment.outputs.STORAGE_ACCOUNT_NAME }}"
192
+ echo "STORAGE_CONTAINER_NAME: ${{ steps.create-devtest-labs-environment.outputs.STORAGE_CONTAINER_NAME }}"
183
193
echo "KEY_VAULT_NAME: ${{ steps.create-devtest-labs-environment.outputs.KEY_VAULT_NAME }}"
184
194
echo 'RUN_SETTINGS: ${{ steps.create-devtest-labs-environment.outputs.RUN_SETTINGS }}'
185
195
@@ -229,11 +239,22 @@ jobs:
229
239
uses :
kheiakiyama/[email protected]
230
240
with :
231
241
version : ' v10'
242
+ creds : ' ${{ secrets.AZURE_DEV_TEST_LABS_CREDENTIALS }}'
232
243
233
244
- name : Copy files to Azure Data Lake using AZCopy
234
245
run : |
235
- ls -ltA
236
- # azcopy_v10 --source {SOURCE} --destination {DEST} --dest-key ${{ secrets.STORAGE_KEY }} --recursive --set-content-type
246
+
247
+ STORAGE_ACCOUNT_NAME="${{ steps.create-devtest-labs-environment.outputs.STORAGE_ACCOUNT_NAME }}"
248
+ STORAGE_CONTAINER_NAME="${{ steps.create-devtest-labs-environment.outputs.STORAGE_CONTAINER_NAME }}"
249
+ # The exclude patter for the .keepDirectory files is not working, so workaround below if to find these files and remove them from ADLS
250
+ azcopy copy "./DataPipelineTools.Functions.Tests/TestData" "https://$STORAGE_ACCOUNT_NAME.dfs.core.windows.net/$STORAGE_CONTAINER_NAME" --recursive=true --exclude-pattern=".keepDirectory"
251
+
252
+ # Remove the .keepDirectory files, these are just used to allow us to add empty folders into the sample data in Git
253
+ find ./DataPipelineTools.Functions.Tests/TestData -type f -name ".keepFolder"|while IFS=/ read FILENAME; do
254
+ RELATIVE_PATH=$(echo "$FILENAME" | sed -r 's/\.\/DataPipelineTools\.Functions\.Tests\///g')
255
+ azcopy rm "https://$STORAGE_ACCOUNT_NAME.dfs.core.windows.net/$STORAGE_CONTAINER_NAME/$RELATIVE_PATH"
256
+ done
257
+
237
258
238
259
- name : ' Deploy Azure Functions to Lab Environment using RBAC'
239
260
uses : Azure/functions-action@v1
0 commit comments