From 30c9f3cc77b3d297c3b0f964842c497fa6986e5a Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Wed, 26 Jun 2024 07:38:02 +0000 Subject: [PATCH] publication tag = timestamp ms --- .../plugins/server/GitlabHostingConnector.ts | 20 +++---------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/src/ts/plugins/server/GitlabHostingConnector.ts b/src/ts/plugins/server/GitlabHostingConnector.ts index 077c549c..b60eb811 100644 --- a/src/ts/plugins/server/GitlabHostingConnector.ts +++ b/src/ts/plugins/server/GitlabHostingConnector.ts @@ -179,27 +179,13 @@ export default class GitlabHostingConnector extends GitlabConnector implements H return `${projectUrl}/-/jobs/` } - async createTag(session: GitlabSession, websiteId: WebsiteId, job: JobData, { startJob, jobSuccess, jobError }: JobManager): Promise { + async createTag(session: GitlabSession, websiteId: WebsiteId, job: PublicationJobData, { startJob, jobSuccess, jobError }: JobManager): Promise { const projectId = websiteId // Assuming websiteId corresponds to GitLab project ID - - // Fetch the latest tag and determine the new tag - let newTag, tags - try { - job.message = 'Fetching latest tag and commits...' - // Fetch the latest tag - tags = await this.callApi(session, `api/v4/projects/${projectId}/repository/tags`, 'GET') - const latestTag = tags[0]?.name || 'v0.0.0' - const [major, minor, patch] = latestTag.slice(1).split('.').map(Number) - newTag = `v${major}.${minor}.${patch + 1}` - } catch (error) { - console.error('Error during fetching latest tag:', error.message) - jobError(job.jobId, `Failed to fetch latest tag: ${error.message}`) - return null - } - + const newTag = '_silex_' + Date.now() // Create a new tag try { job.message = `Creating new tag ${newTag}...` + job.logs[0].push(job.message) await this.callApi(session, `api/v4/projects/${projectId}/repository/tags`, 'POST', { tag_name: newTag, ref: 'main',