Skip to content

Commit 46ee007

Browse files
authored
Releases/v3 fix is linux set (#480)
* set isLinux param for publish profile * Releases/v3 fix isLinux set
1 parent b17be61 commit 46ee007

File tree

14 files changed

+110
-28
lines changed

14 files changed

+110
-28
lines changed

lib/ActionInputValidator/ValidatorFactory.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,37 @@
11
"use strict";
2+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3+
if (k2 === undefined) k2 = k;
4+
var desc = Object.getOwnPropertyDescriptor(m, k);
5+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6+
desc = { enumerable: true, get: function() { return m[k]; } };
7+
}
8+
Object.defineProperty(o, k2, desc);
9+
}) : (function(o, m, k, k2) {
10+
if (k2 === undefined) k2 = k;
11+
o[k2] = m[k];
12+
}));
13+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14+
Object.defineProperty(o, "default", { enumerable: true, value: v });
15+
}) : function(o, v) {
16+
o["default"] = v;
17+
});
18+
var __importStar = (this && this.__importStar) || (function () {
19+
var ownKeys = function(o) {
20+
ownKeys = Object.getOwnPropertyNames || function (o) {
21+
var ar = [];
22+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23+
return ar;
24+
};
25+
return ownKeys(o);
26+
};
27+
return function (mod) {
28+
if (mod && mod.__esModule) return mod;
29+
var result = {};
30+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31+
__setModuleDefault(result, mod);
32+
return result;
33+
};
34+
})();
235
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
336
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
437
return new (P || (P = Promise))(function (resolve, reject) {
@@ -13,6 +46,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
1346
};
1447
Object.defineProperty(exports, "__esModule", { value: true });
1548
exports.ValidatorFactory = void 0;
49+
const core = __importStar(require("@actions/core"));
1650
const actionparameters_1 = require("../actionparameters");
1751
const AzureResourceFilterUtility_1 = require("azure-actions-appservice-rest/Utilities/AzureResourceFilterUtility");
1852
const BaseWebAppDeploymentProvider_1 = require("../DeploymentProvider/Providers/BaseWebAppDeploymentProvider");
@@ -35,6 +69,12 @@ class ValidatorFactory {
3569
return new PublishProfileContainerWebAppValidator_1.PublishProfileContainerWebAppValidator();
3670
}
3771
else {
72+
try {
73+
yield this.setResourceDetails(actionParams);
74+
}
75+
catch (error) {
76+
core.warning(`Failed to set resource details: ${error.message}`);
77+
}
3878
return new PublishProfileWebAppValidator_1.PublishProfileWebAppValidator();
3979
}
4080
}

lib/DeploymentProvider/Providers/WebAppDeploymentProvider.js

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,20 @@ class WebAppDeploymentProvider extends BaseWebAppDeploymentProvider_1.BaseWebApp
126126
}
127127
deleteReleaseZipForLinuxPhpApps(webPackage) {
128128
return __awaiter(this, void 0, void 0, function* () {
129+
// If the app is not a Linux app, skip the deletion of release.zip
130+
if (!this.actionParams.isLinux) {
131+
core.debug(`It's not a Linux app, skipping deletion of release.zip`);
132+
return;
133+
}
129134
const releaseZipPath = path_1.default.join(webPackage, 'release.zip');
130-
// Ignore if the app is not a Linux app or if release.zip does not exist
131-
if (!this.actionParams.isLinux || !fs_1.default.existsSync(releaseZipPath)) {
135+
if (!fs_1.default.existsSync(releaseZipPath)) {
136+
core.debug(`release.zip does not exist, skipping deletion: ${releaseZipPath}`);
132137
return;
133138
}
134139
let isPhpApp = yield this.checkIfTheAppIsPhpApp(webPackage);
135140
// No need to delete release.zip for non-PHP apps
136141
if (!isPhpApp) {
142+
core.debug(`Not a PHP app, skipping deletion of release.zip: ${releaseZipPath}`);
137143
return;
138144
}
139145
// Delete release.zip if it exists
@@ -152,10 +158,18 @@ class WebAppDeploymentProvider extends BaseWebAppDeploymentProvider_1.BaseWebApp
152158
// Check if the web package contains a composer.json file
153159
const composerFile = 'composer.json';
154160
if (fs_1.default.existsSync(path_1.default.join(webPackage, composerFile))) {
161+
core.debug(`Detected PHP app by presence of ${composerFile}`);
155162
return true;
156163
}
157164
// Check if the webPackage folder contains a .php file
158-
const hasPhpFiles = fs_1.default.readdirSync(webPackage).some(file => file.endsWith('.php'));
165+
core.debug(`Checking for .php files in the web package directory: ${webPackage}`);
166+
const hasPhpFiles = fs_1.default.readdirSync(webPackage, { withFileTypes: true, recursive: true }).some(file => file.isFile() && file.name.endsWith('.php'));
167+
if (hasPhpFiles) {
168+
core.debug(`Detected PHP app by presence of .php files`);
169+
}
170+
else {
171+
core.debug(`No .php files found in the web package directory`);
172+
}
159173
return hasPhpFiles;
160174
}
161175
catch (error) {

node_modules/.package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/@types/node/README.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/@types/node/http.d.ts

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/@types/node/package.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/electron-to-chromium/full-chromium-versions.js

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/electron-to-chromium/full-chromium-versions.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/electron-to-chromium/full-versions.js

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/electron-to-chromium/full-versions.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)