From e328e26817f07cb64d47bec4e43767ad345e7b31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Veyret?= <stephane.veyret@neptura.org> Date: Tue, 30 Jan 2018 21:40:08 +0100 Subject: [PATCH 1/2] [fix] Update artifact links --- .gitlab/releaser/binartifact.py | 4 ++-- .gitlab/releaser/pipeline.py | 29 ----------------------------- .gitlab/releaser/releaser.py | 2 -- release/arch/linux/build-lin.sh | 2 +- 4 files changed, 3 insertions(+), 34 deletions(-) delete mode 100644 .gitlab/releaser/pipeline.py diff --git a/.gitlab/releaser/binartifact.py b/.gitlab/releaser/binartifact.py index 45c617a6c..cc3ab04e0 100644 --- a/.gitlab/releaser/binartifact.py +++ b/.gitlab/releaser/binartifact.py @@ -33,5 +33,5 @@ class BinArtifact(Artifact): return FSItemSize(int(os.path.getsize(self.file_name))) def _build_url(self): - return '{}/-/jobs/artifacts/{}/raw/{}?job={}'.format( - os.environ['CI_PROJECT_URL'], self.tag, self.file_name, self.job) + return '{}/-/jobs/{}/artifacts/raw/{}'.format( + os.environ['CI_PROJECT_URL'], self.job, self.file_name) diff --git a/.gitlab/releaser/pipeline.py b/.gitlab/releaser/pipeline.py deleted file mode 100644 index 48e72216e..000000000 --- a/.gitlab/releaser/pipeline.py +++ /dev/null @@ -1,29 +0,0 @@ -import json -import os -import urllib.request - -from projectapi import ProjectApi - -class Pipeline(ProjectApi): - ''' - Pipeline data API. - ''' - - def __init__(self): - ProjectApi.__init__(self, '/pipelines/{}'.format(os.environ['CI_PIPELINE_ID'])) - - def find_job_id(self, job_name): - ''' - Find the id corresponding to given job name in the pipeline. - :param job_name: The job name. - :type job_name: str - :return: The identifier. - :rtype: int - ''' - request = self.build_request('/jobs') - response = urllib.request.urlopen(request) - response_data = response.read().decode() - for job in json.loads(response_data): - if job['name'] == job_name: return job['id'] - print('CRITICAL No job with given name {} found'.format(job_name)) - exit(1) diff --git a/.gitlab/releaser/releaser.py b/.gitlab/releaser/releaser.py index 125be7649..dca044561 100644 --- a/.gitlab/releaser/releaser.py +++ b/.gitlab/releaser/releaser.py @@ -5,7 +5,6 @@ import os from binartifact import BinArtifact from job import Job -from pipeline import Pipeline from placeholder import PlaceHolder from releasenote import ReleaseNote from releasewikipage import ReleaseWikiPage @@ -91,7 +90,6 @@ class Releaser: for artifact in self._get_bin_artifacts(): if not artifact.job in jobs: jobs.append(artifact.job) - jobs = map(lambda j: Pipeline().find_job_id(j), jobs) for job_id in jobs: Job(job_id).keep_artifacts() print('Release published') diff --git a/release/arch/linux/build-lin.sh b/release/arch/linux/build-lin.sh index b06938b45..404135125 100644 --- a/release/arch/linux/build-lin.sh +++ b/release/arch/linux/build-lin.sh @@ -59,7 +59,7 @@ create_desc() { cat >"${1}".desc <<-EOF { "version": "${DUNITER_TAG}", - "job": "${CI_JOB_NAME}", + "job": "${CI_JOB_ID}", "type": "${2^}", "category": "${3}", "arch": "x64" -- GitLab From 7032516c7c0db492a2b2b372f00e5af9610eb544 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89lo=C3=AFs?= <elois@ifee.fr> Date: Tue, 30 Jan 2018 21:21:01 +0000 Subject: [PATCH 2/2] tmp rm tests --- .gitlab-ci.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d75bd05da..d649c2aa3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,6 @@ stages: - github-sync - build - - test - package - prerelease - release @@ -39,13 +38,6 @@ build: script: - yarn -test: - <<: *nvm_env - stage: test - script: - - yarn - - yarn test - .build_releases: &build_releases stage: package allow_failure: false -- GitLab