Skip to content
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

Merged
merged 5 commits into from
Nov 29, 2018
Merged

Conversation

SumiranAgg
Copy link
Contributor

No description provided.

@SumiranAgg SumiranAgg changed the title file transform utility task [New Task] file transform utility task Nov 19, 2018
],
"outputVariables": [
{
"name": "PackageFolderPath",
Copy link
Contributor

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?

Copy link
Contributor Author

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

"name": "folderPath",
"type": "filePath",
"label": "Folder Path",
"defaultValue": "$(System.DefaultWorkingDirectory)/**/*.zip",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

defaultValue is zip?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙀

Copy link
Contributor Author

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

"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/>"
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

@@ -0,0 +1,26 @@
import tl = require('vsts-task-lib/task');
import { Package } from 'webdeployment-common/packageUtility';
var deployUtility = require('webdeployment-common/utility.js');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use let.

Copy link
Contributor Author

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.

@@ -0,0 +1,26 @@
import tl = require('vsts-task-lib/task');
Copy link
Contributor

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

Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it

var isFolderBasedDeployment: boolean = tl.stats(packagePath).isDirectory();
var folderPath = await deployUtility.generateTemporaryFolderForDeployment(isFolderBasedDeployment, packagePath, webPackage.getPackageType());

var isMSBuildPackage = !isFolderBasedDeployment && (await deployUtility.isMSDeployPackage(packagePath));
Copy link
Contributor

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 ?

Copy link
Contributor Author

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

var folderPath = await deployUtility.generateTemporaryFolderForDeployment(isFolderBasedDeployment, packagePath, webPackage.getPackageType());

var isMSBuildPackage = !isFolderBasedDeployment && (await deployUtility.isMSDeployPackage(packagePath));
fileTransformationsUtility.fileTransformations(isFolderBasedDeployment, JSONFiles, false, XmlVariableSubstitution, folderPath, isMSBuildPackage);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation.

"friendlyName": "File Transform",
"description": "File Transform",
"author": "Microsoft Corporation",
"helpMarkDown": "File Transforms & Variable Substitution",
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

"Agent",
"DeploymentGroup"
],
"demands": [],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove if not required.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

"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."
Copy link
Contributor

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 ? 🙀

Copy link
Contributor Author

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

@asranja
Copy link
Contributor

asranja commented Nov 28, 2018

Please add L0 and L2 tests. 😈

@SumiranAgg
Copy link
Contributor Author

Will take L0 in separate PR

@SumiranAgg SumiranAgg closed this Nov 29, 2018
@SumiranAgg SumiranAgg reopened this Nov 29, 2018
@SumiranAgg SumiranAgg merged commit e545401 into master Nov 29, 2018
@SumiranAgg SumiranAgg deleted the users/suaggar/fileTransform branch November 29, 2018 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants