version v2

This commit is contained in:
2025-06-23 14:11:11 +02:00
parent 1a6741ec10
commit 1370bef1f1
11 changed files with 315 additions and 115 deletions

View File

@@ -451,6 +451,11 @@ async function startLaunch(data) {
throw new Error(dockerComposeResult.error || 'Failed to download docker-compose.yml');
}
// Set global version variables for deployment
window.currentDeploymentVersion = dockerComposeResult.latest_tag || dockerComposeResult.commit_hash || 'unknown';
window.currentDeploymentCommit = dockerComposeResult.commit_hash || 'unknown';
window.currentDeploymentBranch = data.branch;
// Update the step to show success
const dockerComposeStep = document.querySelectorAll('.step-item')[7];
dockerComposeStep.classList.remove('active');
@@ -2551,6 +2556,22 @@ async function deployStack(dockerComposeContent, stackName, port) {
{
name: 'ISMASTER',
value: 'false'
},
{
name: 'APP_VERSION',
value: window.currentDeploymentVersion || 'unknown'
},
{
name: 'GIT_COMMIT',
value: window.currentDeploymentCommit || 'unknown'
},
{
name: 'GIT_BRANCH',
value: window.currentDeploymentBranch || 'unknown'
},
{
name: 'DEPLOYED_AT',
value: new Date().toISOString()
}
]
}),
@@ -2573,34 +2594,9 @@ async function deployStack(dockerComposeContent, stackName, port) {
} catch (error) {
console.error('Error deploying stack:', error);
// Check if this is a timeout error
if (error.name === 'AbortError') {
return {
success: false,
error: 'Stack deployment timed out after 10 minutes. The operation may still be in progress.'
};
}
// Check if this is a network error
if (error.message && error.message.includes('fetch')) {
return {
success: false,
error: 'Network error during stack deployment. Please check your connection and try again.'
};
}
// Check if this is a response error
if (error.message && error.message.includes('Failed to deploy stack')) {
return {
success: false,
error: error.message
};
}
return {
success: false,
error: error.message || 'Unknown error during stack deployment'
error: error.message
};
}
}