feature: data factory export action

Co-authored-by: Allan Targino <13934447+allantargino@users.noreply.github.com>
Co-authored-by: Marcel Aldecoa <marcel.aldecoa@microsoft.com>
This commit is contained in:
Fernando de Oliveira 2021-09-17 09:47:02 -03:00
Родитель 4c85289be3
Коммит e79e323cd1
3 изменённых файлов: 53 добавлений и 0 удалений

5
Dockerfile Normal file
Просмотреть файл

@ -0,0 +1,5 @@
FROM node:16.6.2-stretch-slim
COPY export.sh /export.sh
ENTRYPOINT ["/export.sh"]

23
action.yml Normal file
Просмотреть файл

@ -0,0 +1,23 @@
name: data-factory-export
description: Export Azure Data Factory resources to an ARM Template
inputs:
path:
description: 'Directory that contains the Data Factory resources'
required: false
default: ./
id:
description: 'Data Factory resource ID'
required: false
default: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup/providers/Microsoft.DataFactory/factories/dataFactory'
outputs:
arm-template-directory:
description: 'Directory where the ARM template will be saved'
runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.path }}
- ${{ inputs.id }}

25
export.sh Executable file
Просмотреть файл

@ -0,0 +1,25 @@
#!/bin/sh -l
dataFactoryDirectory=$1
dataFactoryId=$2
armTemplateOutputSubDirectory="armTemplate"
cd $dataFactoryDirectory
ls -l
echo "Installing Azure Data Factory package..."
npm install
echo "Installation completed."
echo "Validating $dataFactoryId at $(pwd)..."
npm run build validate $(pwd) $dataFactoryId
echo "Validation completed."
armTemplateOutputDirectory="$dataFactoryDirectory/$armTemplateOutputSubDirectory"
echo "Exporting $dataFactoryId to $armTemplateOutputDirectory..."
npm run build export $(pwd) $dataFactoryId $armTemplateOutputSubDirectory
echo "Export completed."
echo "::set-output name=arm-template-directory::$armTemplateOutputDirectory"