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

Removed gulp, gulp-zip. Using archiver #3133

Merged
merged 2 commits into from
Nov 23, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Tasks/AzureRmWebAppDeployment/kuduutility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import path = require("path");
import fs = require("fs");
import httpClient = require('vso-node-api/HttpClient');
var httpObj = new httpClient.HttpClient(tl.getVariable("AZURE_HTTP_USER_AGENT"));
var gulp = require('gulp');
var zip = require('gulp-zip');
var zipUtility = require('webdeployment-common/ziputility.js');

export async function appOffineKuduService(publishUrl: string, physicalPath: string, headers, enableFeature: boolean) {
Expand Down
3 changes: 1 addition & 2 deletions Tasks/AzureRmWebAppDeployment/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
},
"homepage": "https://github.com/Microsoft/vsts-tasks#readme",
"dependencies": {

"q": "^1.4.1"
"q": "1.4.1"
},
"devDependencies": {
"mocha": "^3.1.0"
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureRmWebAppDeployment/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"version": {
"Major": 2,
"Minor": 1,
"Patch": 7
"Patch": 8
},
"minimumAgentVersion": "1.102.0",
"groups": [
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureRmWebAppDeployment/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"version": {
"Major": 2,
"Minor": 1,
"Patch": 7
"Patch": 8
},
"minimumAgentVersion": "1.102.0",
"groups": [
Expand Down
3 changes: 2 additions & 1 deletion Tasks/Common/webdeployment-common/ltxdomutility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export function initializeDOM(xmlContent) {
xmlDomLookUpTable = {};
headerContent = null;
var xmlDom = ltx.parse(xmlContent);
readHeader(xmlContent);
buildLookUpTable(xmlDom);
return xmlDom;
}
Expand All @@ -25,7 +26,7 @@ function readHeader(xmlContent) {
}

export function getContentWithHeader(xmlDom) {
return xmlDom ? (headerContent ? headerContent+"\n" : "") + xmlDom.root().toString() : "";
return xmlDom ? (headerContent ? headerContent + "\n" : "") + xmlDom.root().toString() : "";
}

/**
Expand Down
19 changes: 9 additions & 10 deletions Tasks/Common/webdeployment-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,15 @@
},
"homepage": "https://github.com/Microsoft/vsts-tasks#readme",
"dependencies": {
"vsts-task-lib": "^0.9.20",
"q": "^1.4.1",
"adal-node": "^0.1.15",
"xml2js": "^0.4.13",
"decompress-zip": "^0.3.0",
"gulp": "^3.9.1",
"gulp-zip": "^3.2.0",
"vso-node-api": "^5.0.5",
"winreg" : "^1.2.2",
"ltx": "^2.5.0"
"archiver": "1.2.0",
"adal-node": "0.1.15",
"decompress-zip": "0.3.0",
"ltx": "2.5.0",
"q": "1.4.1",
"vso-node-api": "5.1.1",
"vsts-task-lib": "0.9.20",
"winreg": "1.2.2",
"xml2js": "0.4.13"
},
"devDependencies": {
"mocha": "^3.1.2"
Expand Down
39 changes: 23 additions & 16 deletions Tasks/Common/webdeployment-common/ziputility.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import tl = require('vsts-task-lib/task');
import path = require('path');
import Q = require('q');
import fs = require('fs');

var gulp = require('gulp');
var zip = require('gulp-zip');
var DecompressZip = require('decompress-zip');
var archiver = require('archiver');

export function unzip(zipLocation, unzipLocation) {
export async function unzip(zipLocation, unzipLocation) {
var defer = Q.defer();
if(tl.exist(unzipLocation)) {
tl.rmRF(unzipLocation, false);
Expand All @@ -25,21 +25,28 @@ export function unzip(zipLocation, unzipLocation) {
return defer.promise;
}

export function archiveFolder(folderPath, targetPath, zipName) {
export async function archiveFolder(folderPath, targetPath, zipName) {
var defer = Q.defer();
tl.debug('Archiving ' + folderPath + ' to ' + zipName);
gulp.src(path.join(folderPath, '**', '*'),
{
dot: true
})
.pipe(zip(zipName))
.pipe(gulp.dest(targetPath)).on('end', function(error){
if(error) {
defer.reject(error);
}
defer.resolve(path.join(targetPath, zipName));
});
return defer.promise;
var outputZipPath = path.join(targetPath, zipName);
var output = fs.createWriteStream(path.join(targetPath, zipName));
var archive = archiver('zip', {
store: true
Copy link
Member

Choose a reason for hiding this comment

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

What is the significance of this compression type?

});
output.on('close', function () {
tl.debug('Successfully created archive ' + zipName);
defer.resolve(outputZipPath);
});

output.on('error', function(error) {
defer.reject(error);
});

archive.pipe(output);
archive.directory(folderPath, '/');
archive.finalize();

return defer.promise;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Tasks/IISWebAppDeploymentOnMachineGroup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"homepage": "https://github.com/Microsoft/vsts-tasks#readme",
"dependencies": {

"q": "^1.4.1"
"q": "1.4.1"
},
"devDependencies": {
"mocha": "^3.1.2"
Expand Down
2 changes: 1 addition & 1 deletion Tasks/IISWebAppDeploymentOnMachineGroup/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"version": {
"Major": 0,
"Minor": 0,
"Patch": 2
"Patch": 3
},
"demands": [
],
Expand Down
2 changes: 1 addition & 1 deletion Tasks/IISWebAppDeploymentOnMachineGroup/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"version": {
"Major": 0,
"Minor": 0,
"Patch": 2
"Patch": 3
},
"demands": [],
"minimumAgentVersion": "1.102.0",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/SqlAzureDacpacDeployment/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"version": {
"Major": 1,
"Minor": 1,
"Patch": 2
"Patch": 3
},
"demands": [
"sqlpackage"
Expand Down