Skip to content

Commit 32c5005

Browse files
authored
Releases/v3 fix all linux apps (#482)
* Delete release archive folder * push node modules
1 parent 46ee007 commit 32c5005

File tree

1,601 files changed

+182823
-2819
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,601 files changed

+182823
-2819
lines changed

lib/DeploymentProvider/Providers/WebAppDeploymentProvider.js

Lines changed: 5 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ class WebAppDeploymentProvider extends BaseWebAppDeploymentProvider_1.BaseWebApp
8080
break;
8181
case packageUtility_1.PackageType.folder:
8282
let tempPackagePath = utility.generateTemporaryFolderOrZipPath(`${process.env.RUNNER_TEMP}`, false);
83-
// excluding release.zip while creating zip for deployment if it's a Linux PHP app
84-
yield this.deleteReleaseZipForLinuxPhpApps(webPackage);
83+
// Excluding release.zip while creating zip for deployment if it's a Linux app
84+
yield this.deleteReleaseZipForLinuxApps(webPackage);
8585
webPackage = (yield zipUtility.archiveFolder(webPackage, "", tempPackagePath));
8686
core.debug("Compressed folder into zip " + webPackage);
8787
core.debug("Initiated deployment via kudu service for webapp package : " + webPackage);
@@ -124,58 +124,27 @@ class WebAppDeploymentProvider extends BaseWebAppDeploymentProvider_1.BaseWebApp
124124
core.setOutput('webapp-url', this.applicationURL);
125125
});
126126
}
127-
deleteReleaseZipForLinuxPhpApps(webPackage) {
127+
deleteReleaseZipForLinuxApps(webPackage) {
128128
return __awaiter(this, void 0, void 0, function* () {
129129
// If the app is not a Linux app, skip the deletion of release.zip
130130
if (!this.actionParams.isLinux) {
131131
core.debug(`It's not a Linux app, skipping deletion of release.zip`);
132132
return;
133133
}
134134
const releaseZipPath = path_1.default.join(webPackage, 'release.zip');
135+
// Check if release.zip exists
135136
if (!fs_1.default.existsSync(releaseZipPath)) {
136137
core.debug(`release.zip does not exist, skipping deletion: ${releaseZipPath}`);
137138
return;
138139
}
139-
let isPhpApp = yield this.checkIfTheAppIsPhpApp(webPackage);
140-
// No need to delete release.zip for non-PHP apps
141-
if (!isPhpApp) {
142-
core.debug(`Not a PHP app, skipping deletion of release.zip: ${releaseZipPath}`);
143-
return;
144-
}
145140
// Delete release.zip if it exists
146141
try {
147142
yield fs_1.default.promises.unlink(releaseZipPath);
148143
core.debug(`Deleted release.zip`);
149144
}
150145
catch (error) {
151-
core.debug(`Error while deleting release.zip for Linux PHP app: ${error}`);
152-
}
153-
});
154-
}
155-
checkIfTheAppIsPhpApp(webPackage) {
156-
return __awaiter(this, void 0, void 0, function* () {
157-
try {
158-
// Check if the web package contains a composer.json file
159-
const composerFile = 'composer.json';
160-
if (fs_1.default.existsSync(path_1.default.join(webPackage, composerFile))) {
161-
core.debug(`Detected PHP app by presence of ${composerFile}`);
162-
return true;
163-
}
164-
// Check if the webPackage folder contains a .php file
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-
}
173-
return hasPhpFiles;
174-
}
175-
catch (error) {
176-
core.debug(`Error while checking if the app is PHP: ${error}`);
146+
core.debug(`Error while deleting release.zip for Linux app: ${error}`);
177147
}
178-
return false;
179148
});
180149
}
181150
}

0 commit comments

Comments
 (0)