diff --git a/.gitlabci/gitlab-ci-pleiade.yml b/.gitlabci/gitlab-ci-pleiade.yml index 9ca3b012e52910d7a420d3618697948dcdd9230a..0ccebde5ddf7e7b8c5a2fdd925605393df5cf921 100644 --- a/.gitlabci/gitlab-ci-pleiade.yml +++ b/.gitlabci/gitlab-ci-pleiade.yml @@ -27,10 +27,6 @@ prepare: stage: setup script: - .gitlabci/prepare.sh - artifacts: - paths: - - src/* - expire_in: 6 hours unittests: stage: test diff --git a/.gitlabci/prepare.sh b/.gitlabci/prepare.sh index 4563019ab1371d0456a041596c60023cc2e3fdce..b29ee1bd0502bb4f4064aba31ad3f3efb115debd 100755 --- a/.gitlabci/prepare.sh +++ b/.gitlabci/prepare.sh @@ -12,9 +12,3 @@ if [ "${VERSION}" != "${PREREQ_VERSION}" ]; then echo "Docker image (${PREREQ_VERSION}) and prerequisites version (${VERSION}) are inconsistent" exit 1 fi - -echo "+ downloading src..." -SRC_URL=${ROOT_URL}/src.git -git clone ${SRC_URL} src -# creates main branches -(cd src ; git checkout v16 ; git checkout main) diff --git a/.gitlabci/test.sh b/.gitlabci/test.sh index 01015b9840841acaf61b9b9f1f195cfad816e927..0b1086e645f877a74ec3296af009b8dc6ea7b2f4 100755 --- a/.gitlabci/test.sh +++ b/.gitlabci/test.sh @@ -6,6 +6,12 @@ args=( "-V" "--jobs=${jobs}" "$@" ) # unittests needs a complete clone git fetch --unshallow +echo "+ downloading src..." +SRC_URL=${ROOT_URL}/src.git +git clone ${SRC_URL} src +# creates main local branches +(cd src ; git checkout v16 ; git checkout main) + # path to the src clone export CODEASTER_SRC=$(pwd)/src # configure src diff --git a/bin/maint/create_histor.py b/bin/maint/create_histor.py index df750948bd174da09de2dc0715183de44d37456b..b8f084d4fe81a9bdc1a7225960917c16ad31491e 100755 --- a/bin/maint/create_histor.py +++ b/bin/maint/create_histor.py @@ -84,7 +84,7 @@ def build_header(tag, repopath, edsm=False): return header % {"tag": tag, "node": node, "date": date} -def major_text(tag, repopath): +def major_text(branch, tag, repopath): """return the text for a major version""" content = os.linesep.join( [ @@ -99,43 +99,16 @@ def major_text(tag, repopath): "", ] ) - cmd = [ - "hg", - "log", - "-R", - repopath, - "--rev", - "tag(%s)" % tag, - "--template", - "{node|short} {branch} {tags}\n", - ] - # out = convert(Popen(cmd, stdout=PIPE).communicate()[0]) - raise TypeError("todo: git") - try: - # node, branch, itag, name = out.split() - values = out.split() - node = values.pop(0) - branch = values.pop(0) - try: - values.remove(tag) - except ValueError: - pass - name = values.pop(0) - if branch == "default": - name = "testing" - except ValueError: - logger.error( - _( - "unexpected output, perhaps you are not in the " - "repository: tag and version name not found for '%s'" - ), - tag, - ) - raise RuntimeError + # git log --format=%H --max-count=1 16.6.0 + cmd = ["git", "-C", repopath, "log", "-1", "--format=%h", tag] + node = check_output(cmd, text=True).strip() + cmd = ["git", "-C", repopath, "tag", "-l", f"--contains={node}"] + tags = check_output(cmd, text=True).strip() + name = [i for i in tags if not i[0].isdigit()][0] infos = {"tag": tag, "node": node, "name": name, "branch": branch} infos["short"] = ".".join(tag.split(".")[:2]) + ".*" - # XXX voir texte pour oldstable, et stable sur default ? - if branch == "default": + # XXX voir texte pour oldstable, et stable sur main ? + if branch == "main": infos["maint"] = "maintenance corrective et évolutive" else: infos["maint"] = "maintenance corrective uniquement" @@ -160,7 +133,7 @@ def create_histor(rex, tag, repo, major, edsm=False, lmsg="last", format="text", text.append(convert(build_header(tag, repo, edsm))) text.append("") if major and tag: - text.append(convert(major_text(tag, repo))) + text.append(convert(major_text(major, tag, repo))) else: if rex and check_issue_list(rex): logger.debug(_("getting REX changelog")) @@ -191,7 +164,7 @@ if __name__ == "__main__": default=".", help="path to the src repository (default: current directory)", ) - parser.add_option("--major", action="store_true", help="create a file for a major version") + parser.add_option("--major", action="store", help="branch to create a file for a major version") parser.add_option("--edsm", action="store_true", help="create an histor for Salome-Meca") parser.add_option("--all", action="store_true", help="insert all the messages for each issues") parser.add_option(