-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[New Task] file transform utility task #8847
Conversation
… users/suaggar/fileTransform
Tasks/FileTransform/task.json
Outdated
], | ||
"outputVariables": [ | ||
{ | ||
"name": "PackageFolderPath", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can u run this name with PM?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will be removed in next PR
Tasks/FileTransform/task.json
Outdated
"name": "folderPath", | ||
"type": "filePath", | ||
"label": "Folder Path", | ||
"defaultValue": "$(System.DefaultWorkingDirectory)/**/*.zip", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
defaultValue is zip?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we will support zip as well and in-line with deploy task zip makes more sense
Tasks/FileTransform/task.json
Outdated
"label": "XML variable substitution", | ||
"required": false, | ||
"defaultValue": false, | ||
"helpMarkDown": "Variables defined in the build or release pipelines will be matched against the 'key' or 'name' entries in the appSettings, applicationSettings, and connectionStrings sections of any config file and parameters.xml. Variable Substitution is run after config transforms. <br/><br/> Note: If same variables are defined in the release pipeline and in the environment, then the environment variables will supersede the release pipeline variables.<br/>" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can u please rename 'environment' to 'stage' here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
Tasks/FileTransform/filetransform.ts
Outdated
@@ -0,0 +1,26 @@ | |||
import tl = require('vsts-task-lib/task'); | |||
import { Package } from 'webdeployment-common/packageUtility'; | |||
var deployUtility = require('webdeployment-common/utility.js'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use let.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use var for global variables? am planning to use let within the function.
Tasks/FileTransform/filetransform.ts
Outdated
@@ -0,0 +1,26 @@ | |||
import tl = require('vsts-task-lib/task'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name of the task must be appended with the Version number. FileTransformV0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, add the task name in the make-options file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it
Tasks/FileTransform/filetransform.ts
Outdated
var isFolderBasedDeployment: boolean = tl.stats(packagePath).isDirectory(); | ||
var folderPath = await deployUtility.generateTemporaryFolderForDeployment(isFolderBasedDeployment, packagePath, webPackage.getPackageType()); | ||
|
||
var isMSBuildPackage = !isFolderBasedDeployment && (await deployUtility.isMSDeployPackage(packagePath)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we have "!isFolderBasedDeployment" check. Isn't this task supposed to run with Folders only ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we will support zip too
Tasks/FileTransform/filetransform.ts
Outdated
var folderPath = await deployUtility.generateTemporaryFolderForDeployment(isFolderBasedDeployment, packagePath, webPackage.getPackageType()); | ||
|
||
var isMSBuildPackage = !isFolderBasedDeployment && (await deployUtility.isMSDeployPackage(packagePath)); | ||
fileTransformationsUtility.fileTransformations(isFolderBasedDeployment, JSONFiles, false, XmlVariableSubstitution, folderPath, isMSBuildPackage); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation.
Tasks/FileTransform/task.json
Outdated
"friendlyName": "File Transform", | ||
"description": "File Transform", | ||
"author": "Microsoft Corporation", | ||
"helpMarkDown": "File Transforms & Variable Substitution", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Get the description, friendly name, helpmarkdown from the PM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure
Tasks/FileTransform/task.json
Outdated
"Agent", | ||
"DeploymentGroup" | ||
], | ||
"demands": [], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove if not required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Tasks/FileTransform/task.json
Outdated
"label": "Folder Path", | ||
"defaultValue": "$(System.DefaultWorkingDirectory)/**/*.zip", | ||
"required": true, | ||
"helpMarkDown": "File path to the package or a folder.<br />Variables ( [Build](https://docs.microsoft.com/vsts/pipelines/build/variables) | [Release](https://docs.microsoft.com/vsts/pipelines/release/variables#default-variables)), wildcards are supported. <br/> For example, $(System.DefaultWorkingDirectory)/\\*\\*/\\*.zip." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File path to the "package" or a folder ? 🙀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will take in next PR
Please add L0 and L2 tests. 😈 |
Will take L0 in separate PR |
No description provided.